-
The plot interface doesn´t behave like any other widget. So it looks that I cannot use ui.put(rect,widget). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can use |
Beta Was this translation helpful? Give feedback.
-
Works as expected. Thanks a lot ! @emilk let line = egui_plot::Line::new(line_points);
let pl = egui_plot::Plot::new("example_plot")
.height(rect.height())
.width(rect.width())
.show_axes(true)
.show_grid(true)
.data_aspect(1.0);
let layout = Layout::top_down(Align::LEFT);
info!("Plot {} : {:?}", self.label, self.rect);
let mut child_ui = ui.child_ui(self.rect, layout);
let _r = pl.show(&mut child_ui, |plot_ui| {
plot_ui.line(line);
})
.response; |
Beta Was this translation helpful? Give feedback.
You can use
ui.child_ui
to positions aUi
anywhere you want, and then put the plot in that new ui