|
20 | 20 | FileUtils.mkdir_p @temp_dir |
21 | 21 | end |
22 | 22 |
|
23 | | - it "plots a single stacked bar graph with default colors" do |
24 | | - fig = Rubyplot::Figure.new |
25 | | - axes = fig.add_subplot 0,0 |
26 | | - axes.stacked_bar! do |p| |
27 | | - p.data [25, 36, 86, 39] |
28 | | - p.label = "moon" |
29 | | - end |
30 | | - axes.title = "net earnings in different months." |
31 | | - axes.x_ticks = { |
32 | | - 0 => 'Jan', |
33 | | - 1 => 'Feb', |
34 | | - 2 => 'March', |
35 | | - 3 => 'April', |
36 | | - 4 => 'May', |
37 | | - 5 => 'June', |
38 | | - 6 => 'July', |
39 | | - 7 => 'August', |
40 | | - 8 => 'September', |
41 | | - 9 => 'October', |
42 | | - 10 => 'November', |
43 | | - 11 => 'December' |
44 | | - } |
45 | | - |
46 | | - file = "/#{Rubyplot.backend}_simple_stacked_bar.png" |
47 | | - fig.write(@temp_dir + file) |
48 | | - |
49 | | - #expect("temp/stacked_bar" + file).to eq_image("fixtures/stacked_bar" + file) |
50 | | - end |
51 | | - |
52 | | - it "plots multiple stacked bar graphs with default colors" do |
| 23 | + it "plots multiple stacked bar graphs with default colors", hell: true do |
53 | 24 | fig = Rubyplot::Figure.new |
54 | 25 | axes = fig.add_subplot 0,0 |
55 | 26 | [ |
|
63 | 34 | end |
64 | 35 | end |
65 | 36 | axes.title = "net earnings in different months." |
66 | | - axes.x_ticks = { |
67 | | - 0 => 'Jan', |
68 | | - 1 => 'Feb', |
69 | | - 2 => 'March', |
70 | | - 3 => 'April', |
71 | | - 4 => 'May', |
72 | | - 5 => 'June', |
73 | | - 6 => 'July', |
74 | | - 7 => 'August', |
75 | | - 8 => 'September', |
76 | | - 9 => 'October', |
77 | | - 10 => 'November', |
78 | | - 11 => 'December' |
79 | | - } |
| 37 | + axes.x_ticks = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', |
| 38 | + 'August', 'September', 'October', 'November', 'December'] |
80 | 39 |
|
81 | 40 | file = "/#{Rubyplot.backend}_multiple_stacked_bar.png" |
82 | 41 | fig.write(@temp_dir + file) |
|
85 | 44 | end |
86 | 45 |
|
87 | 46 | it "plots stacked bar in a small size" do |
88 | | - fig = Rubyplot::Figure.new |
| 47 | + fig = Rubyplot::Figure.new(height: 400, width: 400) |
89 | 48 | axes = fig.add_subplot 0,0 |
90 | 49 | [ |
91 | 50 | ["Car", [25, 36, 86, 39]], |
92 | 51 | ["Bus", [80, 54, 67, 54]], |
93 | 52 | ["Train", [22, 29, 35, 38]] |
94 | 53 | ].each do |label, data| |
95 | | - axes.stacked_bar!(400) do |p| |
| 54 | + axes.stacked_bar! do |p| |
96 | 55 | p.data data |
97 | 56 | p.label = label |
98 | 57 | end |
|
113 | 72 | FileUtils.mkdir_p @temp_dir |
114 | 73 | end |
115 | 74 |
|
116 | | - it "plots a single dot plot" do |
| 75 | + skip "plots a single dot plot" do |
117 | 76 | fig = Rubyplot::Figure.new |
118 | 77 | axes = fig.add_subplot 0,0 |
119 | 78 | axes.dot! do |p| |
120 | 79 | p.data [0,5,8,15] |
121 | 80 | p.label = "Car" |
122 | 81 | p.color = :maroon |
123 | | - p.minimum_value = 0 # FIXME: change this! |
124 | 82 | end |
125 | | - axes.y_ticks = { |
126 | | - 0 => '5/6', |
127 | | - 1 => '5/15', |
128 | | - 2 => '5/24', |
129 | | - 3 => '5/30' |
130 | | - } |
| 83 | + axes.num_y_ticks = 4 |
| 84 | + axes.y_ticks = ['5/6', '5/15', '5/24', '5/30'] |
131 | 85 |
|
132 | 86 | file = "/#{Rubyplot.backend}_simple_dot.png" |
133 | 87 | fig.write(@temp_dir + file) |
134 | 88 |
|
135 | 89 | #expect("temp/dot" + file).to eq_image("fixtures/dot" + file) |
136 | 90 | end |
137 | 91 |
|
138 | | - it "plots multiple dot plots" do |
| 92 | + skip "plots multiple dot plots" do |
139 | 93 | fig = Rubyplot::Figure.new |
140 | 94 | axes = fig.add_subplot 0,0 |
141 | 95 | [ |
|
0 commit comments