Skip to content

Commit

Permalink
doc: plot coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Feb 9, 2024
1 parent 81cb0cd commit a0434e3
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bsplines"
license = "Apache-2.0"
version = "0.0.1-alpha.8"
version = "0.0.1-alpha.9"
authors = [
"Michael A. Heuer <decentralised.systems@gmail.com>",
]
Expand Down
2 changes: 1 addition & 1 deletion doc-images/plots/generation/fit-loose-all.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/generation/fit-loose-half-penalized.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/generation/fit-loose-half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/generation/interpolation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/generation/manual.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/generation/points.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/insert-after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/insert-before.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/merge-after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/merge-before.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/reverse-after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/reverse-before.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/split-after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/plots/manipulation/split-before.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc-images/src/visualization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn generate_2d_plot(filename: &str, splines: Vec<(&Curve, RGBAColor)>, limit
let mut path = String::from(PLOTS_DIR);
path.push_str(filename);
let area = SVGBackend::new(&path, IMG_SIZE).into_drawing_area();
area.fill(&RGBAColor(255, 255, 255, 0.85)).unwrap();
area.fill(&RGBAColor(255, 255, 255, 0.81)).unwrap(); // Matches the font color in docs.rs dark mode

let mut chart_builder = ChartBuilder::on(&area);
chart_builder.margin(10).set_left_and_bottom_label_area_size(20);
Expand Down
13 changes: 6 additions & 7 deletions src/curve/generation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ doc = ::embed_doc_image::embed_image!("fit-loose-half-penalized", "doc-images/pl
//! - fixed start and end points
//! - unpenalized/penalized
//!
//!
//! | Raw Data | Manual Control Polygon | Interpolation |
//! |:------------------------------|:--------------------------|:--------------------------|
//! | ![][points] | ![][manual] | ![][interpolation] |
//! | Scattered, 2-dimensional data points<br>(`N = 18`).<br><br> | Curve of degree `p = 2` with `n = N-1`<br>segments and control points generated<br>directly from the data points. | Curve of degree `p = 2` and `n = N-1`<br>segments interpolating the data points.<br><br> |
//! | <br> | |
//! | Least-Squares Fit | Least-Squares Fit | Penalized Least-Squares Fit |
//! | ![][fit-loose-all] | ![][fit-loose-half] | ![][fit-loose-half-penalized] |
//! |:------------|:------------|:-------------------|
//! | ![][points] | ![][manual] | ![][interpolation] |
//! | Scattered, 2-dimensional data points<br>(`N = 18`).<br><br> | Curve of degree `p = 2` with `n = N-1`<br>segments and control points generated<br>directly from the data points. | Curve of degree `p = 2` and `n = N-1`<br>segments interpolating the data points.<br><br> |
//! | | |
//! | Least-Squares Fit ( ≈ Interpolation) | Approximating Least-Squares Fit | Penalized Least-Squares Fit |
//! | ![][fit-loose-all] | ![][fit-loose-half] | ![][fit-loose-half-penalized] |
//! | Curve of degree `p = 2` with `n = N-1`<br>segments approximating the data points.<br> | Curve of degree `p = 2` with `n= N/3`<br>segments approximating the data points.<br> | Curve of degree `p = 2` with `n= N/3`<br>segments approximating the data<br> points penalized with `λ = 1`, `κ = 2`. |

use crate::curve::{
Expand Down

0 comments on commit a0434e3

Please sign in to comment.