Plot Control Commands¶
These functions control the plotting characteristics of PyDV which affect all displayed curves.
Note
< > = Required user input.
[ ] = Optional user input.
[PyDV]: = Python Data Visualizer command-line prompt.
annot¶
- pydv.pdv.Command.do_annot(self, line)
Display text on the plot at point (x, y). List of annotations can be seen with listannot.
[PyDV]: annot <text> <x> <y> Ex: [PyDV]: annot mytext 1 2
axis¶
- pydv.pdv.Command.do_axis(self, line)
Show or hide the axis.
[PyDV]: axis <on | off> Ex: [PyDV]: axis on [PyDV]: axis off
border¶
- pydv.pdv.Command.do_border(self, line)
Show or hide the plot border. By default, the border color is black.
[PyDV]: border <on | 1 | off | 0> [color] Ex: [PyDV]: border on [PyDV]: border on blue [PyDV]: border off
bkgcolor¶
- pydv.pdv.Command.do_bkgcolor(self, line)
Change the background color of the plot, window, or both.
[PyDV]: bkgcolor <[plot | window] color | reset> Ex: [PyDV]: bkgcolor plot blue [PyDV]: bkgcolor window blue [PyDV]: bkgcolor reset
dashstyle¶
- pydv.pdv.Command.do_dashstyle(self, line)
Set the style of dash or dot dash lines. The python list is a list of integers, alternating how many pixels to turn on and off, for example:
[2, 2] : Two pixels on, two off (will result in a dot pattern).
[4, 2, 2, 2] : 4 on, 2 off, 2 on, 2 off (results in a dash-dot pattern).
[4, 2, 2, 2, 4, 2] : Gives a dash-dot-dash pattern.
[4, 2, 2, 2, 2, 2] : Gives a dash-dot-dot pattern.
See matplotlib ‘set_dashes’ command for more information.
[PyDV]: dashstyle <curve-list> <[...]> Ex: [PyDV]: dashstyle a [2, 2] [PyDV]: dashstyle a:b [2, 2] [PyDV]: dashstyle c d [2, 2]
dataid¶
- pydv.pdv.Command.do_dataid(self, line)
Show or hide curve identifiers on plot.
[PyDV]: dataid <on | off> Ex: [PyDV]: dataid on [PyDV]: dataid off
delannot¶
- pydv.pdv.Command.do_delannot(self, line)
Delete annotations from list. List of annotations can be seen with listannot.
[PyDV]: delannot <number-list-of-annotations> Ex: [PyDV]: listannot [PyDV]: delannot 1 [PyDV]: delannot 1:2 [PyDV]: delannot 3 4
domain¶
- pydv.pdv.Command.do_domain(self, line)
Set the domain for plotting. Using de (for default) will let the curves determine the domain.
[PyDV]: <domain | dom> <x-min> <x-max> Ex: [PyDV]: domain 3 7 [PyDV]: domain de
fontcolor¶
- pydv.pdv.Command.do_fontcolor(self, line)
Change the font color of given plot component.
[PyDV]: fontcolor [<component: xlabel | ylabel | title | xaxis | yaxis>] <color> Ex: [PyDV]: fontcolor xlabel blue [PyDV]: fontcolor ylabel blue [PyDV]: fontcolor title blue [PyDV]: fontcolor xaxis blue [PyDV]: fontcolor yaxis blue
fontsize¶
- pydv.pdv.Command.do_fontsize(self, line)
Change the font size of given component, or overall scaling factor.
[PyDV]: fontsize [<component: title | xlabel | ylabel | key | tick | curve | annotation>] <numerical-size | small | medium | large | default> Ex: [PyDV]: fontsize title 12 [PyDV]: fontsize xlabel small [PyDV]: fontsize ylabel medium [PyDV]: fontsize key large [PyDV]: fontsize tick default [PyDV]: fontsize curve 12 [PyDV]: fontsize annotation small
fontstyle¶
- pydv.pdv.Command.do_fontstyle(self, line)
Set the fontstyle family.
[PyDV]: fontstyle <serif | sans-serif | monospace> Ex: [PyDV]: fontstyle serif [PyDV]: fontstyle sans-serif [PyDV]: fontstyle monospace
geometry¶
- pydv.pdv.Command.do_geometry(self, line)
Change the PyDV window size and location in pixels.
[PyDV]: geometry <xsize> <ysize> <xlocation> <ylocation> Ex: [PyDV]: geometry 500 500 250 250
grid¶
- pydv.pdv.Command.do_grid(self, line)
Show or hide the grid on the graph.
[PyDV]: grid <on | off> Ex: [PyDV]: grid on [PyDV]: grid off
gridcolor¶
- pydv.pdv.Command.do_gridcolor(self, line)
Set the color of the grid. White is default.
[PyDV]: gridcolor <color> Ex: [PyDV]: gridcolor blue
gridstyle¶
- pydv.pdv.Command.do_gridstyle(self, line)
Set the line style for the grid.
[PyDV]: gridstyle <style: solid | dash | dot | dashdot> Ex: [PyDV]: gridstyle solid [PyDV]: gridstyle dash [PyDV]: gridstyle dot [PyDV]: gridstyle dashdot
gridwidth¶
- pydv.pdv.Command.do_gridwidth(self, line)
Set the grid line width in points.
[PyDV]: gridwidth <width> Ex: [PyDV]: gridwidth 5
group¶
- pydv.pdv.Command.do_group(self, line)
Group curves based on name and file if curve names are the same. Max number of same name curves is 14. Can also update title to curve name and change labels to filenames if all curves share the same name. If title is passed, one can adjust the filename label with number of slashes as well. If off is passed, will reset curves back to normal and stop automatic grouping. Note: title also looks at hidden curves thus need to delete curves (e.g. del a).
[PyDV]: group <title <slashes #> > <off> Ex: [PyDV]: group [PyDV]: group title [PyDV]: group title slashes 2 [PyDV]: group off
guilims¶
- pydv.pdv.Command.do_guilims(self, line)
Set whether or not to use the GUI min/max values for the X and Y limits. Default is off.
[PyDV]: guilims <on | off> Ex: [PyDV]: guilims on [PyDV]: guilims off
handlelength¶
- pydv.pdv.Command.do_handlelength(self, line)
Adjust the length of the line(s) in the legend.
[PyDV]: handlelength <length> Ex: [PyDV]: handlelength 10
image¶
- pydv.pdv.Command.do_image(self, line)
Save the current figure to an image file. All parameters are optional. The default value for filename=plot, the default value for filetype=pdf and the default value for transparent=False. dpi is the resolution in dots per inch and the default value is the figure’s dpi value. Width and height are in pixels.
[PyDV]: image [filename=plot] [filetype=pdf: png | ps | pdf | svg] [transparent=False: True | False] [dpi] [width] [height] Ex: [PyDV]: image my_plot png [PyDV]: image my_plot png True [PyDV]: image my_plot png True 100 [PyDV]: image my_plot png True 100 1920 1080
label¶
- pydv.pdv.Command.do_label(self, line)
Change the key and list label for a curve. For multiple curves, each label must start with ` (this is the backtick character ` , not the single quote character ‘).
[PyDV]: label <curve> <new-label> Ex: [PyDV]: label a my_new_label [PyDV]: label a:b `my_new_label `my other label [PyDV]: label a:c `mynewlabel `my other label `my thirdlabel
labelcurve¶
- pydv.pdv.Command.do_labelcurve(self, line)
Add curve letter to the legend label.
[PyDV]: labelcurve <on | off> Ex: [PyDV]: labelcurve on [PyDV]: labelcurve off
labelfilenames¶
- pydv.pdv.Command.do_labelfilenames(self, line)
Add curve filename to the legend label.
[PyDV]: labelfilenames <on | off> Ex: [PyDV]: labelfilenames on [PyDV]: labelfilenames off
labelrecordids¶
- pydv.pdv.Command.do_labelrecordids(self, line)
Add curve recordid to the legend label. Command will only work with curves from Sina files with valid record ids.
[PyDV]: labelrecordids <on | off> Ex: [PyDV]: labelrecordids on [PyDV]: labelrecordids off
latex¶
- pydv.pdv.Command.do_latex(self, line)
Use LaTeX font rendering.
[PyDV]: latex <on | off> Ex: [PyDV]: latex on [PyDV]: latex off
legend¶
- pydv.pdv.Command.do_legend(self, line)
Show/Hide the legend with on | off or set legend position with ur, ul, ll, lr, cl, cr, uc, lc. Specify the number of columns to use in the legend. Specify curves to add to or remove from the legend using the hide or show keywords followed by the ids of the curves. Commands after hide/show will not be processed, so make sure these are the last in the command list.
[PyDV]: <legend | leg | key> <on | off> [position] [<number of columns>] [<show/hide curve ids>] Ex: [PyDV]: legend on [PyDV]: legend on ul [PyDV]: legend on ul 2 [PyDV]: legend on ul 2 [PyDV]: legend on ul 2 showid a [PyDV]: legend on ul 2 showid a:b [PyDV]: legend on ul 2 showid c d [PyDV]: legend on ul 2 showid all [PyDV]: legend on ul 2 hideid a [PyDV]: legend on ul 2 hideid a:b [PyDV]: legend on ul 2 hideid c d [PyDV]: legend on ul 2 hideid all
lnstyle¶
- pydv.pdv.Command.do_lnstyle(self, line)
Set the line style of the specified curves.
[PyDV]: lnstyle <curve-list> <style: solid | dash | dot | dotdash> Ex: [PyDV]: lnstyle a solid [PyDV]: lnstyle a:b dash [PyDV]: lnstyle c d dot
lnwidth¶
- pydv.pdv.Command.do_lnwidth(self, line)
Set the line widths of the specified curves. A line width of 0 will give the thinnest line which the host graphics system supports.
[PyDV]: lnwidth <curve-list> <width> Ex: [PyDV]: lnwidth a 2 [PyDV]: lnwidth a:b 2 [PyDV]: lnwidth c d 2
marker¶
- pydv.pdv.Command.do_marker(self, line)
Set the marker symbol and marker size (optionally) for scatter plots. You can also use any of the matplotlib supported marker types as well. See the matplotlib documentation on markers for further information.
[PyDV]: marker <curve-list> <marker-style: + | . | circle | square | diamond> [marker-size] Ex: [PyDV]: marker a + [PyDV]: marker a:b . [PyDV]: marker c d circle [PyDV]: marker c d 10
minorticks¶
- pydv.pdv.Command.do_minorticks(self, line)
Minor ticks are not visible by default. On will make the minor ticks visible and off will hide the minor ticks.
[PyDV]: minorticks <on | off> Ex: [PyDV]: minorticks on [PyDV]: minorticks off
movefront¶
- pydv.pdv.Command.do_movefront(self, line)
Move given curves to the front of the plot
[PyDV]: movefront <curve-list> Ex: [PyDV]: movefront a [PyDV]: movefront a:b [PyDV]: movefront c d
plot¶
- pydv.pdv.Command.do_plot(self, line)
Show or hide the line plots.
[PyDV]: plot <on | off> Ex: [PyDV]: plot on [PyDV]: plot off
plotlayout¶
- pydv.pdv.Command.do_plotlayout(self, line)
Adjust the plot layout parameters. Where left is the position of the left edge of the plot as a fraction of the figure width, right is the position of the right edge of the plot, as a fraction of the figure width, top is the position of the top edge of the plot, as a fraction of the figure height and bottom is the position of the bottom edge of the plot, as a fraction of the figure height. Alternatively, de will revert to the default plot layout values.
If no arguments are given, the plot’s current layout settings will be displayed.
[PyDV]: plotlayout [<left> <right> <top> <bottom> || de] Ex: [PyDV]: plotlayout left [PyDV]: plotlayout right [PyDV]: plotlayout top [PyDV]: plotlayout bottom [PyDV]: plotlayout de
range¶
- pydv.pdv.Command.do_range(self, line)
Set the range for plotting. Using de (for default) will let the curves determine the range.
[PyDV]: <range | ran> <y-min> <y-max> | de Ex: [PyDV]: range 3 7 [PyDV]: range de
style¶
- pydv.pdv.Command.do_style(self, line)
Use matplotlib style settings from a style specification. The style name of default (if available) is reserved for reverting back to the default style settings. You can type the command showstyles and see Matplotlib’s Style sheets reference.
[PyDV]: style <style-name> Ex: [PyDV]: style classic
ticks¶
- pydv.pdv.Command.do_ticks(self, line)
Set the maximum number of major ticks on the axes.
[PyDV]: ticks <quantity> | de Ex: [PyDV]: ticks 3 [PyDV]: ticks de
title¶
- pydv.pdv.Command.do_title(self, line)
Set a title for the plot
[PyDV]: title <title-name> Ex: [PyDV]: title my_title
update¶
- pydv.pdv.Command.do_update(self, line)
Update the plot after each command if True. Update the plot is ON by default.
[PyDV]: update on | off Ex: [PyDV]: update on [PyDV]: update off
xlabel¶
- pydv.pdv.Command.do_xlabel(self, line)
Set a label for the x axis
[PyDV]: xlabel <label-name> Ex: [PyDV]: xlabel my_x_label
xlogscale¶
- pydv.pdv.Command.do_xlogscale(self, line)
Show the x axis on a log scale.
[PyDV]: <xlogscale | xls> <on | off> Ex: [PyDV]: xlogscale on [PyDV]: xlogscale off
xtickcolor¶
- pydv.pdv.Command.do_xtickcolor(self, line)
Set the color of the ticks on the x-axis. Default is to apply to major ticks only.
[PyDV]: xtickcolor <de | color> [which: major | minor | both] Ex: [PyDV]: xtickcolor blue major [PyDV]: xtickcolor blue minor [PyDV]: xtickcolor blue both [PyDV]: xtickcolor de both
xticks¶
- pydv.pdv.Command.do_xticks(self, line)
Set the locations of major ticks on the x-axis
[PyDV]: xticks de | <number> | <list of locations> | <list of locations, list of labels> Ex: [PyDV]: xticks 3 [PyDV]: xticks (1, 2, 3) [PyDV]: xticks (1, 2, 3), ('first label', 'second label', 'third label') [PyDV]: xticks de
xtickformat¶
- pydv.pdv.Command.do_xtickformat(self, line)
Set the format of major ticks on the x axis. Default is plain.
[PyDV]: xtickformat <plain | sci | exp | 10**> Ex: [PyDV]: xtickformat plain [PyDV]: xtickformat sci [PyDV]: xtickformat exp [PyDV]: xtickformat 10**
xticklength¶
- pydv.pdv.Command.do_xticklength(self, line)
Set the length (in points) of x ticks on the axis. Default is apply to major ticks only.
[PyDV]: xticklength <number> [which: major | minor | both] Ex: [PyDV]: xticklength 2 major [PyDV]: xticklength 2 minor [PyDV]: xticklength 2 both
xtickwidth¶
- pydv.pdv.Command.do_xtickwidth(self, line)
Set the width (in points) of x ticks on the x axis. Default is to apply to major ticks only.
[PyDV]: xtickwidth <number> [which: major | minor | both] Ex: [PyDV]: xtickwidth 2 major [PyDV]: xtickwidth 2 minor [PyDV]: xtickwidth 2 both
xtickrotation¶
- pydv.pdv.Command.do_xtickrotation(self, line)
Set the rotation (in degrees) of the tick labels on the x axis.
[PyDV]: xtickrotation <degree> Ex: [PyDV]: xtickrotation 45
xtickha¶
- pydv.pdv.Command.do_xtickha(self, line)
Set the horizontal alignment of tick labels on the x axis. Default is center.
[PyDV]: xtickha <center | right | left> Ex: [PyDV]: xtickha right
xtickva¶
- pydv.pdv.Command.do_xtickva(self, line)
Set the vertical alignment of tick labels on the x axis. Default is top.
[PyDV]: xtickva <center | top | bottom> Ex: [PyDV]: xtickva center
ylabel¶
- pydv.pdv.Command.do_ylabel(self, line)
Set a label for the y axis.
[PyDV]: ylabel <label-name> Ex: [PyDV]: ylabel my_y_label
ylogscale¶
- pydv.pdv.Command.do_ylogscale(self, line)
Set log scale on or off for the y-axis.
[PyDV]: <ylogscale | yls> <on | off> Ex: [PyDV]: ylogscale on [PyDV]: ylogscale off
ytickcolor¶
- pydv.pdv.Command.do_ytickcolor(self, line)
Set the color of the ticks on the y-axis. Default is to apply to major ticks only.
[PyDV]: ytickcolor <de | color> [which: major | minor | both] Ex: [PyDV]: ytickcolor blue major [PyDV]: ytickcolor blue minor [PyDV]: ytickcolor blue both [PyDV]: ytickcolor de both
ytickformat¶
- pydv.pdv.Command.do_ytickformat(self, line)
Set the format of major ticks on the y axis. Default is plain.
[PyDV]: ytickformat <plain | sci | exp | 10**> Ex: [PyDV]: ytickformat plain [PyDV]: ytickformat sci [PyDV]: ytickformat exp [PyDV]: ytickformat 10**
yticklength¶
- pydv.pdv.Command.do_yticklength(self, line)
Set the length (in points) of y ticks on the y axis. Default is to apply to major ticks only.
[PyDV]: yticklength <number> [which: major | minor | both] Ex: [PyDV]: yticklength 2 major [PyDV]: yticklength 2 minor [PyDV]: yticklength 2 both
ytickwidth¶
- pydv.pdv.Command.do_ytickwidth(self, line)
Set the width (in points) of y ticks on the y axis. Default is to apply to major ticks only.
[PyDV]: ytickwidth <number> [which: major | minor | both] Ex: [PyDV]: ytickwidth 2 major [PyDV]: ytickwidth 2 minor [PyDV]: ytickwidth 2 both
yticks¶
- pydv.pdv.Command.do_yticks(self, line)
Set the locations of major ticks on the y axis.
[PyDV]: yticks de | <number> | <list of locations> | <list of locations, list of labels> Ex: [PyDV]: yticks 3 [PyDV]: yticks (1, 2, 3) [PyDV]: yticks (1, 2, 3), ('first label', 'second label', 'third label') [PyDV]: yticks de
ytickrotation¶
- pydv.pdv.Command.do_ytickrotation(self, line)
Set the rotation (in degrees) of the tick labels on the y axis.
[PyDV]: ytickrotation <degree> Ex: [PyDV]: ytickrotation 45
ytickha¶
- pydv.pdv.Command.do_ytickha(self, line)
Set the horizontal alignment of tick labels on the y axis. Default is right.
[PyDV]: ytickha <center | right | left> Ex: [PyDV]: ytickha center
ytickva¶
- pydv.pdv.Command.do_ytickva(self, line)
Set the vertical alignment of tick labels on the y axis. Default is center.
[PyDV]: ytickva <center | top | bottom> Ex: [PyDV]: ytickva top
tightlayout¶
- pydv.pdv.Command.do_tightlayout(self, line)
Turn on plot tight layout. Useful if tick labels are long.
[PyDV]: tightlayout <on | off> Ex: [PyDV]: tightlayout on