pub struct Figure {
pub width: f64,
pub height: f64,
pub dpi: f64,
pub background_color: Color,
pub subplots: Vec<Axes>,
pub tight_layout: bool,
}Expand description
Represents a figure that can contain multiple subplots
Fields§
§width: f64§height: f64§dpi: f64§background_color: Color§subplots: Vec<Axes>§tight_layout: boolImplementations§
Source§impl Figure
impl Figure
Sourcepub fn with_size(width: f64, height: f64) -> Self
pub fn with_size(width: f64, height: f64) -> Self
Create a new figure with specified dimensions
Sourcepub fn set_facecolor(&mut self, color: Color) -> &mut Self
pub fn set_facecolor(&mut self, color: Color) -> &mut Self
Set the background color
Sourcepub fn add_subplot(&mut self) -> &mut Axes
pub fn add_subplot(&mut self) -> &mut Axes
Add a subplot and return a mutable reference to it
Sourcepub fn add_dot_subplot(
&mut self,
dot_content: &str,
) -> Result<&mut Axes, String>
pub fn add_dot_subplot( &mut self, dot_content: &str, ) -> Result<&mut Axes, String>
Add a subplot with DOT graph content
Sourcepub fn add_dot_subplot_with_layout(
&mut self,
dot_content: &str,
layout: LayoutAlgorithm,
) -> Result<&mut Axes, String>
pub fn add_dot_subplot_with_layout( &mut self, dot_content: &str, layout: LayoutAlgorithm, ) -> Result<&mut Axes, String>
Add a DOT subplot with specified layout algorithm
Sourcepub fn subplot(&mut self, index: usize) -> Option<&mut Axes>
pub fn subplot(&mut self, index: usize) -> Option<&mut Axes>
Get a mutable reference to a subplot by index
Sourcepub fn tight_layout(&mut self, enable: bool) -> &mut Self
pub fn tight_layout(&mut self, enable: bool) -> &mut Self
Set tight layout
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Figure
impl RefUnwindSafe for Figure
impl Send for Figure
impl Sync for Figure
impl Unpin for Figure
impl UnwindSafe for Figure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more