Synopsis
Returns a string containing a listing of ChIPS objects.
Syntax
info() info(id)
Description
The function arguments.
Argument | Description |
---|---|
id | A ChipsId structure identifying the item. |
The info command provides a means of seeing what objects the user has created and to find basic information regarding those objects. The info command returns a list of objects created, which objects contain other objects, and the ids associated with each object.
There are also specialized versions of this command, each with their own ahelp page:
- info_bound_axes()
- info_coordinate()
- info_current()
- info_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. Objects are listed in the order in which they were created within the parent object.
For example:
Window [win1] Frame [frm1] Plot [alpha] (0.15,0.15) .. (0.90,0.90) Frame [frm2] Plot [beta] (0.15,0.15) .. (0.90,0.90)
In this example, "frm1" and "frm2" belong to (i.e. are contained by) "win1". Plot "alpha" belongs to frame "frm1", while plot "beta" belongs to frame "frm2".
There are two exceptions to this format: plots and plot border axes.
Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2]
- Plots: the line includes the dimensions of the plot after the id. The syntax is "(x1, y1) .. (x2, y2)", where (x1, y1) is the lower left corner of the plot area and (x2, y2) is the upper right corner of the plot area. These coordinates are given in frame-normalized units, where (0,0) refers to the bottom-left of the frame and (1,1) is the top-right of the frame.
- Plot border axes: the plot border axes are treated as a single entity with information on the four axes put on a single line. The line starts with object title of 'Border' and continues by listing each side (bottom, top, left, and right), followed by the id for that axis.
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 with that id will return information pertaining only to the specified window or frame. (Currently this feature only works with windows and frames.)
Customizing the info Command
There are a few preferences in the info command, which allow more information about each object to be included in the output. All extra information about the objects is displayed after the object id and close bracket. The set_preference and set_preferences commands are used to change the info preference values.
Please see the section "Info Preferences" below the examples for a list of the info preferences.
Examples
Example 1
chips> clear() chips> x = np.arange(10) chips> add_curve(x, x**2)
Print the info after adding a simple curve; for this example we would see:
chips> print(info()) Window [win1] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1]
Example 2
chips> clear() chips> x1 = np.arange(10) chips> x2 = np.arange(0, 2*np.pi) chips> y2 = np.sin(x2) chips> add_curve(x1, x1) chips> add_histogram([1,2,3], [4,5,6], "id=h1") chips> add_label(1, 8, "Curve and Histogram") chips> split(2, 1, 0.07) chips> add_curve(x2, y2, "symbol.style=none") chips> add_label(.1, .2, "New Curve", "coordsys=PLOT_NORM")
The info displayed from a slightly more complicated ChIPS session several plots, curves, and annotations. Note that the histogram has a user-specified label (here "h1") which is reflected in the output shown below:
chips> print(info()) Window [win1] Frame [frm1] Plot [plot1] (0.15,0.56) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1] Histogram [h1] Label [lbl1] Plot [plot2] (0.15,0.15) .. (0.90,0.49) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1] Label [lbl1]
Example 3
chips> clear() chips> x1 = np.arange(10) chips> x2 = np.arange(0, 2*np.pi, 0.1) chips> y2 = np.sin(x2) chips> add_curve(x1, 2*x1-5) chips> add_histogram([1,2,3], [4,5,6], "id=h1") chips> add_label(1, 8, "Curve and Histogram") chips> id = ChipsId() chips> add_frame(id) chips> add_curve(x2, y2, "plot.topmargin=.3 symbol.style=none") chips> add_label(.1, .2, "New Curve", "coordsys=PLOT_NORM")
Display all objects which are in the current window and the the second frame by passing a ChipsId to the info command. The frame member of the ChipsId was populated with "frm2" when calling the add_frame command. The output of the command is:
chips> print(info(id)) Window [win1] Frame [frm2] Plot [plot1] (0.15,0.15) .. (0.90,0.70) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1] Label [lbl1]
which can be compared to the full output of info for this visualization:
Window [win1] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1] Histogram [h1] Label [lbl1] Frame [frm2] Plot [plot1] (0.15,0.15) .. (0.90,0.70) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1] Label [lbl1]
Example 4
chips> clear() chips> add_contour([1,1,1,1,3,1,1,1,1], 3, 3) chips> add_hline(1.5, "color=red") chips> add_label(.1, .95, "Simple Contour", "coordsys=FRAME_NORM") chips> set_preference("info.coord", "true")
Display all objects currently created in the ChIPS session, including the coordinate systems of all objects:
chips> print(info()) Window [win1] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] cs PLOT_NORM Y Axis [ay1] cs PLOT_NORM Contour [ctr1] cs DATA:plot1_ax1ay1 Line [line1] cs DATA:plot1_ax1ay1 Label [lbl1] cs FRAME_NORM
Example 5
chips> x = np.arange(-10,10) chips> clear() chips> add_axis(XY_AXIS, .5, 0, 10, "depth=90") chips> set_plot("style=open") chips> add_curve(x, x**2) chips> add_region(4, 0, 0, 5, "fill.style=solid depth=95") chips> set_preference("info.depth", "true")
Display all objects currently created in the ChIPS session, including the depths:
chips> print(info()) Window [win1] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] d 90 Y Axis [ay1] d 90 Curve [crv1] d 100 Region [reg1] d 95
If the "info.coord" preference is also set to "true" then the output would look like:
Window [win1] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] d 90 cs PLOT_NORM Y Axis [ay1] d 90 cs PLOT_NORM Curve [crv1] d 100 cs DATA:plot1_ax1ay1 Region [reg1] d 95 cs DATA:plot1_ax1ay1
Example 6
chips> clear() chips> x = np.arange(1,11) chips> split(2) chips> add_curve(x, x) chips> current_plot("plot2") chips> add_curve(x, x**2, "axis.x.id=myx axis.y.id=myy") chips> add_window() chips> add_curve(x, x**3, "id=cubic") chips> current_window("win1") chips> set_preference("info.current", "true")
When printed to the screen, ids of objects which are current will be highlighted using reverse video. In the output below this is indicated by surrounding the id values by "*":
chips> print(info()) Window [*win1*] Frame [*frm1*] Plot [plot1] (0.15,0.52) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [crv1] Plot [*plot2*] (0.15,0.15) .. (0.90,0.52) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [*myx*] Y Axis [*myy*] Curve [*crv1*] Window [win2] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Curve [cubic]
Info Preferences
The following preference settings affect the output of the info() command.
Argument | Description | Options | Default | Related command |
---|---|---|---|---|
coord | Appends the coordinate system of all applicable objects as "cs <coordinate system>". If the object is in data coordinates, the data coordinate id is included: "cs DATA:<id>". | see the Booleans section of "ahelp chipsopt" | false | info_cordinate() |
current | Displays the current objects in reverse video. Several characters are added around the ids, which should be taken into account if parsing the string. | see the Booleans section of "ahelp chipsopt" | false | info_current() |
depth | Appends the depth of all applicable objects as "d <depth>". | see the Booleans section of "ahelp chipsopt" | false | info_depth() |
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
- depth
- info_depth
- utilities
- highlight_object, info_current