Plot style configuration

Each plot in POOL has a global variable :style defined at construction time. It contains a dictionary of properties which, together with settings of radius (setr), icon (setti, settc) and pen style (setps, setpc), allow to configure the mode and styles of visualization of :data variable. Writing to any of the :style properties causes redrawing of the plot, e.g.:

"p := newp "Plot [
  "data := genarray 120 [
    let "x 3 * :index - 180
    array :x 100 * sin :x
  ]

  :style,"color := 2
  setti "fcircle
  setr 2
]

Style properties:

mode: data interpretation mode, possible values:
"vector - default, :data variable contains collection of vectors, items at indices indicated with xpos and ypos define positions of displayed (x,y) points;
"line - (x,y) points as in "vector mode, but consecutive points are connected with lines;
"matrix - the collection of vectors in :data variable is treated as matrix; matrix values can be either numbers or collections, with values used to plot points according to style settings; distance between rows and columns of points inn the matrix is equal to plot radius value (setr instruction);

xpos, ypos: define indices of items in vectors contained in data collection, which are used as x and y positions of points displayed by the plot in "vector and "line modes;

xerr, yerr: define indices of items in vectors contained in data collection, which will be visualized as errors of the displayed points, default value is "none (errors are not visualized);

color: index of items in vectors contained in data collection, which define colors of displayed points, default value is "none (color is constant for all points, as configured with settc instruction);

color_min, color_max: values that are scaled to the first and the last index in the color palette, the default value "auto causes automatic scaling to the maximum and/or minimum value of items defined with the color style;

size: index of items in vectors contained in data collection, which define size of displayed points, default value is "none (all points are of the same size, corresponding to the radius value set with setr);

size_min, size_max: values corresponding to the minimum and maximum point size, default value of "auto causes automatic scaling of the size range to the maximum and/or minimum value of items defined with the size style;

opacity: index of items in vectors contained in data collection, which define opacity of displayed points, default value is "none (all points have the same opacity, corresponding to the color opacity value set with settc);

opacity_min, opacity_max: values corresponding to the minimum and maximum point opacity, default value of "auto causes automatic scaling of the opacity range to the maximum and/or minimum value of items defined with the opacity style.

See also:

Turtle - plot - object

newp, newplot - create plot (synchronous constructor)
anewp, anewplot - create plot (asynchronous constructor)

Table of Content