ViolinPlotOptions
ViolinPlotOptions ( upperBoxPercentile ; lowerBoxPercentile ; upperWhiskerPercentile ; lowerWhiskerPercentile ; boxWidth ; markerType ; capLength )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
upperBoxPercentile | num | 0..100 | 75 | In % |
lowerBoxPercentile | num | 0..100 | 25 | In % |
upperWhiskerPercentile | num | 0..100 | 100 | In % |
lowerWhiskerPercentile | num | 0..100 | 0 | In % |
boxWidth | num | 0..10000 | 15% | In % of max. density |
markerType | int | 0..2 | 0 | 0...none, 1...mean, 2...median |
capLength | num | 0..10000 | 0 | In % of box width |
Examples
Description
An optional box plot can be added by using the function ViolinPlotOptions(). The ViolinPlotOptions() function should be listed after the ViolinPlot() function. The box limits are defined by the arguments upperBoxPercentile (default: 75 percent) and lowerBoxPercentile (default: 25 percent), the whisker limits are defined by the arguments upperWhiskerPercentile (default: 100 percent) and lowerWhiskerPercentile (default: 0 percent). The width of the box can be controlled by the argument boxWidth and is entered in pixels or percent of the max. density value (default: 15%). A marker line can be added for the arithmetic mean by the argument markerType = 1 or for the median value by the argument markerType = 2, respectively. Furthermore, the cap length of the whisker percentile can be controlled by using the last argument capLength. The cap length should be entered in percent of the box width (default: 0).
| VIOLIN_PLOT_OPTIONS_01 |
1 | OpenDrawing(400;260) |
2 | |
3 | |
4 | 59 49.7 57.8 53.6 56.9 53.9 51.8 55.1 50.9 46.4 55.4 53.9 52.4 55.7 58.1 48.5 58.4 54.8 54.2 54.5 50.9 54.2 54.5 54.5 57.2 55.7 61.4 54.5 49.4 54.5 52.4 51.5 50.3 54.5 54.5 54.5 55.7 52.1 57.5 56 56.9 58.7 53 51.2 51.5 59.6 56.9 49.4 62 53.9 55.7 57.8 59 58.1 59 51.2 57.2 52.4 51.2 50.9 51.2 50.6 54.8 51.2 55.7 60.5 54.2 54.8 53.6 56 51.5 55.1 53 52.1 60.2 52.1 53 55.7 56.6 52.1 51.8 53.6 59.9 48.8 55.1 56 51.8 54.2 50.3 51.5 57.5 58.4 57.5 55.7 53.3 59.3 53.9 54.5 49.4 52.7 70.4 70.4 73.4 69.5 65.6 69.5 67.7 73.7 71.9 72.5 69.2 66.5 71.3 68.6 66.5 65.6 68.9 67.1 72.5 71.3 66.5 68.6 71 68.6 70.1 68.3 68 66.5 69.8 68 72.5 66.2 69.2 67.1 69.8 73.1 67.7 67.1 66.8 66.2 67.1 69.8 66.5 69.2 65.6 71 71 68 69.2 68.3 68.3 60.5 69.8 67.7 68 71.6 70.4 67.7 68.3 65 67.7 65.6 65 70.7 71.9 68 66.8 64.1 68.3 72.5 72.2 64.7 69.8 71.3 67.1 64.1 69.8 74 71.9 64.4 68.6 69.5 68.3 67.7 71.6 72.8 69.5 68.3 74.9 68.3 64.7 67.4 67.4 74.9 68.3 61.4 70.4 68.6 64.7 69.5; |
5 | 87.2 20.3 59.6 15.2 64.1 47 62.9 53.9 69.5 60.2 53.3 25.1 62.9 63.2 42.8 6.8 14.9 37.7 72.8 52.4 40.4 45.5 75.5 56.9 40.1 55.4 36.5 18.8 29.9 39.8 39.5 53.3 59.9 43.4 45.2 33.5 27.2 70.7 62.9 45.5 49.4 40.7 39.8 33.8 17.3 57.8 45.2 46.1 40.1 31.7 35.9 40.1 19.7 52.1 46.7 37.4 53 55.4 40.1 48.8 35.3 55.4 26 41.6 53.9 41.6 42.2 46.7 61.7 56 34.7 70.4 22.1 45.2 56.3 37.1 56.9 46.1 24.2 42.5 37.7 44.9 23.3 31.1 47.9 23.6 32 17 35.3 28.1 57.8 13.4 44.6 62.6 33.2 64.1 56.6 32.9 63.2 50.9; |
6 | 52.1 52.7 46.4 55.7 55.1 56 54.2 49.1 53 46.7 47.9 50.6 52.4 47.9 51.8 52.4 46.7 53.3 48.5 45.8 47.6 49.4 57.8 50.3 51.5 47.6 53.3 54.2 47.9 54.8 53 51.2 51.8 48.2 53.6 56 50 47.3 50.3 51.8 52.7 52.7 47.6 48.5 43.4 50.3 51.8 48.8 51.2 49.1; |
7 | 86.3 80.6 68.3 75.8 75.5 68.3 68.9 101.9 84.8 89 86.6 77.6 90.8 92.9 94.4 93.8 77.9 90.5 78.8 92.3) |
8 | ViolinPlot(shadow;0;1;0.25;#ddd;0) |
9 | ViolinPlotOptions(75;25;95;5;;1) /* 1...show mean. */ |
10 | /* Set up styles. */ |
11 | BorderColorScheme(6;solid;1) |
12 | FillColorScheme(6;solid;0.5) |
13 | LineStyle(all;;1;#888) /* Use LineStyle() for box plots. */ |
14 | ShadowStyle(all;1 1 3;lightGray) |
15 | /* Set up axes. */ |
16 | |
17 | AxisMajorTicks(all;0) |
18 | AxisMajorTickLabelTexts(x;"Group A";"Group B";"Group C";"Group D") |
19 | AxisMajorTickLabelStyle(x;Verdana;10;plain;#555;center;0;80;40) |
20 | AxisMajorTickLabelOptions(x;;;5) |
21 | AxisMajorTickLabelTexts(y;"|u|";"") |
22 | AxisMajorTickLabelStyle(y;Verdana;10;plain;#555) |
23 | AxisOptions(y;;2) /* Mirror y-axis. */ |
24 | /* Set up grid. */ |
25 | |
26 | MajorGridLineColors(x;y;#ccc) |
27 | MajorGridLineWidths(x;y;0.25) |
28 | |
29 |
| VIOLIN_PLOT_OPTIONS_02 |
1 | OpenDrawing(300;200) |
2 | |
3 | |
4 | 59 49.7 57.8 53.6 56.9 53.9 51.8 55.1 50.9 46.4 55.4 53.9 52.4 55.7 58.1 48.5 58.4 54.8 54.2 54.5 50.9 54.2 54.5 54.5 57.2 55.7 61.4 54.5 49.4 54.5 52.4 51.5 50.3 54.5 54.5 54.5 55.7 52.1 57.5 56 56.9 58.7 53 51.2 51.5 59.6 56.9 49.4 62 53.9 55.7 57.8 59 58.1 59 51.2 57.2 52.4 51.2 50.9 51.2 50.6 54.8 51.2 55.7 60.5 54.2 54.8 53.6 56 51.5 55.1 53 52.1 60.2 52.1 53 55.7 56.6 52.1 51.8 53.6 59.9 48.8 55.1 56 51.8 54.2 50.3 51.5 57.5 58.4 57.5 55.7 53.3 59.3 53.9 54.5 49.4 52.7 70.4 70.4 73.4 69.5 65.6 69.5 67.7 73.7 71.9 72.5 69.2 66.5 71.3 68.6 66.5 65.6 68.9 67.1 72.5 71.3 66.5 68.6 71 68.6 70.1 68.3 68 66.5 69.8 68 72.5 66.2 69.2 67.1 69.8 73.1 67.7 67.1 66.8 66.2 67.1 69.8 66.5 69.2 65.6 71 71 68 69.2 68.3 68.3 60.5 69.8 67.7 68 71.6 70.4 67.7 68.3 65 67.7 65.6 65 70.7 71.9 68 66.8 64.1 68.3 72.5 72.2 64.7 69.8 71.3 67.1 64.1 69.8 74 71.9 64.4 68.6 69.5 68.3 67.7 71.6 72.8 69.5 68.3 74.9 68.3 64.7 67.4 67.4 74.9 68.3 61.4 70.4 68.6 64.7 69.5; |
5 | 87.2 20.3 59.6 15.2 64.1 47 62.9 53.9 69.5 60.2 53.3 25.1 62.9 63.2 42.8 6.8 14.9 37.7 72.8 52.4 40.4 45.5 75.5 56.9 40.1 55.4 36.5 18.8 29.9 39.8 39.5 53.3 59.9 43.4 45.2 33.5 27.2 70.7 62.9 45.5 49.4 40.7 39.8 33.8 17.3 57.8 45.2 46.1 40.1 31.7 35.9 40.1 19.7 52.1 46.7 37.4 53 55.4 40.1 48.8 35.3 55.4 26 41.6 53.9 41.6 42.2 46.7 61.7 56 34.7 70.4 22.1 45.2 56.3 37.1 56.9 46.1 24.2 42.5 37.7 44.9 23.3 31.1 47.9 23.6 32 17 35.3 28.1 57.8 13.4 44.6 62.6 33.2 64.1 56.6 32.9 63.2 50.9; |
6 | 52.1 52.7 46.4 55.7 55.1 56 54.2 49.1 53 46.7 47.9 50.6 52.4 47.9 51.8 52.4 46.7 53.3 48.5 45.8 47.6 49.4 57.8 50.3 51.5 47.6 53.3 54.2 47.9 54.8 53 51.2 51.8 48.2 53.6 56 50 47.3 50.3 51.8 52.7 52.7 47.6 48.5 43.4 50.3 51.8 48.8 51.2 49.1; |
7 | 56.3 50.6 38.3 45.8 45.5 38.3 38.9 71.9 54.8 59 56.6 47.6 60.8 62.9 64.4 63.8 47.9 60.5 48.8 62.3) |
8 | ViolinPlot(;;;0;none;0;3) |
9 | ViolinPlotOptions(75;25;95;5;20%;1;5) /* 1...show mean. */ |
10 | /* Set up styles. */ |
11 | FillStyle(1;#77a76e11) |
12 | FillStyle(2;#ffca5f11) |
13 | FillStyle(3;#77a76e11) |
14 | FillStyle(4;#ffca5f11) |
15 | BorderStyle(1;;1;#77a76e) |
16 | BorderStyle(2;;1;#ffca5f) |
17 | BorderStyle(3;;1;#77a76e) |
18 | BorderStyle(4;;1;#ffca5f) |
19 | LineStyle(1;;1;#77a76e) /* Use LineStyle() for box plots. */ |
20 | LineStyle(2;;1;#a58b5c) |
21 | LineStyle(3;;1;#77a76e) |
22 | LineStyle(4;;1;#a58b5c) |
23 | /* Set up axes. */ |
24 | |
25 | AxisMajorTicks(all;0) |
26 | AxisMajorTickLabelTexts(x;"Distributions A|B";"Distributions C|D") |
27 | AxisMajorTickLabelStyle(x;Verdana;10;plain;#555;center;0;150;40) |
28 | AxisMajorTickLabelOptions(x;;;5) |
29 | AxisMajorTickLabelTexts(y;"|u|") |
30 | AxisMajorTickLabelStyle(y;Verdana;10;plain;#555) |
31 | /* Set up grid. */ |
32 | |
33 | MajorGridLineColors(x;y;#ddd) |
34 | MajorGridLineWidths(x;y;0.25) |
35 | |
36 |