Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ noto-sans = ["plotive-text/noto-sans"]
noto-sans-italic = ["plotive-text/noto-sans-italic"]
noto-serif = ["plotive-text/noto-serif"]
noto-serif-italic = ["plotive-text/noto-serif-italic"]
serde = ["plotive-base/serde", "dep:serde", "dep:serde-value"]
serde = ["plotive-base/serde", "plotive-text/serde", "dep:serde", "dep:serde-value"]
time = []
utils = []

Expand Down Expand Up @@ -114,7 +114,7 @@ members = ["base", "dsl", "iced", "pxl", "svg", "text", "tests"]
resolver = "3"

[workspace.package]
version = "0.5.0"
version = "0.6.0-dev"
authors = ["Rémi THEBAULT"]
description = "Simple data plotting library"
edition = "2024"
Expand All @@ -124,12 +124,12 @@ categories = ["science", "graphics"]
keywords = ["data", "visualization", "plotting"]

[workspace.dependencies]
plotive = { version = "0.5.0", path = "." }
plotive-base = { version = "0.5.0", path = "base" }
plotive-dsl = { version = "0.5.0", path = "dsl" }
plotive-pxl = { version = "0.5.0", path = "pxl" }
plotive-svg = { version = "0.5.0", path = "svg" }
plotive-text = { version = "0.5.0", path = "text" }
plotive = { version = "0.6.0-dev", path = "." }
plotive-base = { version = "0.6.0-dev", path = "base" }
plotive-dsl = { version = "0.6.0-dev", path = "dsl" }
plotive-pxl = { version = "0.6.0-dev", path = "pxl" }
plotive-svg = { version = "0.6.0-dev", path = "svg" }
plotive-text = { version = "0.6.0-dev", path = "text" }
arboard = "3.6.1"
bytes = "1.6"
iced = { version = "0.14.0", features = [
Expand Down
12 changes: 6 additions & 6 deletions examples/bode_rlc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::f64::consts::PI;

use plotive::{data, des, style, text, utils};
use plotive::{data, des, style, utils};

mod common;

Expand Down Expand Up @@ -52,11 +52,11 @@ fn main() {
(100.0, "mag3", "phase3", "R = 100 Ω"),
];

let title = text::parse_rich_text::<style::theme::Color>(concat!(
// [&str; 1] converts to Text::Rich
let title = [concat!(
"Bode diagram of RLC circuit\n",
"[size=18;italic;font=serif]L = 0.1 mH / C = 1 µF[/size;italic;font]"
))
.unwrap();
)];

// magnitude X axis scale is taken from the phase X axis
// the reference uses the title given to the phase X axis
Expand Down Expand Up @@ -118,11 +118,11 @@ fn main() {
let slope_line = des::annot::Line::two_points(cutoff, 0.0, 100.0 * cutoff, mag_2_decades)
.with_pattern(style::Dash::default().into());
let cut_off_label =
des::annot::Label::new(format!("{:.2} kHz", cutoff / 1000.0), cutoff, -60.0)
des::annot::Label::new(format!("{:.2} kHz", cutoff / 1000.0).into(), cutoff, -60.0)
.with_anchor(des::annot::Anchor::BottomLeft)
.with_angle(90.0);
let slope_label = des::annot::Label::new(
format!("{:.0} dB/decade", mag_2_decades / 2.0),
format!("{:.0} dB/decade", mag_2_decades / 2.0).into(),
cutoff * 10.0,
mag_2_decades / 2.0,
)
Expand Down
6 changes: 2 additions & 4 deletions examples/gauss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ fn main() {
let normal = Normal::new(MU, SIGMA).unwrap();
let pop = (0..N_POP).map(|_| normal.sample(&mut rng)).collect();

let title: des::figure::Title =
format!("Normal distribution (\u{03bc}={}, \u{03c3}={})", MU, SIGMA).into();

let title = format!("Normal distribution (\u{03bc}={}, \u{03c3}={})", MU, SIGMA);
let ticks = vec![5.0, 9.0, 11.0, 13.0, 15.0, 17.0, 21.0];

let x_axis = des::Axis::new()
Expand Down Expand Up @@ -66,7 +64,7 @@ fn main() {
.with_y_axis(y_axis)
.with_legend(des::plot::LegendPos::OutRight.into());

let fig = des::Figure::new(plot.into()).with_title(title);
let fig = des::Figure::new(plot.into()).with_title(title.into());

let data_source = data::TableSource::new().with_f64_column("pop".into(), pop);

Expand Down
4 changes: 2 additions & 2 deletions examples/iris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn main() {
&virginica_petal_length as &dyn data::Column,
);

let title: des::figure::Title = "Iris dataset".into();
let title = "Iris dataset";

let x_axis = des::Axis::new()
.with_title("Sepal Length [cm]".into())
Expand Down Expand Up @@ -133,7 +133,7 @@ fn main() {
.with_y_axis(y_axis)
.with_legend(des::plot::LegendPos::InBottomRight.into());

let fig = des::Figure::new(plot.into()).with_title(title);
let fig = des::Figure::new(plot.into()).with_title(title.into());

common::save_figure(&fig, &source, None, "iris");
}
Loading
Loading