Skip to main content

diagram

lq.diagram(width=6cm, height=4cm, title=none, legend=(:), xlim=auto, ylim=auto, xlabel=none, ylabel=none, grid=auto, xscale=auto, yscale=auto, xaxis=(:), yaxis=(:), margin=6%, cycle=petroff10, fill=none, ..children)(source)

Creates a new diagram.

Parameters

width : length | relative    default: 6cm

The width of the diagram. This can be

  • A length; in this case, it defines just the width of the data area, excluding axes, labels, title etc.
  • A ratio or relative where the ratio part is relative to the width of the parent that the diagram is placed in. This is not allowed if the parent has an unbounded width, e.g., a page with width: auto.

height : length | relative    default: 4cm

The height of the diagram. This can be

  • A length; in this case, it defines just the height of the data area, excluding axes, labels, title etc.
  • A ratio or relative where the ratio part is relative to the height of the parent that the diagram is placed in. This is not allowed if the parent has an unbounded height, e.g., a page with height: auto.

title : lq.title | str | content | none    default: none

The title for the diagram. Use a title object for more options.

legend : none | dictionary | lq.legend    default: (:)

Options to pass to the legend constructor. If set to none, no legend is shown.

Alternatively, a legend with entirely custom entries can be created and given here.

xlim : auto | array    default: auto

Data limits along the xx-axis. Expects auto or a tuple (min, max) where min and max may individually be auto. Also see axis.lim.

ylim : auto | array    default: auto

Data limits along the yy-axis. Expects auto or a tuple (min, max) where min and max may individually be auto. Also see axis.lim.

xlabel : lq.label | content    default: none

Label for the xx-axis. Use a label object for more options.

ylabel : lq.label | content    default: none

Label for the yy-axis. Use a label object for more options.

grid : auto | none | dictionary | stroke | color | length    default: auto

Options to apply to the grid. A stroke, color, or length argument directly sets the grid stroke while a dictionary with the possible keys stroke, stroke-sub, and z-index gives more fine-grained control. Setting this parameter to none removes the grid entirely. See grid for more details.

xscale : auto | str | lq.scale    default: auto

Sets the scale of the xx-axis. This may be a scale object or the name of one of the built-in scales "linear", "log", "symlog", and "datetime".

If left at auto, the scale will be set to "datetime" if any of the plots uses datetime coordinates and "linear" otherwise.

yscale : auto | str | lq.scale    default: auto

Sets the scale of the yy-axis. This may be a scale object or the name of one of the built-in scales "linear", "log", "symlog", and "datetime".

If left at auto, the scale will be set to "datetime" if any of the plots uses datetime coordinates and "linear" otherwise.

xaxis : none | dictionary    default: (:)

Configures the xx-axis through a dictionary of arguments to pass to the constructor of the axis. See axis for available options.

yaxis : none | dictionary    default: (:)

Configures the yy-axis through a dictionary of arguments to pass to the constructor of the axis. See axis for available options.

margin : ratio | dictionary    default: 6%

Configures the automatic margins of the diagram around the data. If set to 0%, the outer-most data points align tightly with the edges of the diagram (as long as the axis limits are left at auto). Otherwise, the margins are computed in percent of the covered range along an axis (in scaled coordinates).

The margins can be set individually for each side by passing a dictionary with the possible keys

  • left, right, top, bottom for addressing individual sides,
  • x, y for left/right and top/bottom combined sides, and
  • rest for all sides not specified by any of the above.

cycle : array    default: petroff10

Style cycle to use for this diagram. Check out the cycles tutorial for more information. The elements of a cycle array should either be

  • all functions as described in the tutorial, or
  • all of type color (e.g., one of the maps under lq.color.map), or
  • all of type dictionary with possible keys color, stroke, and mark.

fill : none | color | gradient | tiling    default: none

How to fill the background of the data area.

..children : any

Plot objects like plot, bar, scatter, contour etc. and additional axis objects.