plotters-rs/plotters
63.1
Adequate · 30 September 2026
19.4k
lines of production code
Rust
primary language
2
measurements over time
What this system is
This system is a Rust plotting library that provides a modular architecture for rendering 2D and 3D data visualizations. It supports multiple output backends, including bitmaps, SVGs, and interactive notebook environments, while offering a comprehensive suite of chart types such as line plots, histograms, and boxplots. The library handles complex coordinate systems, styling, and rasterization to generate static images and dynamic graphics from structured data.
Features
Add 3D coordinate system and projection support
The plotters library now includes a new 3D coordinate system module (\plotters/src/coord/ranged3d\) that enables 3D plotting capabilities. This change introduces the \Cartesian3d\ struct for managing 3D logical coordinates and a \ProjectionMatrix\ system to project 3D space onto 2D displays. Users can now define 3D ranges, configure projection parameters (yaw, pitch, scale), and translate 3D coordinates to 2D pixel positions with depth calculation, laying the groundwork for 3D visualizations within the library.
plotters/.cargo, plotters/src/coord/ranged3d · high confidence
Add comprehensive example suite for plotters
The plotters/examples directory has been populated with a wide range of demonstration programs, including 3D surface plots, animated Gaussian PDFs, Koch snowflake animations, area charts, bitmap blitting, boxplots, standard line charts, colormap visualizations, custom coordinate systems, error bars, full palette displays, histograms, Mandelbrot sets, matrix heatmaps, nested coordinates, normal distribution plots, pie charts, relative sizing, Sierpinski carpets, and time-series temperature data. These examples serve as both documentation and test cases for the library's rendering capabilities.
plotters/examples · high confidence
Add documentation template with example gallery and styling
The documentation template now includes a structured gallery page that displays visual previews of various plotting examples (such as charts, histograms, 3D plots, and console outputs) with links to their source code, alongside a symlink to the examples directory and an empty style file to support future CSS customization.
doc-template/readme · high confidence
Add mocked drawing backend for testing
The \plotters\ crate now includes a \MockedBackend\ implementation within the \backend\_impl\ module, designed specifically for unit testing. This new component allows developers to verify drawing operations (such as pixels, lines, rectangles, and text) without requiring a real display surface, by tracking call counts and validating parameters through configurable checkers. This facilitates more robust and isolated testing of plotting logic.
_plotters/src/drawing/backend\impl · high confidence
Add rustdoc gallery template and styling
The documentation template now includes a gallery view for showcasing examples. This change adds a \gallery\ HTML file that displays a grid of example plots (such as candlestick, histogram, and dual-axis charts) with links to their source code, along with a \style\ file to format the gallery layout and images.
doc-template/rustdoc · high confidence
Automated documentation generation pipeline
Added a new \doc-template\ directory containing scripts and templates to automate the generation of the project's README and Rust documentation. The pipeline uses \readme.template.md\ as a source, injecting the latest version from \latest\_version\ (currently 0.3.3) and the Minimum Supported Rust Version from \msrv.txt\ (1.56.0). It automatically generates a Table of Contents via \gen-toc.sh\ and renders the final README and updated \lib.rs\ doc comments using \render\_readme.sh\ and \update\_readme.sh\.
doc-template · high confidence
Introduce BitmapBackend for rendering charts to image files and buffers
The \plotters-bitmap\ crate is introduced, providing a \BitMapBackend\ that allows Plotters to render charts directly into bitmap images. Users can now generate static image files (such as PNG, JPG, and GIF) or render into an in-memory buffer for use cases like framebuffer manipulation or real-time GIF animation. The backend supports custom pixel formats and includes error handling for invalid buffers, IO issues, and encoding failures.
plotters-bitmap/src · high confidence
Introduction of 2D Cartesian coordinate system
The library now includes a new 2D Cartesian coordinate system (\Cartesian2d\) within the \plotters/src/coord/ranged2d\ module. This feature allows charts to be constructed using two independent 1D ranged coordinate specifications for the X and Y axes, enabling the rendering of mesh lines and accurate translation between logical data coordinates and backend pixel coordinates.
plotters/src/coord/ranged2d · high confidence
Introduction of discrete coordinate system and segmented coordinates for histograms
The \plotters\ library now supports discrete one-dimensional coordinate systems, enabling the creation of charts like histograms where axes represent distinct categories or buckets rather than continuous ranges. This change introduces the \DiscreteRanged\ trait, which allows bidirectional mapping between range values and indices, and the \SegmentedCoord\ decorator. \SegmentedCoord\ transforms a discrete coordinate by adding a dummy element and mapping values to segments, emitting center-aligned key points for proper tick and label rendering in histogram-type visualizations.
plotters/src/coord/ranged1d · high confidence
Introduction of the SVG backend for Plotters
The library now includes a new SVG backend, allowing users to render Plotters graphics into SVG vector graphs. This change introduces the \SVGBackend\ struct and the underlying implementation in \plotters-svg/src\, enabling the generation of scalable vector images alongside existing bitmap capabilities.
plotters-svg/src · high confidence
New 1D coordinate types for numeric ranges, slices, and datetime
The \plotters\ library introduces new 1D coordinate types in \plotters/src/coord/ranged1d/types\. This includes \RangedCoord\ variants for various numeric types (i32, i64, f32, f64, etc.), a \RangedSlice\ type for plotting against arbitrary slices of values, and \RangedDate\/\RangedDateTime\ types for datetime axes (behaving as a behavioral change for users enabling the \chrono\ feature). These types provide the underlying coordinate mapping logic for axes, handling key point generation, value mapping, and reversal.
plotters/src/coord/ranged1d/types · high confidence
New 2D and 3D Cartesian chart context implementations
This change introduces the core drawing logic and configuration interfaces for 2D and 3D Cartesian charts within the \plotters\ library. For 2D charts, it adds \configure\_mesh\ to manage grid lines and labels, \set\_secondary\_coord\ to enable dual-axis plots, and internal implementations for drawing axes and mesh lines. For 3D charts, it provides \configure\_axes\ for styling axes and panels, \with\_projection\ to customize the 3D view angle, and \set\_3d\_pixel\_range\ to define the coordinate space. These components form the foundation for rendering complex multi-axis and 3D visualizations.
plotters/src/chart/context · high confidence
New chart series types and line styles
The \plotters/src/series\ module now includes new series types for area charts (\AreaSeries\), histograms (\Histogram\), and 3D surfaces (\SurfaceSeries\), alongside enhanced line plotting capabilities. Users can now draw dashed and dotted lines using \DashedLineSeries\ and \DottedLineSeries\, with the latter supporting custom marker functions and shift options. The \LineSeries\ has been updated to support configurable point sizes, and the \Histogram\ series allows for vertical or horizontal orientations with customizable bar margins, baselines, and dynamic styling.
plotters/src/series · high confidence
New colormaps and full Material Design palette modules
Users can now map scalar values to colors using the new \ColorMap\ trait and \DerivedColorMap\ struct, which allow dynamic colormap creation and linear interpolation across RGB, RGBA, and HSL color types. Additionally, a comprehensive \full\_palette\ module is available (behind the \full\_palette\ feature) providing a complete set of Material Design 2014 colors with various tints and accent variants, while the \colormaps\ module (behind the \colormaps\ feature) exposes the underlying interpolation logic and macros for defining custom color scales.
plotters/src/style/colors · high confidence
New coordinate combinators for advanced axis control
This update introduces a new module of coordinate decorators in \plotters/src/coord/ranged1d/combinators\ that provide finer control over axis rendering. Users can now customize tick marks using \WithKeyPoints\ (to specify exact bold/light points) or \WithKeyPointMethod\ (to define custom algorithms for generating ticks). Additionally, \GroupBy\ allows grouping discrete values (e.g., days into weeks) for hierarchical tick display, \Linspace\ enables converting continuous ranges into discrete buckets with configurable rounding (floor, ceil, round, exact), \LogCoord\ adds support for logarithmic scales with reversible mapping, \NestedRange\ supports hierarchical axes with primary categories and secondary sub-values, and \PartialAxis\ restricts the visible portion of an axis to a specific range.
plotters/src/coord/ranged1d/combinators · high confidence
New evcxr integration with bitmap support and color conversion
The plotters crate now includes an \evcxr.rs\ module that enables rendering plots directly in Jupyter notebooks via the evcxr runner. This adds \evcxr\_figure\ for standard SVG output and, when the \evcxr\_bitmap\ feature is enabled, \evcxr\_bitmap\_figure\ which renders to a bitmap buffer and converts it to SVG for display. The module also provides \evcxr\_figure\_with\_saving\ to save the generated SVG to a local file. Additionally, the library now implements \From\<RGBColor\>\ for \RGBAColor\, allowing seamless conversion between color types.
plotters/src · high confidence
New statistical and charting elements with data processing utilities
This release introduces several new visualization components and supporting data utilities. Users can now create boxplots using the new \Boxplot\ element, which leverages the newly added \Quartiles\ struct to calculate statistical fences and medians from datasets. A \CandleStick\ element is added for financial charting, supporting distinct styles for gain and loss periods. The library also adds a \Cubiod\ element for 3D rendering, a \BitMapElement\ for embedding and manipulating bitmap images, and a \DashedPathElement\ for drawing lines with dash patterns. Additionally, a \fitting\_range\ utility is provided to automatically calculate data ranges for axis scaling, and a \FloatPrettyPrinter\ improves the formatting of floating-point numbers on axes.
plotters/src/element · high confidence
Architecture
Extracted plotters-backend into a standalone crate
The low-level drawing backend API has been moved from the main plotters crate into a separate \plotters-backend\ crate. This change enables a "plug-and-play" architecture where third-party backends can depend on this crate independently, allowing for better maintainability and support for external rendering implementations without requiring the full plotters library.
plotters-backend/src · high confidence
Plotters crate relocated to subdirectory with symlinked metadata
The plotters crate has been moved into its own subdirectory. To maintain compatibility with publishing workflows, the LICENSE and README files are now symlinks pointing to the repository root versions, ensuring they are correctly included when the crate is published.
plotters · high confidence
Behavioural changes
Fix DrawingArea::fill to cover bottom and right edges
The \DrawingArea::fill\ method now correctly fills the bottom and right edges of the drawing area, ensuring that filled regions are no longer clipped by one pixel on those sides. This behavioral change resolves a visual artifact where the filled area appeared slightly smaller than the defined rectangle.
plotters/src/drawing · high confidence
Introduction of coordinate translation traits and shift implementation
The \plotters/src/coord\ module now exposes the \CoordTranslate\ and \ReverseCoordTranslate\ traits, enabling the mapping of logical data points to backend pixel coordinates and supporting reverse translation for interactive plots. A new \Shift\ struct is added to provide simple coordinate translation via offset, implementing both forward and reverse translation logic.
plotters/src/coord · high confidence
New ab\_glyph font backend with improved error handling
The font rendering subsystem now supports the ab\_glyph library as an alternative to the existing ttf backend, enabled via the ab\_glyph feature. This new backend allows registering custom font bytes at runtime and provides proper error propagation for font loading and rendering failures, replacing previous behavior where errors were silenced or caused panics. The change also refactors the font module to cleanly separate backends (ttf, ab\_glyph, naive, web) and improves documentation for font registration.
plotters/src/style/font · high confidence
New rasterizer module for drawing primitives
The \plotters-backend/src/rasterizer\ directory now contains a new set of modules (\circle.rs\, \line.rs\, \mod.rs\, \path.rs\, \polygon.rs\, \rect.rs\) that implement the rasterization logic for drawing circles, lines, rectangles, and polygons. This change introduces the underlying algorithms for converting vector shapes into pixel data, including specific fixes for polygon vertex computation (addressing colinearity and infinity issues) and filled circle rendering, effectively moving the core drawing implementation into this dedicated backend location.
plotters-backend/src/rasterizer · high confidence
New style module with robust HSL color validation and relative sizing
The \plotters/src/style\ module introduces a comprehensive styling system, including a new \Color\ trait hierarchy (\RGBAColor\, \RGBColor\, \PaletteColor\) and \ShapeStyle\ for managing fills and strokes. A key behavioral change is the introduction of strict validation for \HSLColor\ construction via \try\_new\ and \from\_degrees\, which now return \HSLColorError\ for non-finite hues or out-of-range saturation/lightness, replacing previous implicit normalization. The module also adds \RelativeSize\ and \RelativeSizeWithBound\ types, allowing users to define sizes as percentages of parent dimensions with optional min/max pixel bounds.
plotters/src/style · high confidence
Refactored bitmap backend internals and added comprehensive rendering tests
The \plotters-bitmap\ module has been reorganized into a \bitmap\ subdirectory, introducing a new \target.rs\ file that defines internal \Target\ and \Buffer\ enums to manage drawing destinations (files, buffers, and GIFs) and a \test.rs\ file containing extensive unit tests for \BitMapBackend\. These tests verify core rendering behaviors, including basic drawing, half-fill operations, color blending, area splitting, and edge cases such as out-of-range lines and rectangles that exclude bottom/right edges, ensuring the backend correctly handles buffer memory and clipping.
plotters-bitmap/src/bitmap · high confidence
Refactored bitmap pixel backend to use modular pixel format traits
The bitmap rendering backend has been restructured to support distinct pixel formats (RGB and BGRX) via a new \PixelFormat\ trait. This change introduces separate modules for \rgb.rs\ and \bgrx.rs\, allowing the backend to handle different memory layouts (3-byte RGB vs 4-byte BGRX) and endianness correctly. The refactoring also includes fixes for unaligned memory reads and writes in the fast blending and filling algorithms, ensuring stable performance and correctness across different CPU architectures.
_plotters-bitmap/src/bitmap\pixel · high confidence
Refactored charting API with new builder and context abstractions
The charting module has been restructured to use a new \ChartBuilder\ for constructing chart contexts and a \ChartContext\ for drawing, replacing the previous direct API. This change introduces \ChartState\ and \DualCoordChartState\ to support incremental rendering by allowing chart configurations to be saved and restored without redrawing static elements like axes and labels. Additionally, \DualCoordChartContext\ now explicitly manages primary and secondary coordinate systems, providing dedicated methods like \configure\_secondary\_axes\ and \draw\_secondary\_series\ for dual-axis charts, while \MeshStyle\ and \SecondaryMeshStyle\ handle axis and grid configuration.
plotters/src/chart · high confidence
Updated documentation examples to use new font API and explicit rendering
The examples in the doc-template directory have been updated to reflect recent API changes. All text elements now use the \.into\_font()\ method for font specification, replacing previous approaches. Additionally, drawing operations now explicitly call \.present()\ on backends to ensure output is flushed, rather than relying on implicit dropping.
doc-template/examples · high confidence
Test coverage
Added benchmark for quartile calculation performance; Added benchmark suite for parallel rendering and rasterizer performance.
Dependencies
Plotters 0.3.7 workspace with updated dependencies
This release updates the Plotters Rust library to version 0.3.7, restructuring the project as a Cargo workspace containing the main \plotters\ crate alongside dedicated backend crates (\plotters-backend\, \plotters-bitmap\, \plotters-svg\). The update bumps several key dependencies, including \image\ to 0.25.9, \chrono\ to 0.4.32, \serde\ to 1.0.139, \font-kit\ to 0.14.2, and \ttf-parser\ to 0.25.1, while also raising the Minimum Supported Rust Version (MSRV) to 1.56. Users benefit from these upstream improvements and the clearer separation of backend implementations, which allows for more granular feature selection (e.g., enabling only \bitmap\_backend\ or \svg\_backend\) and better support for WebAssembly targets via updated \wasm-bindgen\ and \web-sys\ integration.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 68 → 63 (-4.5)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 90 → 90 (+0.0)
- Architecture 100 → 96 (-4.3)
- Maturity 55 → 54 (-0.4)
- Readiness 89 → 64 (-24.2)
- Security 65 → 65 (+0.0)
- Performance 85 (new)
Resolved (2)
- Most significant orphaned file (plotters-bitmap/src/bitmap/test.rs)
- Off-boarding risk: anonymized user #1
New (9)
- Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
- Duplicate method signatures across Cartesian2d and DrawingArea. Both types expose 'get_x_range', 'get_y_range', 'get_x_axis_pixel_range', and 'get_y_axis_pixel_range'. This suggests that DrawingArea might be wrapping or delegating to a coordinate system that already provides these, or that the API is exposing redundant accessors. If DrawingArea is a higher-level abstraction, it should not necessarily expose the same low-level range getters as the coordinate spec itself, or they should be unified under a single trait.
- Inconsistent naming for accessing the coordinate specification. 'into_coord_spec' implies consuming the DrawingArea (ownership transfer), while 'as_coord_spec' implies borrowing. However, having both 'as_coord_spec' and 'as_coord_spec_mut' is standard, but 'into' vs 'as' is the key distinction. The inconsistency lies in the fact that 'ChartContext' has 'as_coord_spec' but no 'into_coord_spec' equivalent in the same way, or rather, the DrawingArea exposes both consume and borrow versions, while the Context only exposes borrow. This is a minor API design inconsistency across types.
- Inconsistent naming for state restoration. The method is named 'restore' in the base ChartState but typically 'restore' implies bringing a state into a context or vice versa. However, the more critical inconsistency is between 'restore' and the other conversion methods.
- Most significant orphaned file (plotters-svg/src/svg.rs)
- Off-boarding risk: anonymized user #1
- Redundant methods in MeshStyle and SecondaryMeshStyle. 'set_all_tick_mark_size' is a convenience wrapper for 'set_tick_mark_size' with a specific position or a global flag. While convenience methods are acceptable, having both 'set_all' and specific 'set' methods can be confusing. However, the more glaring issue is the duplication of intent between 'disable_x_mesh', 'disable_y_mesh', 'disable_mesh', 'disable_x_axis', 'disable_y_axis', 'disable_axes'.
- Split plotters
- Three different methods perform the same logical operation (converting a ChartContext to a ChartState) with different names: 'into_chart_state', 'into_shared_chart_state', and 'to_chart_state'. This creates confusion about which one to use and why they are distinct, especially since they return the same type (or a variant thereof) without clear semantic differentiation in the signature.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
plotters-rs/plotters was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c63248e0cf7c611185361ac492003e8a87d52ea8 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.