Expand description
Draw charts with plotters
during unit-testing.
Modules§
- full_
palette - A full color palette derived from the
Material Design 2014 Color Palette.
Colors are chosen to go well with each other, and each color is available in several tints,
ranging from 50 (very light) to 900 (very dark). A tint of 500 is considered “standard”. Color’s whose tint starts
with an ‘A’ (for example
RED_A400
) are accent colors and are more saturated than their standard counterparts.
Structs§
- Area
Series - An area series is similar to a line series but uses a filled polygon. It takes an iterator of data points in guest coordinate system and creates appropriate lines and points with the given style.
- BitMap
Backend - The backend that drawing a bitmap
- BitMap
Element - The element that contains a bitmap on it
- Black
White - Simple chromatic colormap from black to white.
- Bone
- Dark colormap going from black over blue to white.
- Boxplot
- The boxplot element
- Candle
Stick - The candlestick data point element
- Cartesian2d
- A 2D Cartesian coordinate system described by two 1D ranged coordinate specs.
- Chart
Builder - The helper object to create a chart context, which is used for the high-level figure drawing.
- Chart
Context - The context of the chart. This is the core object of Plotters.
- Circle
- A circle element
- Copper
- Friendly black to brown colormap.
- Cross
- A cross marker for visualizing data series.
- Cubiod
- Represents a cuboid, a six-faced solid.
- Dashed
Line Series - A dashed line series, map an iterable object to the dashed line element. Can be used to draw simple dashed and dotted lines.
- Derived
Color Map - This struct is used to dynamically construct colormaps by giving it a slice of colors. It can then be used when being intantiated, but not with associated functions.
- Dotted
Line Series - A dotted line series, map an iterable object to the dotted line element.
- Drawing
Area - The abstraction of a drawing area. Plotters uses drawing area as the fundamental abstraction for the high level drawing API. The major functionality provided by the drawing area is
- Dummy
Backend Error - This is the dummy backend placeholder for the backend that never fails
- DynElement
- The container for a dynamically dispatched element
- Empty
Element - An empty composable element. This is the starting point of a composed element.
- Error
Bar - An error bar, which visualizes the minimum, average, and maximum of a dataset.
- Font
Desc - Describes a font
- GroupBy
- Grouping the value in the coordinate specification.
- HSLColor
- The color described by HSL color space
- Histogram
- Presents data in a histogram. Input data can be raw or aggregated.
- Line
Series - The line series object, which takes an iterator of data points in guest coordinate system and creates appropriate lines and points with the given style.
- Linspace
- The coordinate combinator that transform a continuous coordinate to a discrete coordinate to a discrete coordinate by a giving step.
- LogCoord
- A log scaled coordinate axis
- LogRange
Deprecated - The logarithmic coordinate decorator. This decorator is used to make the axis rendered as logarithmically.
- MandelbrotHSL
- Colormap created to replace the one used in the mandelbrot example.
- Multi
Line Text - An multi-line text element. The
Text
element allows only single line text and theMultiLineText
supports drawing multiple lines - Nested
Range - A nested coordinate spec which is a discrete coordinate on the top level and for each value in discrete value, there is a secondary coordinate system. And the value is defined as a tuple of primary coordinate value and secondary coordinate value
- Palette99
- The palette of 99% accessibility
- Palette100
- The palette of 100% accessibility
- Palette9999
- The palette of 99.99% accessibility
- Palette
Color - A color in the given palette
- Path
Element - An element of a series of connected lines
- Pie
- A Pie Graph
- Pixel
- An element representing a single pixel.
- Point
Series - The point plot object, which takes an iterator of points in guest coordinate system and create an element for each point
- Polygon
- An element of a filled polygon
- Quartiles
- The quartiles
- RGBA
Color - The RGBA representation of the color, Plotters use RGBA as the internal representation of color
- RGBColor
- The color described by its RGB value
- Ranged
Date - The ranged coordinate for date
- Ranged
Date Time - The ranged coordinate for the date and time
- Ranged
Duration - The coordinate that for duration of time
- Rect
- The representation of the rectangle in backend canvas
- Rectangle
- A rectangle element
- SVGBackend
- The SVG image drawing backend
- Shape
Style - Style for any shape
- Surface
Series - Represents functions of two variables.
- Text
- A single line text element. This can be owned or borrowed string, dependents on
String
orstr
moved into. - Text
Style - Style of a text
- Triangle
Marker - A triangle marker for visualizing data series.
- ViridisRGB
- A colormap optimized for visually impaired people (RGB Format). It is currently the default colormap also used by matplotlib. Read more in this paper
- ViridisRGBA
- A colormap optimized for visually impaired people (RGBA format). It is currently the default colormap also used by matplotlib. Read more in this paper
- VulcanoHSL
- A vulcanic colormap that display red/orange and black colors
Enums§
- Drawing
Area Error Kind - The error description of any drawing area API
- Font
Family - Describes font family. This can be either a specific font family name, such as “arial”, or a general font family class, such as “serif” and “sans-serif”
- Font
Style - Describes the font style. Such as Italic, Oblique, etc.
- Font
Transform - Specifying text transformations
- Label
Area Position - Specifies one of the four label positions around the figure.
- Nested
Value - Describe a value for a nested coordinate
- Segment
Value - The value that used by the segmented coordinate.
- Series
Label Position - Useful to specify the position of the series label.
Constants§
- BLACK
- Black (■ rgb = (0, 0, 0))
- BLUE
- Blue (■ rgb = (0, 0, 255))
- CYAN
- Cyan (■ rgb = (0, 255, 255))
- GREEN
- Green (■ rgb = (0, 255, 0))
- MAGENTA
- Magenta (■ rgb = (255, 0, 255))
- RED
- Red (■ rgb = (255, 0, 0))
- TRANSPARENT
- Transparent (■ rgba = (0, 0, 0, 0.0))
- WHITE
- White (■ rgb = (255, 255, 255))
- YELLOW
- Yellow (■ rgb = (255, 255, 0))
Traits§
- AsRelative
- Allows a value turns into a relative size
- Bind
KeyPoint Method - Bind an existing coordinate spec with a given key points algorithm. See WithKeyPointMethod for more details.
- Bind
KeyPoints - Bind a existing coordinate spec with a given key points vector. See WithKeyPoints for more details.
- Build
Nested Coord - Used to build a nested coordinate system.
- Color
- Any color representation
- Color
Map - Converts scalar values to colors.
- Coord
Translate - The trait that translates some customized object to the backend coordinate
- Discrete
Ranged - The trait indicates the coordinate is discrete This means we can bidirectionally map the range value to 0 to N in which N is the number of distinct values of the range.
- Drawing
Backend - The drawing backend trait, which implements the low-level drawing APIs.
This trait has a set of default implementation. And the minimal requirement of
implementing a drawing backend is implementing the
draw_pixel
function. - Into
Drawing Area - A type which can be converted into a root drawing area
- Into
DynElement - The trait that makes the conversion from the statically dispatched element to the dynamically dispatched element
- Into
Font - The trait that allows some type turns into a font description
- Into
Linspace - Makes a linspace coordinate from the ranged coordinates.
- Into
LogRange - Convert a range to a log scale coordinate spec
- Into
Monthly - The trait that converts a normal date coord into a monthly one
- Into
Partial Axis - The trait for the types that can be converted into a partial axis
- Into
Segmented Coord - The trait for types that can decorated by SegmentedCoord decorator.
- Into
Text Style - Trait for values that can be converted into
TextStyle
values - Into
Yearly - The trait that converts a normal date coord into a yearly one
- LogScalable
- The trait for the type that is able to be presented in the log scale. This trait is primarily used by LogRangeExt.
- Palette
- Represents a color palette
- Ranged
- The trait that indicates we have a ordered and ranged value Which is used to describe any 1D axis.
- ToGroup
ByRange - The trait that provides method
Self::group_by
function which creates aGroupBy
decorated ranged value.
Functions§
- draw_
multi_ vec_ charts - Draw multiple vectors as line charts.
- draw_
vec_ chart - Draw a
Vec<f32>
as a line chart underfilename
. - generate_
frequency_ response_ plot - Generates a frequency response plot for a given audio processor
- make_
partial_ axis - Make a partial axis based on the percentage of visible portion.
We can use
into_partial_axis
to create a partial axis range specification. But sometimes, we want to directly specify the percentage visible to the user.
Type Aliases§
- Draw
Result - The type used to returns a drawing operation that can be failed
- Path
Deprecated - This is a deprecated type. Please use new name
PathElement
instead.