From e2d8e8d5a536d0858424adfda09227e36bb69f42 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Mon, 5 Apr 2021 10:43:32 -0700 Subject: Upgrade rust/crates/plotters to 0.3.0 Test: make Change-Id: I3fa8ba846f19af1d8e8b6988fb7312ecbdbca9cc --- examples/slc-temp.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/slc-temp.rs') diff --git a/examples/slc-temp.rs b/examples/slc-temp.rs index 7a1b509..c38f169 100644 --- a/examples/slc-temp.rs +++ b/examples/slc-temp.rs @@ -1,7 +1,6 @@ -use plotters::coord::IntoMonthly; use plotters::prelude::*; -use chrono::{Datelike, TimeZone, Utc}; +use chrono::{TimeZone, Utc}; use std::error::Error; @@ -20,7 +19,7 @@ fn main() -> Result<(), Box> { .set_label_area_size(LabelAreaPosition::Left, 60) .set_label_area_size(LabelAreaPosition::Right, 60) .set_label_area_size(LabelAreaPosition::Bottom, 40) - .build_ranged( + .build_cartesian_2d( (Utc.ymd(2010, 1, 1)..Utc.ymd(2018, 12, 1)).monthly(), 14.0..104.0, )? @@ -34,7 +33,6 @@ fn main() -> Result<(), Box> { .disable_x_mesh() .disable_y_mesh() .x_labels(30) - .x_label_formatter(&|d| format!("{}-{}", d.year(), d.month())) .y_desc("Average Temp (F)") .draw()?; chart @@ -165,3 +163,7 @@ const DATA: [(i32, u32, f64); 12 * 9] = [ (2018, 11, 39.7), (2018, 12, 33.6), ]; +#[test] +fn entry_point() { + main().unwrap() +} -- cgit v1.2.3