Struct astrup::plot::Plot
[−]
[src]
pub struct Plot { /* fields omitted */ }
Plot
Determines a single plot. A plot is part of a figure, and contains a canvas where things are drawn. By default, there is some space around the canvas, to make space for labels, ticks, and tick labels.
Methods
impl Plot
[src]
fn new() -> Plot
[src]
Create and return a plot
fn set_title(self, title: &str) -> Self
[src]
Set plot title
fn set_color(self, color: Rgba) -> Self
[src]
Set plot background color. Note: This is different from the canvas background color.
fn set_color_rgb(self, red: f32, green: f32, blue: f32) -> Self
[src]
Set the plot background color. Note: This is different from the canvas background color.
fn set_color_rgba(self, red: f32, green: f32, blue: f32, alpha: f32) -> Self
[src]
Set the plot background color. Note: This is different from the canvas background color.
fn set_local_frame(self, left: f64, right: f64, bottom: f64, top: f64) -> Self
[src]
Set local plot coordinates, relative to the figure it belongs to.
A value of 0.0 is the minimum figure coordinate, and a value of 1.0 is the maximum figure coordinate.
fn set_data_range(self, x_min: f64, x_max: f64, y_min: f64, y_max: f64) -> Self
[src]
Set the data range of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn set_x_range(self, x_min: f64, x_max: f64) -> Self
[src]
Set the horisontal data range of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn set_y_range(self, y_min: f64, y_max: f64) -> Self
[src]
Set the vertical data range of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn set_x_min(self, x_min: f64) -> Self
[src]
Set the left horisontal data range end of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn set_x_max(self, x_max: f64) -> Self
[src]
Set the right horisontal data range end of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn set_y_min(self, y_min: f64) -> Self
[src]
Set the bottom vertical data range end of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn set_y_max(self, y_max: f64) -> Self
[src]
Set the top vertical data range end of the plot
Note: This is a soft suggestion, and can be overwritten before the final result for aestethics. See more here.
fn display_border(self, val: bool) -> Self
[src]
Whether or not to display a border around the plot
fn set_border_color(self, color: Rgba) -> Self
[src]
Set the color of the border around the plot
fn set_border_thickness(self, val: f64) -> Self
[src]
Set the line width of the border around the plot
fn add(self, chart: Chart) -> Self
[src]
Add a canvas to the plot
fn fit(&mut self) -> Result<(), Error>
[src]
This method is called by figure after all plots are added, and all plot adjustment is made. This happend right before the plot is drawn on the figure.
The function scales various elements within the plot, and calls a similar plot for its canvasses.
fn draw(&self, cr: &Context, fig_rel_height: f64, fig_rel_width: f64)
[src]
Do the actual drawing of the plot
Trait Implementations
impl Clone for Plot
[src]
fn clone(&self) -> Plot
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more