17
if test_vertical_bar_plot:
16
18
#Passing a dictionary
17
19
data = { 'teste00' : [27], 'teste01' : [10], 'teste02' : [18], 'teste03' : [5], 'teste04' : [1], 'teste05' : [22] }
18
cairoplot.bar_plot ( 'bar_0_dictionary', data, 400, 300, border = 20, grid = True, rounded_corners = True )
20
cairoplot.vertical_bar_plot ( 'vbar_0_dictionary', data, 400, 300, border = 20, grid = True, rounded_corners = True )
20
22
#Using default, rounded corners and 3D visualization
21
23
data = [ [0, 3, 11], [8, 9, 21], [13, 10, 9], [2, 30, 8] ]
22
24
colors = [ (1,0.2,0), (1,0.7,0), (1,1,0) ]
23
cairoplot.bar_plot ( 'bar_1_default', data, 400, 300, border = 20, grid = True, rounded_corners = False, colors = "yellow_orange_red" )
24
cairoplot.bar_plot ( 'bar_2_rounded', data, 400, 300, border = 20, grid = True, rounded_corners = True, colors = colors )
25
cairoplot.bar_plot ( 'bar_3_3D', data, 400, 300, border = 20, grid = True, three_dimension = True, colors = colors )
25
cairoplot.vertical_bar_plot ( 'vbar_1_default', data, 400, 300, border = 20, grid = True, rounded_corners = False, colors = "yellow_orange_red" )
26
cairoplot.vertical_bar_plot ( 'vbar_2_rounded', data, 400, 300, border = 20, grid = True, rounded_corners = True, colors = colors )
27
cairoplot.vertical_bar_plot ( 'vbar_3_3D', data, 400, 300, border = 20, grid = True, three_dimension = True, colors = colors )
27
29
#Mixing groups and columns
28
30
data = [ [1], [2], [3,4], [4], [5], [6], [7], [8], [9], [10] ]
29
cairoplot.bar_plot ( 'bar_4_group', data, 400, 300, border = 20, grid = True )
31
cairoplot.vertical_bar_plot ( 'vbar_4_group', data, 400, 300, border = 20, grid = True )
31
33
#Using no labels, horizontal and vertical labels
32
34
data = [[3,4], [4,8], [5,3], [9,1]]
33
35
y_labels = [ "line1", "line2", "line3", "line4", "line5", "line6" ]
34
36
x_labels = [ "group1", "group2", "group3", "group4" ]
35
cairoplot.bar_plot ( 'bar_5_no_labels', data, 600, 200, border = 20, grid = True )
36
cairoplot.bar_plot ( 'bar_6_x_labels', data, 600, 200, border = 20, grid = True, x_labels = x_labels )
37
cairoplot.bar_plot ( 'bar_7_y_labels', data, 600, 200, border = 20, grid = True, y_labels = y_labels )
38
cairoplot.bar_plot ( 'bar_8_hy_labels', data, 600, 200, border = 20, grid = True, x_labels = x_labels, y_labels = y_labels )
37
cairoplot.vertical_bar_plot ( 'vbar_5_no_labels', data, 600, 200, border = 20, grid = True )
38
cairoplot.vertical_bar_plot ( 'vbar_6_x_labels', data, 600, 200, border = 20, grid = True, x_labels = x_labels )
39
cairoplot.vertical_bar_plot ( 'vbar_7_y_labels', data, 600, 200, border = 20, grid = True, y_labels = y_labels )
40
cairoplot.vertical_bar_plot ( 'vbar_8_hy_labels', data, 600, 200, border = 20, grid = True, x_labels = x_labels, y_labels = y_labels )
43
data = [[10*random.random()] for x in range(50)]
44
x_labels = ["large label name oh my god it's big" for x in data]
45
cairoplot.vertical_bar_plot ( 'vbar_9_large', data, 1000, 800, border = 20, grid = True, rounded_corners = True, x_labels = x_labels )
47
if test_horizontal_bar_plot:
49
data = { 'teste00' : [27], 'teste01' : [10], 'teste02' : [18], 'teste03' : [5], 'teste04' : [1], 'teste05' : [22] }
50
cairoplot.horizontal_bar_plot ( 'hbar_0_dictionary', data, 400, 300, border = 20, grid = True, rounded_corners = True )
52
#Using default, rounded corners and 3D visualization
53
data = [ [0, 3, 11], [8, 9, 21], [13, 10, 9], [2, 30, 8] ]
54
colors = [ (1,0.2,0), (1,0.7,0), (1,1,0) ]
55
cairoplot.horizontal_bar_plot ( 'hbar_1_default', data, 400, 300, border = 20, grid = True, rounded_corners = False, colors = "yellow_orange_red" )
56
cairoplot.horizontal_bar_plot ( 'hbar_2_rounded', data, 400, 300, border = 20, grid = True, rounded_corners = True, colors = colors )
58
#Mixing groups and columns
59
data = [ [1], [2], [3,4], [4], [5], [6], [7], [8], [9], [10] ]
60
cairoplot.horizontal_bar_plot ( 'hbar_4_group', data, 400, 300, border = 20, grid = True )
62
#Using no labels, horizontal and vertical labels
63
data = [[3,4], [4,8], [5,3], [9,1]]
64
x_labels = [ "line1", "line2", "line3", "line4", "line5", "line6" ]
65
y_labels = [ "group1", "group2", "group3", "group4" ]
66
cairoplot.horizontal_bar_plot ( 'hbar_5_no_labels', data, 600, 200, border = 20, grid = True )
67
cairoplot.horizontal_bar_plot ( 'hbar_6_x_labels', data, 600, 200, border = 20, grid = True, x_labels = x_labels )
68
cairoplot.horizontal_bar_plot ( 'hbar_7_y_labels', data, 600, 200, border = 20, grid = True, y_labels = y_labels )
69
cairoplot.horizontal_bar_plot ( 'hbar_8_hy_labels', data, 600, 200, border = 20, grid = True, x_labels = x_labels, y_labels = y_labels )
72
data = [[10*random.random()] for x in range(50)]
73
x_labels = ["large label name oh my god it's big" for x in data]
74
cairoplot.horizontal_bar_plot ( 'hbar_9_large', data, 1000, 800, border = 20, grid = True, rounded_corners = True, x_labels = x_labels )
40
78
if test_donut_plot :
41
79
#Define a new backgrond
113
158
if test_scatter_plot:
115
160
data = [ (-2,10), (0,0), (0,15), (1,5), (2,0), (3,-10), (3,5) ]
116
cairoplot.scatter_plot ( 'cross_1_default', data = data, width = 500, height = 500, border = 20, axis = True, grid = True )
161
cairoplot.scatter_plot ( 'scatter_1_default', data = data, width = 500, height = 500, border = 20, axis = True, grid = True )
163
#lists of coordinates x,y
164
data = [[1,2,3,4,5],[1,1,1,1,1]]
165
cairoplot.scatter_plot ( 'scatter_2_lists', data = data, width = 500, height = 500, border = 20, axis = True, grid = True )
167
#lists of coordinates x,y,z
168
data = [[0.5,1,2,3,4,5],[0.5,1,1,1,1,1],[10,6,10,20,10,6]]
169
colors = [ (0,0,0,0.25), (1,0,0,0.75) ]
170
cairoplot.scatter_plot ( 'scatter_3_lists', data = data, width = 500, height = 500, border = 20, axis = True, discrete = True,
171
grid = True, circle_colors = colors )
118
173
data = [(-1, -16, 12), (-12, 17, 11), (-4, 6, 5), (4, -20, 12), (13, -3, 21), (7, 14, 20), (-11, -2, 18), (19, 7, 18), (-10, -19, 15),
119
174
(-17, -2, 6), (-9, 4, 10), (14, 11, 16), (13, -11, 18), (20, 20, 16), (7, -8, 15), (-16, 17, 16), (16, 9, 9), (-3, -13, 25),
121
176
(17, -15, 25), (-2, -8, 5), (5, 20, 20), (18, 20, 23), (-20, -16, 17), (-19, -2, 9), (-11, 19, 18), (17, 16, 12), (-5, -20, 15),
122
177
(-20, -13, 10), (-3, 5, 20), (-1, 13, 17), (-11, -9, 11)]
123
178
colors = [ (0,0,0,0.25), (1,0,0,0.75) ]
124
cairoplot.scatter_plot ( 'cross_2_variable_radius', data = data, width = 500, height = 500, border = 20,
179
cairoplot.scatter_plot ( 'scatter_2_variable_radius', data = data, width = 500, height = 500, border = 20,
125
180
axis = True, discrete = True, dots = 2, grid = True,
126
181
x_title = "x axis", y_title = "y axis", circle_colors = colors )
183
#Scatter x DotLine error bars
129
184
t = [x*0.1 for x in range(0,40)]
130
185
f = [math.exp(x) for x in t]
131
186
g = [10*math.cos(x) for x in t]