Search


Ploticus > Prefabs >
draw prefab


This prefab reads and executes sets of commands which specify low-level drawing operations. See the Discussion below for usage example.

The commands may be one of two distinct types:

a. a ploticus drawdump file (created via pl -drawdump) Often used with prefabs as a way to overlay or combine graphs.

b. ploticus draw commands - a set of commands as described below for creating lines, polygons, and text, in either absolute space or scaled space. May be useful as a flexible way to add annotation, or to add graphics that the other plotting procedures cannot produce, or to import graphics generated programatically.

If you use the dumpfile attribute, drawdump content is expected. Otherwise, ploticus draw commands are expected.

Parameters

    If using dumpfile, none of the standard prefab parameters are applicable. If you're processing ploticus draw commands, and are using commands that operate in scaled space, the following standard prefab parameters apply: rectangle, xrange, and yrange.

    dumpfile     filename
    a drawdump file as created previously using pl -drawdump or pl -drawdumpa
    Example: dumpfile=dump1


    cmdfile     filename
    the name of a file containing ploticus draw commands , one per line. You can also use stdin for draw commands to be read from standard input.


Discussion

It's possibile to overlay/combine plots from multiple pl prefab runs using the -drawdump and -drawdumpa command line options to overlay and/or combine plots from multiple pl runs into one graphic image / result. For example ,IP
pl -prefab scat "rectangle= 1 1 3 3" .... -drawdump mydump <br>
pl -prefab scat "rectangle= 4 1 6 3" .... -drawdumpa mydump <br>
pl -prefab draw dumpfile=mydump  -png -o all.png

Hints:

If you're setting a background color this should be done only in the first pl invocation.

For overlays using the same plotting area rectangle and scaling, turn off axis generation (xaxis=none yaxis=none).

For overlays using same plotting area rectangle and different scaling, use eg. yaxis=left for one and yaxis=right for the other.

Clickmap/mouseover info is not retained in drawdump file, but can be generated by individual pl invocation for PNG (etc.)

You can get a graphic result while generating a drawdump.. just specify the device argument somewhere to the right of the -drawdump <i>filename</i> argument on the command line.




Example

  pl -prefab draw  cmdfile=drawcom.dcm  xrange="0 40"  yrange="0 40"  \\
  rectangle="1 1 3 3"

  The drawcom.dcm file begins like this:
	movs 3.5 23 
	lins 3.5 22 
	lins 3 21.6 





 


Ploticus 2.42 ... May 2013 Terms of use /