using a bottom up layout, plots just go to the top left corner, and overlap each other if there is more than one. i tried getting the height of the response rect from the first plot, then manually adding space, but the second plot goes above the first, off the screen. here is that code:
egui::CentralPanel::default().show(ctx, |ui| {
ui.with_layout(egui::Layout::bottom_up(egui::Align::Center), |ui| {
let red = hex("#ff0019");
let accent = hex("#ff7700");
let accent_xl = hex("#ffa600");
ui.style_mut().visuals.override_text_color = Some(red);
let height = Plot::new("a")
.view_aspect(1.75)
.width(ui.available_width() * 0.5)
.allow_scroll(false)
.allow_zoom(false)
.allow_drag(false)
.allow_axis_zoom_drag(false)
.show(ui, |plot_ui| {
plot_ui.line(
Line::new(
"a",
PlotPoints::from_iter(...),
)
.color(accent),
);
})
.response
.rect
.height();
ui.add_space(height);
let height = Plot::new("temp")
.view_aspect(1.75)
.width(ui.available_width() * 0.5)
.allow_scroll(false)
.allow_zoom(false)
.allow_drag(false)
.allow_axis_zoom_drag(false)
.show(ui, |plot_ui| {
plot_ui.line(
Line::new(
"temp",
PlotPoints::from_iter(...),
)
.color(accent),
);
})
.response
.rect
.height();
ui.add_space(height);
})
});
using a bottom up layout, plots just go to the top left corner, and overlap each other if there is more than one. i tried getting the height of the response rect from the first plot, then manually adding space, but the second plot goes above the first, off the screen. here is that code: