Labeling Your Data


Labeling Your Data

Including labels in Partiview is quite simple. To add a label anywhere in space, include a line in a data file (or issue it interactively at the Command Line with the add preface) that has this format:

x y z text your label

The text command will place the label “your label” at the point (x, y, z). These lines can either be included in a .speck file or in their own file with the .label extension. By default, each label is displayed with its label axes, a local red, green, blue axes, aligned to the world coordinates. These can be turned off using the laxes off command. The labels themselves can be toggled on and off using the Label Toggle Button or the labels command.

Setting the text color

If you wish to change the text color from the default white, you may use the textcment and textcolor commands. textcment allows you to assign a color to a color index, such as

textcment 14 0 1 0

where we assign the color green to color index 14. Once we've set a color index, then we use the textcolor command to assign the color to a color index, like

textcolor 14

Using these two commands allows us to set the text color for a given data group. Currently, there is no way to introduce a column that represents the text color. If you want several text colors for the labels within one data group, you will have to define multiple color indices with textcment and set the color with textcolor then list those labels you want with that color. Following that will come the next block of textcolor, data lines, etc.

Setting the Size

The size of your labels can be set using the labelsize, or lsize, command. The value of lsize is relative to the world coordinates. If you set lsize to be 1, then the entire label (including the height of capital letters and those that dip below the rule, like y or g) will be one unit high. For example, start up Partiview without any data, then add a label at the origin by issuing this command at the Command Line:

add 0 0 0 text My Label!

Now set the center size and the label size to be equal

censize 1
lsize 1
and fly away to see the entire label. You can see that the height from the bottom of the ‘y’ to the top of the ‘M’ is about 1 unit.

Turn off the label axes using

laxes off

By default, the size of a label depends on its distance from you. Nearby labels will appear larger than those far away. If you wish to alter this relationship between label size and distance, then you may specify a value in the text command. For any label data, instead of 0 0 0 text (0, 0, 0), you can specify that this point's label be twice the size of all other labels in the data group using this command:

0 0 0 text -size 2 (0, 0, 0)

Setting the minimum label size

Using the labelminpixels command, you can set the minimum size in pixels above which a label will be displayed. This is often useful to reduce label clutter in the display. For example, setting a labelmin of 8 means you are only drawing labels of 8 or more pixels in height. The labelmin value is, of course, dependent on the value of lsize. If lsize is high, then labelmin will need to be higher if you want to draw only the larger labels.

© 2002-2005 American Museum of Natural History
Last Modified: 2006-04-28 by Brian Abbott