12.3.8. Canvas

Canvas is where the drawing takes place. There is always an active canvas

Axes : Canvas have an implicit coordinate system, and thus, they can have axes

12.3.8.1. Attributes

  • .size: size in the parent space
  • .coords: if given a system of coordinates
  • .shape: a clipping shape, so the canvas can take any shape. This annulates .size
  • .axes: (EXPERIMENTAL) displays or hides a set of two axes
  • .renderer: allows specification of a renderer to display this canvas.
  • .vectshader: allows specification of a shader that will process all the lines before rendering?
  • .subcanvas[i]: if the canvas was partitioned, then subcanvas contain the children canvases
  • .padding : empty space around the borders. Can be set in percentage or length measure. Image will be clipped to the border
  • .border : if there is padding defined, this controls how the border is displayed. Its a LineStyle
  • .xAxis : a reference to the xAxis. If present, the xAxis will be displayed. Axes can be configured (see [axis])
  • .yAxis : a reference to yAxis. If present, the y axis will be displayed
  • .xAxis2 : reference to the second xAxis. The second
  • .yAxis2 : reference to the second yAxis
  • .wrapping : wrapping

12.3.8.2. Methods

  • divide: divides the canvas in subcanvases. The function returns an array with the generated canvases. Additionally, those canvases appear in the attribute subcanvases.
    • Arguments: a tuple i,j to generate i*j canvases. Can be input in the form “<i>x<j>” or “<i> <j>” or “i j”
    • Parameters of divide are:
      • 3x7
      • join: joins two or more subcanvases into one. It can be referred by any of the joined ones
      • widths: allows sepcifying the widths of the columns that generate the subcanvases
      • heights: same for heights
      • border: attributes for the border of the new generated canvases
  • clone(): clones the canvas