Synopsis
Returns a string containing a listing of objects at the specified depth.
Syntax
info_depth() info_depth(depth) info_depth(id) info_depth(id, depth)
Description
The function arguments.
Argument | Description |
---|---|
depth | Only show objects at this particular depth level. |
id | A ChipsId structure identifying the item. |
The info_depth command provide a means of seeing what objects are at various depths; see "ahelp depthcontrol" for more information on depth. The command returns a string that contains each depth accessed and the objects which are at that depth. A depth has been accessed if an object ever resided at that depth, even if there aren't any objects currently set to that depth.
The general format of the output string for each line is: the object type (Window, Frame, Plot, Coord Sys Id, etc.), a space, an open square bracket, the id of the object, and a close square bracket. An indentation before the object type shows that the object belongs to the object preceding it.
The window and frame objects are listed first. Under the frame, each depth is listed with its depth number. If the depth is hidden, the text "(hidden)" is included after the depth number. Under each depth are the objects which are located at that depth. Objects are listed in the order in which they were created within their context.
There are two exceptions to this format:
- If the object is part of a plot, the plot id is listed in parentheses after the object id, e.g. "histogram [my hist (mainplot)]"
- The title associated with a plot is included in the output as a label with an id of 'title' and the plot id, e.g. "label [title (plot1)]"
Viewing a Specific Depth
A depth may be specified in the info_depth command, causing only objects at that depth to be included in the output string.
Using a ChipsId argument
A ChipsId may be included to refine the context from which information will be displayed. Setting the window or frame member of a ChipsId and calling info_depth with that id will return information pertaining only to the specified window or frame. (Currently this feature only works with windows and frames.)
The info command supports preferences that are not available in info_depth; refer to "ahelp info" for details.
Examples
Example 1
chips> add_curve(range (10), range (10))
chips> print(info_depth()) Window [win1] Frame [frm1] Depth 100 label [title (plot1)] axis [bx1 (plot1)] axis [bx2 (plot1)] axis [by1 (plot1)] axis [by2 (plot1)] axis [ax1 (plot1)] axis [ay1 (plot1)] curve [crv1 (plot1)]
Print the info_depth results after adding a simple curve. The output shows that the curve, axes, and label were all added at the default depth of 100.
Example 2
chips> add_curve([5.25,6.25,7.25,8.25,9.25], [1,-1,5,7,6], 'line.color=red symbol.color=red depth=110') chips> add_histogram([1,-1,5,7,6], [5,6,7,8,9], [5.5,6.5,7.5,8.5,9.5]) chips> add_label(5, 6, 'Curve and Histogram') chips> add_frame() chips> add_label(.1, .9, 'New Curve', 'depth=110 color=red size=20') chips> x = np.arange(0, 2*np.pi, 0.1) chips> add_curve(np.cos(x), np.sin(x), 'plot.id=myplot plot.topmargin=.095 depth=50') chips> hide_depth(110)
chips> print(info_depth()) Window [win1] Frame [frm1] Depth 100 label [title (plot1)] axis [bx1 (plot1)] axis [bx2 (plot1)] axis [by1 (plot1)] axis [by2 (plot1)] axis [ax1 (plot1)] axis [ay1 (plot1)] histogram [hist1 (plot1)] label [lbl1] Depth 110 curve [crv1 (plot1)] Frame [frm2] Depth 50 curve [crv1 (myplot)] Depth 100 label [title (myplot)] axis [bx1 (myplot)] axis [bx2 (myplot)] axis [by1 (myplot)] axis [by2 (myplot)] axis [ax1 (myplot)] axis [ay1 (myplot)] Depth 110 (hidden) label [lbl1]
The depth info from a slightly more complicated ChIPS session includes several plots, curves, and annotations. Depth 110 in frame 'frm2' is hidden, which is indicated by the "(hidden)" text.
Example 3
chips> id = ChipsId() chips> add_curve(id, range (10), range (10), 'depth=50') chips> add_histogram([1,2,3], [4,5,6], 'id="my hist" depth=50') chips> add_label(1,8, 'Curve and Histogram') chips> add_frame() chips> add_label(.1,.95, 'New Curve') chips> x = np.arange(0, 2*np.pi, 0.1) chips> add_curve(x, np.sin(x), "depth=50")
chips> print(info_depth(id)) Window [win1] Frame [frm1] Depth 50 curve [crv1 (plot1)] histogram [my hist (plot1)] Depth 100 label [title (plot1)] axis [bx1 (plot1)] axis [bx2 (plot1)] axis [by1 (plot1)] axis [by2 (plot1)] axis [ax1 (plot1)] axis [ay1 (plot1)] label [lbl1]
Display the depths of objects which are in the window and frame described by the ChipsId, namely 'win1' and 'frm1'. The ChipsId is populated by passing it to the add_curve command.
Example 4
chips> z = np.asarray([1,1,1,1,3,1,1,1,1]).reshape(3,3) chips> add_contour(z) chips> add_curve([1,2,3,4], [1,2,1,2], 'depth=75') chips> add_hline(1.5,'color=red depth=75') chips> add_frame() chips> add_label(.1, .95, 'Simple Contour', 'depth=75')
chips> print(info_depth(75)) Window [win1] Frame [frm1] Depth 75 curve [crv1 (plot1)] line [line1] Frame [frm2] Depth 75 label [lbl1]
Display all objects which have a depth of 75.
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.
See Also
- axes
- info_bound_axes
- chips
- chips, chipsgui, chipsrc, show_gui
- concepts
- aspectratio, attributes, chipsid, chipsopt, colors, coordsys, currency, depthcontrol, entitycreation, preferences, setget
- coordinates
- info_coordinate
- utilities
- highlight_object, info, info_current