Curve Control Commands

These functions control the individual curves that are currently being displayed. They range in type from controlling the appearance of the curve to deleting it. They also include the “non-mathematical” mechanisms which may generate curves.

Note

< > = Required user input.

[ ] = Optional user input.

[PyDV]: = Python Data Visualizer command-line prompt.

appendcurves

pydv.pdv.Command.do_appendcurves(self, line)

Merge a list of curves over the union of their domains. Where the domains overlap, take the average of the curves’ y-values.

[PyDV]: appendcurves <curve-list>

Ex:
    [PyDV]: appendcurves a:b
    [PyDV]: appendcurves c d

color

pydv.pdv.Command.do_color(self, line)

Set the color of curves. Color names can be “blue”, “red”, etc., or “#eb70aa”, a 6 digit set of hexadecimal red-green-blue values #RRGGBB. The entire set of HTML-standard color names is available. Type showcolormap to see the available named colors which will show up in the PyDV plotting area (hit return to go back to your plots).

[PyDV]: color <curve-list> <color>

Ex:
    [PyDV]: color a blue
    [PyDV]: color a:b blue
    [PyDV]: color c d blue
    [PyDV]: color a #aabb33
    [PyDV]: showcolormap
    hit return to go back to your plots
    [PyDV]: color a lime

curve

pydv.pdv.Command.do_curve(self, line)

Select curves from the menu for plotting. A regular expression may be supplied in paranthesis for matching against the curve label to plot.

Regular expressions are based on the Python regex syntax, not the UNIX syntax. In particular, ‘*’ is not the wildcard you might be expecting.

For an explanation of the regex syntax, type ‘help regex’.

[PyDV]: <curve | cur> [menu (<regex>)] <list-of-menu-numbers>

Ex:
    [PyDV]: cur 1
    [PyDV]: cur 2:3
    [PyDV]: cur 4 5
    [PyDV]: cur (.*my_curves.*)

dupx

pydv.pdv.Command.do_dupx(self, line)

Duplicate x-values so that y=x for each of the specified curves.

[PyDV]: dupx <curve-list>

Ex:
    [PyDV]: dupx a
    [PyDV]: dupx a:b
    [PyDV]: dupx c d

drawstyle

pydv.pdv.Command.do_drawstyle(self, line)

Set draw style of given curves.

[PyDV]: drawstyle <curve-list> <style: default | steps | steps-pre | steps-post | steps-mid>

Ex:
    [PyDV]: drawstyle a steps
    [PyDV]: drawstyle a:b steps-pre
    [PyDV]: drawstyle c d steps-post

mathinterpparams

pydv.pdv.Command.do_mathinterpparams(self, line)

Set numpy.interp() left, right, and period parameters for internal curve math methods for Curve such as + a b c, - a b c, etc…. Defaults are None which align with numpy.interp() defaults. To reset pass in none to <left> <right> <period>.

[PyDV]: mathinterpparams <curve-list> <left> <right> <period>

Ex:
    [PyDV]: mathinterpparams a 0 0 none
    [PyDV]: mathinterpparams a:b 0 0 none
    [PyDV]: mathinterpparams c d none none none

linemarker

pydv.pdv.Command.do_linemarker(self, line)

Set the marker symbol and marker size for the curves

Note

When setting this value through the interface or the curve object directly, use ONLY matplotlib supported marker types. Matplotlib marker types are also supported here as well. See matplotlib documentation on markers for further information.

[PyDV]: linemarker <curve-list> <marker-style: + | . | circle | square | diamond> [<marker-size>]

Ex:
    [PyDV]: linemarker a +
    [PyDV]: linemarker a:b .
    [PyDV]: linemarker c d circle
    [PyDV]: linemarker c d square 5

markerfacecolor

pydv.pdv.Command.do_markerfacecolor(self, line)

Set the markerface color of curves. Color names can be “blue”, “red”, etc., or “#eb70aa”, a 6 digit set of hexadecimal red-green-blue values #RRGGBB. The entire set of HTML-standard color names is available. Type showcolormap to see the available named colors which will show up in the PyDV plotting area (hit return to go back to your plots).

[PyDV]: markerfacecolor <curve-list> <color-name>

Ex:
    [PyDV]: markerfacecolor a blue
    [PyDV]: markerfacecolor a:b blue
    [PyDV]: markerfacecolor c d blue
    [PyDV]: markerfacecolor a #aabb33
    [PyDV]: showcolormap
    hit return to go back to your plots
    [PyDV]: markerfacecolor a lime

markeredgecolor

pydv.pdv.Command.do_markeredgecolor(self, line)

Set the markeredge color of curves. Color names can be “blue”, “red”, etc., or “#eb70aa”, a 6 digit set of hexadecimal red-green-blue values #RRGGBB. The entire set of HTML-standard color names is available. Type showcolormap to see the available named colors which will show up in the PyDV plotting area (hit return to go back to your plots).

[PyDV]: markeredgecolor <curve-list> <color-name>

Ex:
    [PyDV]: markeredgecolor a blue
    [PyDV]: markeredgecolor a:b blue
    [PyDV]: markeredgecolor c d blue
    [PyDV]: markeredgecolor a #aabb33
    [PyDV]: showcolormap
    hit return to go back to your plots
    [PyDV]: markeredgecolor a lime

showcolormap

pydv.pdv.Command.do_showcolormap(self, line)

Show the available named colors. Hit return to go back to your plots.

[PyDV]: showcolormap

showstyles

pydv.pdv.Command.do_showstyles(self, line)

Show available matplotlib styles.

[PyDV]: showstyles

copy

pydv.pdv.Command.do_copy(self, line)

Copy and plot the given curves.

[PyDV]: copy <curve-list>

Ex:
    [PyDV]: copy a
    [PyDV]: copy a:b
    [PyDV]: copy c d

del

pydv.pdv.Command.do_delete(self, line)

Delete a curve from the graph.

[PyDV]: <delete | del> <curve-list>

Ex:
    [PyDV]: delete a
    [PyDV]: delete a:b
    [PyDV]: delete c d

hide

pydv.pdv.Command.do_hide(self, line)

Hide a curve from the graph.

[PyDV]: hide <curve-list>

Ex:
    [PyDV]: hide a
    [PyDV]: hide a:b
    [PyDV]: hide c d

line

pydv.pdv.Command.do_line(self, line)

Generate a line with y = mx + b and an optional number of points.

[PyDV]: line <m> <b> <xmin> <xmax> [# pts]

Ex:
    [PyDV]: line 3 7 -1 20
    [PyDV]: line 3 7 -1 20 200

linespoints

pydv.pdv.Command.do_linespoints(self, line)

Show given curves as points and a line rather than continuous line.

[PyDV]: linespoints <curve-list> on | off

Ex:
    [PyDV]: linespoints a on
    [PyDV]: linespoints a:b on
    [PyDV]: linespoints c d off

makecurve

pydv.pdv.Command.do_makecurve(self, line)

Generate a curve from two tuples of numbers.

[PyDV]: makecurve (<list of x-values>) (<list of y-values>)

Ex:
    [PyDV]: makecurve (1 2 3) (20 30 40)

newcurve

pydv.pdv.Command.do_newcurve(self, line)

Creates a new curve from an expression containing curves that have the same domain. For convenience, the numpy and scipy module have been imported into the namespace. Shortcut: nc

  • The x-values will be the x-values of the last curve used in the expression due to how PyDV finds curves in a loop.

  • The y-values will be the evaluated expression after newcurve.

Note

If you want a more advanced expression or more control over what happens, see the command custom.

Warning

  • Currently, newcurve is hard-wired to only handle single-letter labels. Curve names used in the expression cannot be the @N type we use after we run out of letters. Sorry (April 2015).

  • A common error is to forget the .x or .y on the curve label name.

  • All the arrays in your expression have to span the same domain! Currently (4/2015), newcurve will generate a curve from different domains (but with the same number of points) with no error message, and that curve will almost certainly not be what you intended.

[PyDV]: newcurve <numpy and/or scipy expression>

Ex:
    [PyDV]: newcurve scipy.ndimage.gaussian_filter(numpy.sin(a.x*2*numpy.pi)/(b.x**2), sigma=5)

random

pydv.pdv.Command.do_random(self, line)

Generate random y values between -1 and 1 for the specified curves.

[PyDV]: random <curve-list>

Ex:
    [PyDV]: random a
    [PyDV]: random a:b
    [PyDV]: random c d

recolor

pydv.pdv.Command.do_recolor(self, line)

Reset the color of the line plots.

[PyDV]: recolor

redo

pydv.pdv.Command.do_redo(self, line)

Redo the last undo curve operation.

[PyDV]: redo

reid

pydv.pdv.Command.do_reid(self, line)

Relabel all the curves into continuous alphabetical order.

[PyDV]: reid

rev

pydv.pdv.Command.do_rev(self, line)

Swap x and y values for the specified curves. You may want to sort after this one.

[PyDV]: rev <curve-list>

Ex:
    [PyDV]: rev a
    [PyDV]: rev a:b
    [PyDV]: rev c d

scatter

pydv.pdv.Command.do_scatter(self, line)

Show given curves as points rather than continuous line.

[PyDV]: scatter <curve-list> <on | off>

Ex:
    [PyDV]: scatter a on
    [PyDV]: scatter a:b on
    [PyDV]: scatter c d off

show

pydv.pdv.Command.do_show(self, line)

Show the specified curves hidden by the hide command

[PyDV]: show <curve-list>

Ex:
    [PyDV]: show a
    [PyDV]: show a:b
    [PyDV]: show c d

sort

pydv.pdv.Command.do_sort(self, line)

Sort the specified curves so that their points are plotted in order of ascending x values.

[PyDV]: sort <curve-list>

Ex:
    [PyDV]: sort a
    [PyDV]: sort a:b
    [PyDV]: sort c d

subsample

pydv.pdv.Command.do_subsample(self, line)

Subsample the curves by the optional stride. Default value for stride is 2.

[PyDV]: subsample <curve-list> [stride]

Ex:
    [PyDV]: subsample a 3
    [PyDV]: subsample a:b 3
    [PyDV]: subsample c d 3

undo

pydv.pdv.Command.do_undo(self, line)

Undo the last operation on plotted curves.

[PyDV]: undo

xindex

pydv.pdv.Command.do_xindex(self, line)

Create curves with y-values vs. integer index values.

[PyDV]: xindex <curve-list>

Ex:
    [PyDV]: xindex a
    [PyDV]: xindex a:b
    [PyDV]: xindex c d

xminmax

pydv.pdv.Command.do_xminmax(self, line)

Filter out points; this is the only filter points function that returns a new curve due to how ULTRA behaved.

[PyDV]: <xminmax | xmm> <curve-list> <low-lim> <high-lim>

Ex:
    [PyDV]: xminmax a 1 3
    [PyDV]: xminmax a:b 1 3
    [PyDV]: xminmax c d 1 3