| Search Locate Previous Next | Contents |
This allows you to set any text character or vector drawing as your graphics marker.
Using image files
You can use small GIF files (typically 16 by 16) as graphic markers, but please note that these do not scale when you zoom in on the viewer, or on the printout. Also they are not supported by the direct PostScript or EPS output. They are very suitable for PowerPoint style on-screen graphics where you need a strong visual effect.
chDefineMarker 23 'c:\data\icons\aplapple.gif'
Now you can use marker 23 as normal in line plots the VML or SVG output will insert a suitable <image> tag to reference it. This will assume 16 pixels square by default as height and width. You can override this default by specifying the image size (in pixels) which you want to show in the graphic:
chDefineMarker 23 'c:\data\icons\aplapple.gif=32,32'
In this case, the marker will be sized assuming that the original image file is 32 pixels square.
For SVG output, you may refer to an external image in this way, but a better option is to include the image definition as a symbol with a suitable id, and then refer to it from the marker definition:
chDefineMarker 24 '#mymark'
Again, you can force the scale of the marker by appending =ht,width to the marker id here. Be careful to keep the aspect ratio of the viewBox of the included symbol consistent with the scaled height and width.
Using characters as markers
Characters from any scalable font (TrueType or PostScript type-1) can be used in charts as custom markers. A simple use of this would be in a scatter plot, say of two datasets for Male and Female subjects:
chSet 'xyplot,nolines' chDefineMarker 20 'arb,12,M' chDefineMarker 21 'arb,12,F' chSet 'marker' 20 21 chPlot ?12 2½15 chPlot ?14 2½12 View PGchClose
This uses 12-point bold Arial M and F for the series. The markers are centred horizontally and vertically at the data values, but obviously with alphabetic characters there is some scope for confusion here. A good source of centred markers is the WingDings font, for example you might use the ringed numbers, as in the following example:
chSet 'xyplot,nolines' chDefineFont 'WING' 'Wingdings' chDefineMarker 101 'wing,18,C' © Wingdings 'C' is thumbs-up chDefineMarker 102 'wing,12,#146' © Wingdings '7' in a circle chSet 'marker' 101 102 chPlot ?12 2½15 chPlot ?14 2½12 View PGchClose
Note that you can enter the hi-bit characters as the appropriate symbol (probably pasted from CharMap), or as the octal code, preceeded by a backslash, or (as shown here) as the decimal code preceeded by a hash symbol. Use the octal notation if you are using a PostScript font (such as ZapfDingbats) and wish to output your charts as PDF documents (via Acrobat Distiller) or as EPS files.
You can use short phrases as well as single symbols if you prefer:
chDefineMarker 99 'arb,10,Ph'
Again, these will be centred at the datapoints.
Using vector markers
You can use the syntax of chDraw to define arbitrarily complex vector graphics, which will be drawn or solid-filled in the current colour. The outline is drawn using the current nib setting; the values are xy pairs, with all distances in points.
chDefineMarker 67 (3 2½0 0 10 10 20 10)
The zero point for the marker is always drawn at the data point, so you will probably want to centre your markers around zero. If you pass a vector definition, it is automatically reshaped to 2 columns. The default is to stroke the entire outline as a single connected polyline; to draw several segments add an extra column at the front of the array to mark pen-up or pen-down. The first element of this should always be 0 (pen-up), then you can insert 0 where you need to start a new polyline. If the final element in any segment is 2 instead of 1 the polyline willl be closed and filled rather than stroked.
Text and vector markers (and included SVG symbols) can be scaled using the marker-scale property.
See the Contour demo for an example of defining the standard molecular diagrams for Benzene and Phenol and using these as the markers on a scatter plot. See DefMark for a variety of custom text markers.
See also ...
MarkerScale marker scale