Axes decorators#

Overview#

PyLabAxes()

Create an axes.

PyLabAxis()

axis tuning.

PyLabBox()

See pylab.box for details

PyLabClearFigure()

a simple code to clear a figure.

PyLabColorMap()

Plot all colormap

PyLabFigure()

see pylab.figure for details.

PyLabFontProperties()

A Font properties selector.

PyLabGrid()

Add a grid to an axes.

PyLabLegend()

Add a legend to the axe.

PyLabSaveFig()

Save the current figure in a file.

PyLabShow()

This node simply calls pylab.show(), which may be useful sometimes.

PyLabTitle()

Add a title to the current axe.

PyLabTickParams()

Tune the ticks on an axis.

PyLabXLabel()

Add a label on the x-axis.

PyLabXLim()

VisuAlea version of pylab.xlim

PyLabXTicks()

Set the tick locations and labels.

PyLabYLabel()

Add a label on the x-axis.

PyLabYLim()

VisuAlea version of pylab.ylim

PyLabYTicks()

Set the tick locations and labels.

Api#

axes decorators from pylab

class openalea.pylab_decorators_wralea.py_pylab.PyLabAxes[source]#

Create an axes. See pylab.axes for details.

This node is useful if you want to create a polar axes.

Parameters:
  • input – an optional input axes

  • clean (bool) – clear the axe if True (default is True)

  • left (float) – left boundary limit of the axes (default is 0.12)

  • bottom (float) – bottom boundary limit of the axes (default is 0.12)

  • width (float) – width of the axes (default is 0.78)

  • height (float) – height of the axes (default is 0.78)

  • axisbg (str) – color of the axes background

  • frameon (bool) – set the frame on (default is True)

  • polar (bool) – set the axes in polar mode (default is False)

  • xscale (str) – set the x axes scale (default is linear)

  • yscale (str) – set the y axes scale (default is linear)

  • xticks (str) – set the xticks (default is auto)

  • xticks – set the yticks (default is auto)

  • kwargs (dict) – more arguments may be provided as a dictionary

Returns:

the current axes

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabAxesDecorator[source]#

Node to connect patches or axes decorators to an axes

Parameters:
  • axes – the axe to complete

  • whatever – a connector to use for connecting other nodes that add patches or decorators such as title and labels.

Returns:

the current axes

class openalea.pylab_decorators_wralea.py_pylab.PyLabAxis[source]#

axis tuning. See pylab.axis for details

Warning

not for production

class openalea.pylab_decorators_wralea.py_pylab.PyLabBox[source]#

See pylab.box for details

Parameters:

axes – an input pylab.axes

:param on’ boolean to turn on or off the box of the current axe

Returns:

the current axes

class openalea.pylab_decorators_wralea.py_pylab.PyLabClearFigure[source]#

a simple code to clear a figure. See pylab.clf for details

Parameters:

axes – an axes to clear

Returns:

the current axes

class openalea.pylab_decorators_wralea.py_pylab.PyLabColorMap[source]#

Plot all colormap

class openalea.pylab_decorators_wralea.py_pylab.PyLabFigure[source]#

see pylab.figure for details.

Parameters:
  • axes

  • num

  • figsize

  • dpi

  • facecolor

  • edgecolor

  • frameon

  • subplotpars

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabFontProperties[source]#

A Font properties selector. See matplotlib.font_manager.FontProperties for details.

Warning

not to be used alone. Connect this node to a TextProperties node.

Parameters:
  • family (str)

  • style (str)

  • weight (str)

  • variant (str)

  • stretch (str)

  • size (str)

  • fname (str) – connect to a file with your fonts

  • kwargs (dict) – any other key/value pair

Returns:

a dictionary to be used by a FontProperties instance.

See also

TextProperties

class openalea.pylab_decorators_wralea.py_pylab.PyLabGrid[source]#

Add a grid to an axes. See pylab.grid for details

Parameters:
  • axes – an input axes

  • b (bool) – Set the grid on (default is True)

  • which (str) – where to set the lines (default is major ticks)

  • linestyle (str) – style of the lines (default is dotted)

  • color (str) – color of the lines )(default is black)

  • linewidth (float) – width of the lines (default is 1)

  • kwargs (dict) – further properties to fully customize the grid

Returns:

the current axes

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabLegend[source]#

Add a legend to the axe. see pylab.legend for details

Parameters:
  • shadow – draw a shadow behind legend.

  • location – legend location. See Locations

  • numpoints – the number of points in the legend for line

  • markercolor

  • fancybox – draw a frame with a round fancybox

  • ncol – number of columns. default is 1

  • mode – if mode is “expand”, the legend will be horizontally expanded

  • title – the legend title

  • prop – connect an optional :class`PyLabFontProperties` object to customise further

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabOrigin[source]#

Set the origin. See pylab.imshow for instance.

class openalea.pylab_decorators_wralea.py_pylab.PyLabSaveFig[source]#

Save the current figure in a file. See pylab.savefig for details.

class openalea.pylab_decorators_wralea.py_pylab.PyLabShow[source]#

This node simply calls pylab.show(), which may be useful sometimes.

The input and output connectors are not used by the function itself. There are present to allow this node to be used in a dataflow. Therefore the output is simply set to be the input parameter.

class openalea.pylab_decorators_wralea.py_pylab.PyLabTextProperties[source]#

Create a TextProperties dict. See pylab.Text for details.

class openalea.pylab_decorators_wralea.py_pylab.PyLabTickParams[source]#

Tune the ticks on an axis. See pylab.tick_params for details.

Parameters:
  • axes – the axes to tune.

  • axis (str) – which axis to manipulate (‘x’, ‘y’, ‘both’) (default is ‘both’)

  • reset (bool) – set all parameters to defaults

  • which (str) – apply arguments to major ticks only (default is major)

  • direction (str) – [‘in’ | ‘out’] Puts ticks inside or outside the axes.

  • length (int) – Tick length in points

  • width (int) – Tick width in points

  • pad (int) – Distance in points between tick and label.

  • labelsize – (default 12)

  • labelcolor – (default black)

  • zorder – (default 0)

  • bottom (bool) – default True

  • top (bool)

  • left (bool)

  • right (bool)

  • labelbottom (bool) – (default True)

  • labeltop (bool) – (default False)

  • labelleft (bool) – (default True)

  • labelright (bool) – (default False)

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabTitle[source]#

Add a title to the current axe. See pylab.title for details

Parameters:
  • axes

  • text (str)

  • fontsize (int) – (default 12)

  • color (str) – (default black)

  • kwargs (dict) – (defaut {})

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabXLabel[source]#

Add a label on the x-axis. See pylab.xlabel for details

Parameters:
  • axes – an optional axes where new data will be plotted.

  • text (str)

  • fontsize (int) – font size (default 12)

  • verticalalignement (str) – (default is top)

  • horizontalalignment (str) – (default is center)

  • textproperties (dict) – output of a PyLabFontProperties Node

  • kwargs (dict) – any other key/value pair

Returns:

the current axes

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabXLim[source]#

VisuAlea version of pylab.xlim

Parameters:
  • axes

  • xmin

  • xmax

  • kwargs

Returns:

modified axes

Example:

Note

xmin must be less than xmax

class openalea.pylab_decorators_wralea.py_pylab.PyLabXTicks[source]#

Set the tick locations and labels. See pylab.xticks for details.

Parameters:
  • axes – the current axes to manipulate.

  • locs (array) – (default is empty)

  • labels (array) – (default is empty)

  • orientation (float)

Returns:

the current axes

Example:

class openalea.pylab_decorators_wralea.py_pylab.PyLabYLabel[source]#

Add a label on the x-axis. See pylab.xlabel for details

Parameters:
  • text

  • fontsize

  • verticalalignement

  • horizontalalignment

  • properties (text) – output of a TextProperties Node

Example:

See PyLabXLabel

class openalea.pylab_decorators_wralea.py_pylab.PyLabYLim[source]#

VisuAlea version of pylab.ylim

Parameters:
  • axes

  • ymin

  • ymax

  • kwargs

Returns:

modified axes

See also

PyLabXLim

Note

ymin must be less than ymax

class openalea.pylab_decorators_wralea.py_pylab.PyLabYTicks[source]#

Set the tick locations and labels. See pylab.xticks for details.

Parameters:
  • axes – the current axes to manipulate.

  • locs (array) – (default is empty)

  • labels (array) – (default is empty)

  • orientation (float)

Returns:

the current axes

Example:

see PyLabXTicks