[−][src]Struct implot::Plot
Struct to represent an ImPlot. This is the main construct used to contain all kinds of plots in ImPlot.
Plot
is to be used (within an imgui window) with the following pattern:
let plotting_context = implot::Context::create(); let plot_ui = plotting_context.get_plot_ui(); implot::Plot::new("my title") .size(300.0, 200.0) // other things such as .x_label("some_label") can be added too .build(&plot_ui, || { // Do things such as plotting lines });
(If you are coming from the C++ implementation or the C bindings: build() calls both begin() and end() internally)
Implementations
impl Plot
[src]
pub fn new(title: &str) -> Self
[src]
Create a new plot with some defaults set. Does not draw anything yet.
pub fn size(self, size_x: f32, size_y: f32) -> Self
[src]
Sets the plot size, given as [size_x, size_y]. Units are the same as what imgui uses. TODO(4b4) ... which is? I'm not sure it's pixels
pub fn x_label(self, label: &str) -> Self
[src]
Set the x label of the plot
pub fn y_label(self, label: &str) -> Self
[src]
Set the y label of the plot
pub fn x_limits(self, limits: &ImPlotRange, condition: Condition) -> Self
[src]
Set the x limits of the plot
pub fn y_limits(self, limits: &ImPlotRange, condition: Condition) -> Self
[src]
Set the y limits of the plot
pub fn x_ticks(self, ticks: &Vec<f64>, show_default: bool) -> Self
[src]
Set X ticks without labels for the plot. The vector contains one label each in
the form of a tuple (label_position, label_string)
. The show_default
setting
determines whether the default ticks are also shown.
pub fn y_ticks(self, ticks: &Vec<f64>, show_default: bool) -> Self
[src]
Set X ticks without labels for the plot. The vector contains one label each in
the form of a tuple (label_position, label_string)
. The show_default
setting
determines whether the default ticks are also shown.
pub fn x_ticks_with_labels(
self,
tick_labels: &Vec<(f64, String)>,
show_default: bool
) -> Self
[src]
self,
tick_labels: &Vec<(f64, String)>,
show_default: bool
) -> Self
Set X ticks with labels for the plot. The vector contains one position and label
each in the form of a tuple (label_position, label_string)
. The show_default
setting determines whether the default ticks are also shown.
pub fn y_ticks_with_labels(
self,
tick_labels: &Vec<(f64, String)>,
show_default: bool
) -> Self
[src]
self,
tick_labels: &Vec<(f64, String)>,
show_default: bool
) -> Self
Set Y ticks with labels for the plot. The vector contains one position and label
each in the form of a tuple (label_position, label_string)
. The show_default
setting determines whether the default ticks are also shown.
pub fn with_plot_flags(self, flags: &PlotFlags) -> Self
[src]
Set the plot flags, see the help for PlotFlags
for what the available flags are
pub fn with_x_axis_flags(self, flags: &AxisFlags) -> Self
[src]
Set the axis flags for the X axis in this plot
pub fn with_y_axis_flags(self, flags: &AxisFlags) -> Self
[src]
Set the axis flags for the first Y axis in this plot
pub fn with_y2_axis_flags(self, flags: &AxisFlags) -> Self
[src]
Set the axis flags for the second Y axis in this plot
pub fn with_y3_axis_flags(self, flags: &AxisFlags) -> Self
[src]
Set the axis flags for the third Y axis in this plot
pub fn begin(&self, plot_ui: &PlotUi<'_>) -> Option<PlotToken>
[src]
Attempt to show the plot. If this returns a token, the plot will actually
be drawn. In this case, use the drawing functionality to draw things on the
plot, and then call end()
on the token when done with the plot.
If none was returned, that means the plot is not rendered.
For a convenient implementation of all this, use build()
instead.
pub fn build<F: FnOnce()>(self, plot_ui: &PlotUi<'_>, f: F)
[src]
Creates a window and runs a closure to construct the contents.
Note: the closure is not called if ImPlot::BeginPlot() returned false - TODO(4bb4) figure out if this is if things are not rendered
Auto Trait Implementations
impl RefUnwindSafe for Plot
impl Send for Plot
impl Sync for Plot
impl Unpin for Plot
impl UnwindSafe for Plot
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,