MCPcopy Create free account
hub / github.com/emilk/egui_plot / show_plot

Method show_plot

examples/lines/src/app.rs:160–190  ·  view source on GitHub ↗
(&mut self, ui: &mut egui::Ui)

Source from the content-addressed store, hash-verified

158 }
159
160 pub fn show_plot(&mut self, ui: &mut egui::Ui) -> Response {
161 if self.animate {
162 ui.request_repaint();
163 self.time += ui.input(|i| i.unstable_dt).at_most(1.0 / 30.0) as f64;
164 }
165 let mut plot = Plot::new("lines_demo")
166 .legend(Legend::default().title("Lines"))
167 .show_axes(self.show_axes)
168 .show_grid(self.show_grid)
169 .show_crosshair(self.show_crosshair)
170 .invert_x(self.invert_x)
171 .invert_y(self.invert_y);
172 if self.square {
173 plot = plot.view_aspect(1.0);
174 }
175 if self.proportional {
176 plot = plot.data_aspect(1.0);
177 }
178 if self.coordinates {
179 plot = plot.coordinates_formatter(Corner::LeftBottom, CoordinatesFormatter::default());
180 }
181 if self.show_labels {
182 plot = plot.label_formatter(default_label_formatter);
183 }
184 plot.show(ui, |plot_ui| {
185 plot_ui.line(self.circle());
186 plot_ui.line(self.sin());
187 plot_ui.line(self.thingy());
188 })
189 .response
190 }
191}

Callers 1

show_uiMethod · 0.45

Calls 15

invert_yMethod · 0.80
invert_xMethod · 0.80
show_crosshairMethod · 0.80
show_gridMethod · 0.80
show_axesMethod · 0.80
legendMethod · 0.80
view_aspectMethod · 0.80
data_aspectMethod · 0.80
coordinates_formatterMethod · 0.80
label_formatterMethod · 0.80
showMethod · 0.80
lineMethod · 0.80

Tested by

no test coverage detected