plreserv
move origin for concatenating sub-plots
parameter | type | units | description |
---|---|---|---|
xorg,yorg | float | mm | relative origin in a sub-plot |
yhigh | float | mm | reserved height for next sub-plot |
returns: | void |
Description
plreserv is used to generate sub-plots and arranging these in the available space. It moves the origin so that the next sub-plot is plotted below previous one. If the sub-plot doesn't fit below previous one, a new column of sub-plots will be started. The coordinates of the origin in the reserved space will be at xorg,yorg millimeters realtive to the lower left corner of that space. The height of the reserved space will be yhigh millimeters. Use plclip or plclipm to arrange for blank margins around the plotting field.Examples
The following example arranges variable width sub-plots in columns. In order to prevent the plots to overlap it is important that their contents do not reach x-positions more than xorg millimeters to the left of the x-position of the origin -- preferably plotting should occur only to the right of the origin. Thus centering the strings this example would cause overlap:plinit PS plreserv1 A4 0 0 "" "" plmvorg 10 10 plclip 0 0 130 25 plframe -1 0 plreserv 5 0 7 pltext john plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext john plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext gerald plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext benedict plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext anny plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext ahasveros plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext gil plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext john plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext john plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext gerald plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext benedict plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext anny plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext ahasveros plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext gil plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext john plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext gerald plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext benedict plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext john plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext anny plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext ahasveros plframe 1 0 plframe -1 0 plreserv 5 0 7 pltext gil plframe 1 0 plframe -1 0The next example fills available space regularly with boxes; note that the origin and the clipping window are marked afterwards -- doing it first would make the plotting space unavailable for use by plreserv:
#include <simplot.h> int main() { int i; plinit(PS,"plreserv2",A4,50,50,"",""); plsave(); // save current origin etcetera plclip(0,0,160,160); for (i=0;i<9;i++) { plreserv(30,20,50); pldot(0,0,0); plframe(20,2); plframe(-1,0); } plunsave(); // restore original origin etcetera plformat(0,0,"X"); // mark origin plunclip(); plrect(0,0,160,160); // plot clipping window exit(0); }