|
28 | 28 | end |
29 | 29 | end |
30 | 30 | axes.title = "net earnings in different months." |
| 31 | + axes.x_title = "X title" |
| 32 | + axes.y_title = "Y title" |
31 | 33 | axes.x_ticks = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', |
32 | 34 | 'August', 'September', 'October', 'November', 'December'] |
33 | 35 | end |
|
153 | 155 | end |
154 | 156 |
|
155 | 157 | context "#line!" do |
156 | | - it "makes a simple line plot", focus: true do |
| 158 | + it "makes a simple line plot" do |
157 | 159 | @figure = Rubyplot::Figure.new |
158 | 160 | axes = @figure.add_subplot 0,0 |
159 | 161 | axes.line! do |p| |
|
164 | 166 | axes.title = "A line graph." |
165 | 167 | end |
166 | 168 |
|
167 | | - it "plots 2 simple lines on the same axes" do |
| 169 | + it "plots 2 simple lines on the same axes", focus: true do |
168 | 170 | @figure = Rubyplot::Figure.new |
169 | 171 | axes = @figure.add_subplot 0,0 |
170 | 172 | axes.line! do |p| |
171 | | - p.data [20, 23, 19, 8] |
| 173 | + p.data [3, 5, 10, 15] |
172 | 174 | p.label = "Marco" |
173 | 175 | p.color = :blue |
174 | 176 | end |
175 | 177 | axes.line! do |p| |
176 | | - p.data [1, 53, 76, 18] |
| 178 | + p.data [1, 9, 13, 28] |
177 | 179 | p.label = "John" |
178 | 180 | p.color = :green |
179 | 181 | end |
180 | 182 | axes.title = "A line graph." |
181 | | - axes.x_ticks = { |
182 | | - 0 => "Ola Ruby", |
183 | | - 1 => "Hello Ruby" |
184 | | - } |
185 | 183 | end |
186 | 184 |
|
187 | 185 | skip "fails to match the reference image" do |
|
277 | 275 | end |
278 | 276 |
|
279 | 277 | context "#bar!" do |
280 | | - it "adds a simple bar plot", focus: true do |
| 278 | + it "adds a simple bar plot" do |
281 | 279 | @figure = Rubyplot::Figure.new |
282 | 280 | axes = @figure.add_subplot 0,0 |
283 | 281 | axes.bar!(600) do |p| |
|
323 | 321 | axes.title = "Plot with X-Y axes." |
324 | 322 | axes.x_title = "Score (%)" |
325 | 323 | axes.y_title = "Students" |
326 | | - axes.x_ticks = { |
327 | | - 0 => '5/6', |
328 | | - 1 => '5/15', |
329 | | - 2 => '5/24', |
330 | | - 3 => '5/36' |
331 | | - } |
| 324 | + axes.x_ticks = [ '5/6', '5/15', '5/24', '5/36' ] |
332 | 325 | end |
333 | 326 |
|
334 | | - it "adds multiple bar plots for wide graph", focus: true do |
| 327 | + it "adds multiple bar plots for wide graph" do |
335 | 328 | @figure = Rubyplot::Figure.new(height: 400, width: 800) |
336 | 329 | axes = @figure.add_subplot 0,0 |
337 | 330 | @planet_data.each do |name, nums| |
|
342 | 335 | end |
343 | 336 | end |
344 | 337 |
|
345 | | - skip "plots both positive and negative values" do |
| 338 | + it "plots both positive and negative values" do |
346 | 339 | @figure = Rubyplot::Figure.new |
347 | 340 | axes = @figure.add_subplot 0,0 |
348 | 341 | axes.bar! do |p| |
|
362 | 355 | } |
363 | 356 | end |
364 | 357 |
|
365 | | - skip "tests negative values" do |
| 358 | + it "tests negative values" do |
366 | 359 | @figure = Rubyplot::Figure.new |
367 | 360 | axes = @figure.add_subplot 0,0 |
368 | 361 | axes.title = "all negative bar graph." |
|
0 commit comments