-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Adding NaN values to a PlotPoints disconnects the line plot, and drops nearby points (not sure of the exact behavior of which points are dropped).
I didn't find any description of what the expected behaviour is when you attempt to plot NaN.
To Reproduce
Steps to reproduce the behavior:
- Clone the minimal example: https://github.com/CramBL/egui-nan-example
cargo run
Or create an eframe project and copy this into eframe::update
egui::CentralPanel::default().show(ctx, |ui| {
let values = [1.0, 2.0, 3.0, f64::NAN, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
let points: PlotPoints = values
.iter()
.enumerate()
.map(|(i, &y)| [i as f64, y])
.collect();
Plot::new("line_plot").show(ui, |plot_ui| {
plot_ui.line(Line::new("series", points));
});
});Expected behavior
Not sure, maybe to drop the NaN point and still connect the other lines?
Screenshots

Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working