Functions > Plotting


To get a start with plotting, read the tutorial on plotting.

The following functions are described in this section:

01. addplot 02. copyplot 03. createplot 04. plot
05. removeplot 06. showplot

addplot

Available since version 1.0.1.2. Used to add plot data to the Plot object created using the createplot function. Its format is:

addplot(plot, xValues, yValues, [rotation], [line_thickness], [color], [xTranslate],[yTranslate],[fillColor])

The parameters inside [] brackets are optional. If you want to use an optional parameter, you will have to provide all preceding optional parameters. The last 3 parameters are available since v.1.0.1.7.

The 'color' values can be: (1) a color name such as 'red' (2) an empty string to use MP provided color; or (3) a string containing (A)RGB value as a comma delimitted string. (A)RGB stands for Alpha (i.e. transparency), Red, Green and Blue. Each of the values is a number between 0 and 255. Providing 0 for aplha means fully transparent and 255 means fully opaque. The values in between are for semi transparent colors.

The built-in examples folder show very detailed examples of plotting routines. Please refer to built-in examples for further details. 

copyplot

Available since version 1.0.1.2. Creates a copy of an existing Plot object. Expects a single Plot object as parameter and returns a new Plot object that's exactly like the first object, except that the two are totally different objects independent of each other. Example:

p = copyplot(old_plot)

createplot

Available since version 1.0.1.2. Creates a new Plot object. You can then add as many line graphs to this object as you wish. The function does not expect any parameters.

plot

Deprecated since v.1.0.1.2. This is the old plot function. Prior to version 1.0.1.2, this was the only plotting routine. New programs should use the new plot fucntions - createplot(), addplot() and then showplot().

removeplot

Available since version 1.0.1.2. Removes one or more plot curves from an existing Plot object using their 0 based indexes.

showplot

Available since version 1.0.1.2. Displays an existing plot. The syntax is:

showplot(plot_object, [rotation], [scaleX], [scaleY])

The parameters inside [] brackets are optional. If you want to use an optional parameter, you will have to provide all preceding optional parameters.

 

New Version!

Spirograph (desktop) v-1.0.2.1 was released on April 23, 2015. Improvements include:

  • Fill colors (with transparency)
  • Two fill modes
  • High resolution export for designers

 

 

Navigation