Ezel
  • Ezel
  • Basics
    • 1. Getting Started
    • 2. Concepts
      • Axis
    • 3. Attributes
    • 4. Cloud
  • Optimization
    • Style Customization
    • Data Lifetime
  • Grammar of Graphics
    • What is GoG
    • Interface
  • plot
    • PlainBox
    • Cartesian2
      • Basics
      • Geometry
    • Cartesian3
    • Text
    • NodeGraph
    • Grid
  • Git Repository
  • crates.io
  • docs.rs
  • pypi
  • Dev
    • Rendering
  • Coordinates
Powered by GitBook
On this page
  1. Optimization

Style Customization

When plotting, ezel uses a lot of aesthetic parameters.

Even rendering a simple scatter plot requires

  • marker size

  • marker shape

  • marker color

  • background color

  • x axis label size

  • x axis label text

  • x axis label color

  • ..

For a minimal API, they are all optional and structured into MarkerOpts, AxisOpts, etc.

struct Cartesian2 {
    marker_opts: Option<MarkerOpts>,
}

let mut plot = ezel::Cartesian2::new();
plot.style.marker = MarkerOpts::default();
plot.style.marker.size = Some(10.0);

When unspecified, the value is provided by the theme.

Theme

A theme is a collection of default style configurations.

You can create a new theme or use one of built-in themes.

let mut theme: Theme = ezel::theme::MATPLOTLIB.clone();
theme.marker.size = Some(12.0);  // customize the matplotlib theme

[screenshot of themes]

Previous4. CloudNextData Lifetime

Last updated 3 years ago