Saving your models
A PMD (Prestoplot MoDel file) contains the configuration parameters of a graph (i.e. all its style and configuration, minus the data sets). This is used to reproduce the style of a graph but using a new set of loaded data.
i.e. Displaying similar graphs using data from two different days or periods of time.
A graph saved in a PMD file is not sufficient to be reloaded. You will need the original datasets (or at least datasets with the same names) to reopen a similar graph (looking likes the one you saved).
There is currently two supported formats to save models :
- Binary PMD (.pmdb) - recommanded
- Legacy PMD (.pmd) - deprecated
In a nutshell
- Purpose: Format for saving chart models (formatting without data).
- Contents: Only and all formatting settings :
- Curve colors and thickness.
- Axis titles, scales, and configurations.
- Zoom levels and user customizations.
There is no dataset information in this file.
- Usage:
- Apply a predefined style to new charts.
- Share chart styles without data.
Binary PMD (.pmdb)
Binary PMD files are the recommanded new way to store your graphs. They are more efficient and more compressed than legacy ones.
If you start using PrestoPlot, you should consider using them instead of legacy PMD.
Legacy PMD (.pmd)
Legacy PMD files are the original way to store model informations. The informations were stored in an internal ASCII format that is no more recommended today.
If you just want to save a model, use the Binary PMD instead, if you want to produce models (by hand or programmaticaly, use the PGD format)
A legacy PMD file has the following structure:
- Encoding - A comment describing the encoding of this file.
- PrestoPlot version information - A comment describing PrestoPlot version used to create the .pmd file.
- File version information - The format version for the file (0 before 4.6.0 and 1 from 4.6.0 onwards).
- Graph attributes - How the graph as a whole is displayed (see Configure Graph).
- Grid attributes - How the background grid is displayed
- Legend attributes - How and where the legend is displayed
- Graph elements - How the data elements and their markers are displayed
- Graph axes - How the axes are displayed
- Extra information - Information not covered by the other sections
Attribute details
Warning
These files are internal PrestoPlot files and incorrect contents could cause PrestoPlot to stop working correctly. As such you should modify them at your own risk.
Graph attributes
- -aspect - Define the Width/height aspect ratio for the graph (default 0.0 fill window space)
- -background - Sets the background color. This includes the margins and legend, but not the plotting area.
- -borderwidth - Sets the width of the 3-D border around the outside edge of the widget. The -relief option determines if the border is to be drawn.
- -bottommargin - If non-zero, overrides the computed size of the margin extending below the X-coordinate axis. If pixels is 0, the automatically computed size is used.
- -font - Sets the font of the graph title.
- -foreground - Sets the graph title foreground color.
- -highlightbackground - Sets the background color when a graph is selected using the mouse.
- -highlightcolor - Sets the foreground color when a graph is selected using the mouse.
- -highlightthickness - Sets the thickness in pixels of the highlight border around the graph.
- -justify - Specifies how the title should be justified. This matters only when the title contains more than one line of text. Justify must be left, right, or center.
- -leftmargin - If non-zero, overrides the computed size of the margin extending from the left edge of the window to the Y-coordinate axis. If 0, the automatically computed size is used.
- -plotbackground - Specifies the background color of the plotting area.
- -plotborderwidth - Sets the width of the 3-D border around the plotting area. The -plotrelief option determines if a border is drawn.
- -plotpadx - Sets the amount of padding to be added to the left and right sides of the plotting area. Pad can be a list of one or two screen distances. If pad has two elements, the left side of the plotting area entry is padded by the first distance and the right side by the second. If pad is just one distance, both the left and right sides are padded evenly.
- -plotpady - Sets the amount of padding to be added to the top and bottom of the plotting area. Pad can be a list of one or two screen distances. If pad has two elements, the top of the plotting area is padded by the first distance and the bottom by the second. If pad is just one distance, both the top and bottom are padded evenly.
- -plotrelief - Specifies the 3-D effect for the plotting area. Relief specifies how the interior of the plotting area should appear relative to rest of the graph; for example, raised means the plot should appear to protrude from the graph, relative to the surface of the graph.
- -relief - Specifies the 3-D effect for the graph widget. Relief specifies how the graph should appear relative to widget it is packed into; for example, raised means the graph should appear to protrude.
- -rightmargin - If non-zero, overrides the computed size of the margin extending from the plotting area to the right edge of the window. By default, the legend is drawn in this margin. If pixels is 0, the automatically computed size is used.
- -shadow - Specifies the shadow color of the graph title
- -title - Sets the title. If "", no title will be displayed.
- -topmargin - If non-zero, overrides the computed size of the margin between the graph and the title. If 0, the automatically computed size is used.
The following elements are present in the file but should not be modified and need not be present if these files are generated automatically:
The following elements are present in the file but should not be modified and need not be present if these files are generated automatically:
- -baseline - NOT USED for line graphs.
- -bottomvariable - Name of the variable containing the -bottommargin value.
- -bufferelements - Indicates whether an internal pixmap to buffer the display of data elements should be used. If boolean is true, data elements are drawn to an internal pixmap. This option is especially useful when the graph is redrawn frequently while the data remains unchanged (for example, moving a marker across the plot).
- -buffergraph - Indicates whether an internal pixmap to buffer the display of the entire graph should be used.
- -cursor - Specifies the widget's cursor (for instance "crosshair").
- -data - NOT USED for line graphs.
- -datacommand - NOT USED for line graphs.
- -halo - Specifies a maximum distance to consider when searching for the closest data point. Data points further than pixels away are ignored.
- -invertxy - Indicates whether the placement X-axis and Y-axis should be inverted. If boolean is true, the X and Y axes are swapped.
- -leftvariable - Name of the variable containing the -leftmargin value.
- -rightvariable - Name of the variable containing the -rightmargin value.
- -takefocus - Provides information used when moving the focus from window to window via keyboard traversal (e.g., Tab and Shift-Tab). If 0, this means that this window should be skipped entirely during keyboard traversal. 1 means that this window should always receive the input focus. An empty value means that the traversal scripts make the decision whether to focus on the window.
- -tile - Specifies a tiled background for the widget. If image isn't "", the background is tiled using image. Otherwise, the normal background color is drawn (see the -background option). Image must be an image created using the Tk image command.
- -topvariable - Name of the variable containing the -topmargin value.
Grid attributes
- -color - Sets the color of the grid lines.
- -dashes - Sets the dash style of the grid lines. DashList is a list of up to 11 numbers that alternately represent the lengths of the dashes and gaps on the grid lines. Each number must be between 1 and 255. If dashList is "", the grid will be solid lines.
- -hide - Indicates whether the grid should be drawn. If true, grid lines are not shown.
- -linewidth - Sets the width of solid grid lines.
- -mapx - Specifies the X-axis to display grid lines. X Axis must be the name of an axis or "" for no grid lines.
- -mapy - Specifies the Y-axis to display grid lines. Y Axis must be the name of an axis or "" for no grid lines.
- -minor - Indicates whether the grid lines should be drawn for minor ticks. If boolean is true, the lines will appear at minor tick intervals.
Legend attributes
- -activebackground - Sets the background color for active legend entries. All legend entries marked active are drawn using this background color.
- -activeborderwidth - Sets the width of the 3-D border around the outside edge of the active legend entries.
- -activeforeground - Sets the foreground color for active legend entries. All legend entries marked as active are drawn using this foreground color.
- -activerelief - Specifies the 3-D effect desired for active legend entries. Relief denotes how the interior of the entry should appear relative to the legend; for example, raised means the entry should appear to protrude from the legend, relative to the surface of the legend.
- -anchor - Tells how to position the legend relative to the positioning point for the legend. This is dependent on the value of the -position option. (n, s, e, w, ne, nw, se, sw or c)
- -background - Sets the background color of the legend. If color is "", the legend background with be transparent.
- -borderwidth - Sets the width of the 3-D border around the outside edge of the legend (if such border is being drawn; the -relief option determines this).
- -columns - Specifies how many columns will be used to display the legend items. Default is 0 and a single column is used.
- -font - Specifies a font to use when drawing the labels of each element into the legend.
- -foreground - Sets the foreground color of the text drawn for the element labels.
- -hide - Indicates whether the legend should be displayed. If boolean is true, the legend will not be draw.
- -ipadx - Sets the amount of internal padding to be added to the width of each legend entry. Pad can be a list of one or two screen distances. If pad has two elements, the left side of the legend entry is padded by the first distance and the right side by the second. If pad is just one distance, both the left and right sides are padded evenly.
- -ipady - Sets an amount of internal padding to be added to the height of each legend entry. Pad can be a list of one or two screen distances. If pad has two elements, the top of the entry is padded by the first distance and the bottom by the second. If pad is just one distance, both the top and bottom of the entry are padded evenly.
- -padx - Sets the padding to the left and right exteriors of the legend. Pad can be a list of one or two screen distances. If pad has two elements, the left side of the legend is padded by the first distance and the right side by the second. If pad has just one distance, both the left and right sides are padded evenly.
- -pady - Sets the padding above and below the legend. Pad can be a list of one or two screen distances. If pad has two elements, the area above the legend is padded by the first distance and the area below by the second. If pad is just one distance, both the top and bottom areas are padded evenly.
- -position - Specifies where the legend is drawn. The -anchor option also affects where the legend is positioned. If pos is left, right, top, or bottom, the legend is drawn in the specified margin. If pos is plotarea, then the legend is drawn inside the plotting area at a particular anchor. If pos is in the form "@x,y", where x and y are the window coordinates, the legend is drawn in the plotting area at the specified coordinates.
- -raised - Indicates whether the legend is above or below the data elements. This matters only if the legend is in the plotting area. If boolean is true, the legend will be drawn on top of any elements that may overlap it.
- -relief - Specifies the 3-D effect for the border around the legend. Relief specifies how the interior of the legend should appear relative to the graph; for example, raised means the legend should appear to protrude from the graph, relative to the surface of the graph.
- -rows - Specifies how many rows will be used to display the legend items. Default is 0 and a single column is used.
- -shadow - Specifies the shadow color of the text drawn for the element labels.
Graph elements
Data
- -areapattern - Bitmap to use for filling the area under the data element. solid fills a solid -areaforeground color.
- -areaforeground - Color to use for the area underneath the graph or bitmap foreground.
- -areabackground - Color to use for bitmap background for the area under the graph.
- -areatile - Image to use for filling the area under the data element.
- -color - Color of the traces connecting the data points.
- -dashes - Sets the dash style of the element line.
DashListis a list of up to 11 numbers that alternately represent the lengths of the dashes and gaps on the element line. Each number must be between 1 and 255. IfDashListis "", the lines will be solid. - -fill - Sets the interior color of symbols. If color is "", the interior of the symbol is transparent. If color is
defcolor, then the color will be the same as the -color option. - -hide - Indicates whether the element is hidden.
1is hidden,0is visible. - -label - Sets the element's label in the legend. If text is "", the element will have no entry in the legend. The default label is the element's name.
- -linewidth - Sets the width of the connecting lines between data points. If
0, no connecting lines will be drawn between symbols. - -maxsymbols - Sets the maximum number of symbols to display on this element.
- -offdash - Sets the color of the stripes when traces are dashed (see the -dashes option). If color is "", then the "off" pixels will represent gaps instead of stripes. If color is
defcolor, then the color will be the same as the -color option. - -outline - Sets the color of the outline around each symbol. If color is "", then no outline is drawn. If color is
defcolor, then the color will be the same as the -color option. - -outlinewidth - Sets the width of the outline bordering each symbol. If pixels is
0, no outline will be drawn. - -pixels - Sets the size of symbols. If pixels is
0, no symbols will be drawn. - -reduce - Apply Douglas-Peucker line simplification algorithm to the displayed data points using the given value.
- -scalesymbols - If boolean is true, the size of the symbols drawn will change with the scale of the X-axis and Y-axis. At the time this option is set, the current ranges of the axes are saved as the normalized scales (i.e., scale factor is 1.0) and the element is drawn at its designated size (see the -pixels option). As the scale of the axes change, the symbol will be scaled according to the smaller of the X-axis and Y-axis scales. If boolean is false, the element's symbols are drawn at the designated size, regardless of axis scales.
- -showvalues - Display data values next to the symbols. One of
none,x,y, orbothspecifies which values to show. See the -valueXX options below. - -smooth - Specifies how connecting line segments are drawn between data points.
Smoothcan be eitherlinear,step,natural, orquadratic. Iflinear, a single line segment is drawn, connecting both data points. Whenstep, two line segments are drawn: the first is a horizontal line segment that steps to the next X-coordinate, the second is a vertical line, moving to the next Y-coordinate. Bothnaturalandquadraticgenerate multiple segments between data points. Ifnatural, the segments are generated using a cubic spline. Ifquadratic, a quadratic spline is used. - -symbol - Specifies the symbol for data points. Symbol can be either
square,circle,diamond,plus,cross,splus,scross,triangle, "" (where no symbol is drawn), or an image. Bitmaps are specified as"source ?mask?", wheresourceis the name of the bitmap, andmaskis the bitmap's optional mask. - -trace - Indicates whether connecting lines between data points (whose X-coordinate values are either increasing or decreasing) are drawn.
Directionmust beincreasing,decreasing, orboth. For example, if direction isincreasing, connecting lines will be drawn only between those data points where X-coordinate values are monotonically increasing. If direction isboth, connecting lines will be drawn between all data points. - -valueanchor - Position of the data point with respect to the text. (
n,s,e,w,ne,nw,se,sworc) - -valuecolor - Color of the text for the values.
- -valuefont - Font to use for the value labels.
- -valueformat - Format to use for the value labels.
- -valuerotate - Rotation angle in degrees for the values.
- -valueshadow - Shadow color for the value labels.
The following elements are present in the file but should not be modified and need not be present if these files are generated automatically:
- -activepen - Specifies the pen to use to draw the active element. If
penNameis "", no active elements will be drawn. - -bindtags - Handled internally by PrestoPlot.
- -errorbarcolor - NOT USED by PrestoPlot.
- -errorbarwidth - NOT USED by PrestoPlot.
- -errorbarcap - NOT USED by PrestoPlot.
- -folded - Gives the name of the axis onto which the elements are mapped. See the Folding option.
- -labelrelief - Specifies the 3-D effect for the border around the legend label. Reset by PrestoPlot.
- -pen - Handled internally by PrestoPlot.
- -showerrorbars - NOT USED by PrestoPlot.
- -state - Defines the state of the element, one of
normal,active, ordisabled. - -styles - Specifies which pen to use based on the range of weights given.
StyleListis a list of style specifications. Each style specification is a list consisting of a pen name, and optionally a minimum and maximum range. Data points whose weight (see the -weight option) falls in this range are drawn with this pen. If no range is specified, it defaults to the index of the pen in the list. Note: this affects only symbol attributes; line attributes (such as line width, dashes, etc.) are ignored. Handled internally by PrestoPlot. - -weights - Specifies the weights of the individual data points. This, together with the list of pen styles (see the -styles option), controls how data points are drawn. The argument is the name of a BLT vector or a list of numeric expressions representing the weights for each data point. Handled internally by PrestoPlot.
Markers
The markers used by PrestoPlot are composed of multiple different marker elements, each element has a set of options depending on its type, many of these options are updated dynamically by PrestoPlot when the markers are modified:
- -anchor - Position of the text with respect to the -coords option (n, s, e, w, ne, nw, se, sw or c)
- -background - Background text color.
- -cap - End of line style. one of butt, projecting or round.
- -dashes - Sets the dash style of marker line.
DashListis a list of up to 11 numbers that alternately represent the lengths of the dashes and gaps on the element line. Each number must be between 1 and 255. IfDashListis "", the lines will be solid. - -dashoffset - Offset to start using the -dashes.
- -font - Font to use for the text.
- -foreground - Foreground text color.
- -join - Join style for marker line segments. one of bevel, miter or round.
- -justify - Specifies how the text should be justified. This matters only when the text contains more than one line of text. Justify must be left, right, or center.
- -hide - Indicates whether the marker element is hidden. 1 is hidden 0 is visible
- -linewidth - Sets the width of the line.
- -outline - Sets the foreground color of the line.
- -padx - Sets the padding to the left and right side of the text. Pad can be a list of one or two screen distances. If pad has two elements, the left side of the text is padded by the first distance and the right side by the second. If pad has just one distance, both the left and right sides are padded evenly.
- -pady - Sets the padding above and below the text. Pad can be a list of one or two screen distances. If pad has two elements, the top side of the text is padded by the first distance and the bottom side by the second. If pad has just one distance, both the top and bottom sides are padded evenly.
- -rotate - Rotation angle in degrees for the text.
- -shadow - Shadow color for the text.
- -state - State for the marker, one of normal, active or disabled.
- -text - Text to display in the marker.
- -under - Boolean to place the marker behind all graph elements.
- -xoffset - Offset in x for the marker from the -coords position.
- -yoffset - Offset in y for the marker from the -coords position.
The following elements are present in the file but should not be modified:
- -bindtags - Handled internally by PrestoPlot.
- -coords - Handled internally by PrestoPlot.
- -xor - Boolean drawing method.
Tip
As a special case, Markers can be placed on the side of the graph by using 'Inf' or '-Inf' for the x coordinate and 'e' or 'w' respectively for the -anchor option.
Graph axes
- -background - Background color for the axis. If color is "", the axis background with be transparent.
- -borderwidth - Width of the ends of the axis.
- -color - Color for the axis. if color is "", the axis background with be transparent.
- -descending - Indicates whether the values along the axis are monotonically increasing or decreasing. If boolean is true, the axis values will be decreasing.
- -hide - Indicates whether the axis is hidden.
1is hidden,0is visible. - -justify - Specifies how the axis title should be justified. This matters only when the axis title contains more than one line of text. Justify must be
left,right, orcenter. - -labeloffset - Boolean to offset the axis label values.
- -limitscolor - Color for the axis limits text.
-
-limitsfont - Font to use for the axis limits text.
-
-limitsformat - Specifies a printf-like description to format the minimum and maximum limits of the axis. The limits are displayed at the top/bottom or left/right sides of the plotting area.
FormatStris a list of one or two format descriptions. If one description is supplied, both the minimum and maximum limits are formatted in the same way. If two, the first designates the format for the minimum limit, the second for the maximum. If""is given as either description, then that limit will not be displayed. (To use""this needs to be set using double quotes, e.g.{%g }to only display the minimum limit.) -
-limitsshadow - Shadow color for the axis limits text.
- -linewidth - Sets the width of the axis and tick lines.
- -logscale - Indicates whether the scale of the axis is logarithmic or linear. If boolean is true, the axis is logarithmic.
- -loose - Indicates whether the limits of the axis should fit the data points tightly, at the outermost data points, or loosely, at the outer tick intervals. If the axis limit is set with the -min or -max option, the axes are displayed tightly. If boolean is true, the axis range is "loose".
- -minorticks - Specifies where to display minor axis ticks. You can use this option to display minor ticks at non-uniform intervals.
MinorListis a list of real values, ranging from 0.0 to 1.0, designating the placement of a minor tick. - -relief - Specifies the 3-D effect for the border around the axis using the -background color.
- -rotate - Specifies how many degrees to rotate the axis tick labels.
- -showticks - Indicates whether axis ticks should be drawn. If boolean is true, ticks are drawn. If false, only the axis line is drawn.
- -stepsize - Specifies the interval between major axis ticks. If value isn't a valid interval (must be less than the axis range), the request is ignored and the step size is automatically calculated.
- -subdivisions - Indicates how many minor axis ticks are to be drawn. For example, if number is two, only one minor tick is drawn. If number is one, no minor ticks are displayed.
- -tickfont - Specifies the font for axis tick labels.
- -ticklength - Sets the length of major and minor ticks (minor ticks are half the length of major ticks). If pixels is less than zero, the axis will be inverted with ticks drawn pointing towards the plot.
- -tickshadow - Shadow color for axis tick labels.
- -title - Sets the title of the axis. If text is
"", no axis title will be displayed. - -titlealternate - Boolean to use the alternate axis title position. If true, the title will be placed above or to the right of the axis.
- -titlecolor - Sets the color of the axis title.
- -titlefont - Sets the font of the axis title.
-
-titleshadow - Sets the shadow color of the axis title.
-
Events - Information used to display a set of event markers on the graph for this axis, for a PGR file the markers are saved as is, for a PMD the attributes and the name of the original event dataset are saved so that they can be reproduced from the current datasets.
The following elements are present in the file but should not be modified and need not be present if these files are generated automatically:
- -autorange - Handled internally by PrestoPlot.
- -bindtags - Handled internally by PrestoPlot.
- -command - Handled internally by PrestoPlot.
- -max - Handled internally by PrestoPlot.
- -min - Handled internally by PrestoPlot.
- -scrollincrement - Handled internally by PrestoPlot.
- -scrollmax - Handled internally by PrestoPlot.
- -scrollmin - Handled internally by PrestoPlot.
- -shiftby - Handled internally by PrestoPlot.
- -tickdivider - NOT USED by PrestoPlot
Extra Information
- EventData - Information used to add event markers.
- SynchroData - Information used to synchronise the Date axes.