[back]

Plotter

Various GUI engines

PAIDA has three plotting engines.
By default, PAIDA will select a porper GUI engine automatically depending on your environment.

Environment
GUI engine
If you use Jython
swing
Else if you have Tkinter
tkinter
Else
batch

You can select explicitly by typing

batch python yourscript.py --gui=batch
tkinter python yourscript.py --gui=tkinter
swing python yourscript.py --gui=swing

or inside your script
(currently, the following lines must be placed before any of the lines using PAIDA module)

import paida.paida_gui.PGuiSelector
paida.paida_gui.PGuiSelector.setGuiEngineName('batch')
#paida.paida_gui.PGuiSelector.setGuiEngineName('tkinter')
#paida.paida_gui.PGuiSelector.setGuiEngineName('swing')

Various image formats

Various image formats are supported.

Type Description Supported Image Format
PS EPS JPEG GIF PNG
batch plots nothing - - - - -
tkinter Tkinter GUI o o - - -
swing Swing GUI - - o o o

More about PS and EPS formats.

Format Description
PS Multiple pages without size One new page per writeToFile() call
EPS Single figure with size Overwritten by second call

How to create multiple pages in PS file

Every time you call
plotter.writeToFile('filename.ps') / plotter.writeToFile('filename.ps', 'PS'),
one new page will be added.

Plotter window size/direction

The plotter window size and direction can be changed by

plotter.setParameter('paper', 'A5')
plotter.setParameter('portrait', 'False')

See also "A plotter itself has some parameters".

Various styles

A plotter can plot analysis objects in various styles by using plotterStyles.
A plotterStyle has child style information and every style has some parameters.

plotterStyle = plotter.style()
or
plotterStyle = plotterFactory.createPlotterStyle()

Table of styles.
plotterStyle dataStyle fillStyle
lineStyle
markerStyle
infoStyle fillStyle
lineStyle
textStyle
titleStyle textStyle
xAxisStyle
yAxisStyle
zAxisStyle
lineStyle
labelStyle
tickLabelStyle

sampleStyle.py

plotterStyle
parameter name default value available values / comments
dataStyle returns IDataStyle instance
infoStyle returns IInfoStyle instance
titleStyle returns ITitleStyle instance
xAxisStyle returns IAxisStyle instance
yAxisStyle returns IAxisStyle instance
zAxisStyle returns IAxisStyle instance
showTitle 'False' 'True', 'true', 'False', 'false', True, False
showStatisticsBox 'False' 'True', 'true', 'False', 'false', True, False
showLegendsBox 'False' 'True', 'true', 'False', 'false', True, False
showTextsBox 'False' 'True', 'true', 'False', 'false', True, False
backgroundColor 'white' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
regionFillColor '' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
regionLineColor '' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
rotationRatio [0.6, 0.1, 0.5] sets 3D rotation by ratio positions of specific three points
rotationAxis [None, None, None, None, None] sets 3D rotation by center axis and rotation angles

dataStyle plotterStyle
parameter name default value available values / comments
fillStyle returns IFillStyle instance
lineStyle returns ILineStyle instance
markerStyle returns IMarkerStyle instance
histogram1DFormat 'histogram' 'histogram', 'bar'
histogram2DFormat 'bar' 'bar', 'box', 'ellipse'
histogram3DFormat 'box' 'box'
cloud1DFormat 'scatter' 'histogram', 'scatter', 'scatterIndexed'
cloud2DFormat 'scatter' 'histogram', 'scatter', 'scatterIndexed', 'scatterColorIndexed'
cloud3DFormat 'scatter' 'histogram', 'scatter'
dataPointSet1DFormat 'scatter' 'scatter', 'scatterIndexed'
dataPointSet2DFormat 'scatter' 'scatter', 'scatterIndexed', 'scatterColorIndexed'
dataPointSet3DFormat 'scatter' 'scatter'
dataPoint 'center' 'center', 'mean'
showMarkers 'False' 'True', 'true', 'False', 'false', True, False
showErrorBars 'False' 'True', 'true', 'False', 'false', True, False
errorBarsColor 'black' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'

infoStyle plotterStyle
parameter name default value available values / comments
textStyle
returns ITextStyle instance
lineStyle
returns ILineStyle instance
fillStyle
returns IFillStyle instance

titleStyle plotterStyle
parameter name default value available values / comments
textStyle
returns ITextStyle instance

axisStyle plotterStyle
parameter name default value available values / comments
labelStyle returns ITextStyle instance
lineStyle returns ILineStyle instance
tickLabelStyle returns ITextStyle instance
label '' any text
scale 'linear' 'log', 'lin', 'logarithmic', 'linear'
type 'double' 'double', 'int', 'time'
grid 'True' 'True', 'true', 'False', 'false', True, False
gridSub 'False' 'True', 'true', 'False', 'false', True, False
tickLine 'both' 'in', 'out', 'both', ''

fillStyle dataStyle plotterStyle
parameter name default value available values / comments
color 'white' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
opacity 0.0 0.0, 1.0 (no effect in this version)
pattern 'flat' 'flat'

lineStyle dataStyle plotterStyle
lineStyle infoStyle plotterStyle
lineStyle axisStyle plotterStyle
parameter name default value available values / comments
color 'black' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
opacity 0.0 0.0, 1.0 (no effect in this version)
lineType 'solid' 'solid'
thickness 1 any int value

markerStyle dataStyle plotterStyle
parameter name default value available values / comments
color 'black' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
opacity 0.0 0.0, 1.0 (no effect in this version)
shape 'circle' 'circle', 'square', 'diamond', 'triangle', 'cross'
size '5p' any size value
- '10' 10 pixels
- '10c' 10 centimeters
- '10i' 10 inches
- '10m' 10 millimeters
- '10p' 10 printer's points

fillStyle infoStyle plotterStyle
parameter name default value available values / comments
color '' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
opacity 0.0 0.0, 1.0 (no effect in this version)
pattern 'flat' 'flat'

textStyle infoStyle plotterStyle
textStyle titleStyle plotterStyle
labelStyle axisStyle plotterStyle
tickLabelStyle axisStyle plotterStyle
parameter name default value available values / comments
color 'black' #rgb, #rrggbb, #rrrgggbbb, #rrrrggggbbbb
'', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black', 'white'
opacity 0.0 0.0, 1.0 (no effect in this version)
font 'Courier' avairable fonts on your system.
fontSize 12.0 positive/negative value means point/pixel unit respectively
bold 'False' 'True', 'true', 'False', 'false', True, False
italic 'False' 'True', 'true', 'False', 'false', True, False
underlined 'False' 'True', 'true', 'False', 'false', True, False

A plotter itself has some parameters.

plotter
parameter name default value available values / comments
paper 'A4' 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7',
'B0', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7',
'Letter', 'Legal', 'Tabloid', 'Hagaki'
landscape 'True' 'True', 'true', 'False', 'false', True, False
width paper size's width any size value
- '10' 10 pixels
- '10c' 10 centimeters
- '10i' 10 inches
- '10m' 10 millimeters
- '10p' 10 printer's points
height paper size's height any size value
viewWidth the same as width any size value
viewHeight the same as height any size value
swap width <-> height

A plotterLayout has some parameters.

plotterLayout
parameter name default value available values / comments
statisticsBoxAnchor 'NE' 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'
statisticsBoxOffsetX '0p' any position value
- '10' 10 pixels
- '10c' 10 centimeters
- '10i' 10 inches
- '10m' 10 millimeters
- '10p' 10 printer's points
statisticsBoxOffsetY '0p' any position value
legendsBoxAnchor 'NW' 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'
legendsBoxOffsetX '0p' any position value
legendsBoxOffsetY '0p' any position value
textsBoxAnchor 'NE' 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'
textsBoxOffsetY '0p' any position value
textsBoxOffsetY '0p' any position value

3D rotated plot

From 3.2.1_2.9, PAIDA can plot 3D rotated objects by specifing one of the two parameters in IPlotterStyle:

default
rotationRatio '[2.0, 4.0]'
rotationAxis '[None, None, None, None, False]'

If both of them are specified, 'rotationAxis' is neglected.

rotationRatio : [Yy/Xy, Zy/Xy]
List type parameter
This is convenient when you want to keep Z axis vertical.

sampleRotationRatio.py

rotationAxis : [Vx, Vy, Vz, angle, boolSquare = False]
List type parameter
This is the rotation around a vector (Vx, Vy, Vz). The "angle" is the rotation angle in radian (counterclockwise). The last parameter "boolSquare" is omittable. If set to True, the plot is forced to be inside a square area.
The camera is set perpendicular to the XY-plane ((0, 0, -1) direction).
Memo : Currently the tick labels may be sometimes displayed too close to the axis lines depending on the parameter values.

sampleRotationAxis.py

Time scaling

Also supports time scaling.

  1. The scaling factor is automatically determined depending on the axis range.
  2. The time value is second from epoch.

sampleTime.py

[back]