1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Draw axis labels and ticks outside of plotting window (#2284)

* Always draw axis labels at plot borders

* Revert "Always draw axis labels at plot borders"

This reverts commit 9235e6603366d3b8a8189e2a5fc28c9780b7f54f.

* Add axis labels for plots

* First Draft of axis labels outside of plotting window

* plot: Tick placement of opposite axes and digit constraints

* plot: Axis label API

* plot: Update demo lib

* plot: resolve clippy warning

* Update changelog

* Remove default axis

* Fix clippy

* plot: Remove unused comments

* plot-axis: Rebase label opacity calculation on master

* plot: Resolve check.sh warnings

* plot-axis: Use 'into impl<WidgetText>' as axis label formatter

* plot-axis: Expose more conveniece functions to public API. Add axis labels to demo app

* plot-axes: Resolve ./scripts/check.sh warnings

* typo in comment

* Use `TAU` instead of the legacy `PI`

* Simpler generic syntax

* Use `Arc` to avoid some expensive clones

* Use `Margin` instead of a,b,c,d

* Add some vertical spacing

* De-duplicate color_from_contrast

* better naming

* Fix typos

* cnt -> num

* Axis are present by default, with empty names

* Add HPlacement and VPlacement

* Don't catch clicks and drags on axes

* Remove generics to minimize monomorphization code bloat

* Create helper function

* Remove changelog entry

* Simplify more

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
JohannesProgrammiert
2023-08-14 17:51:17 +02:00
committed by GitHub
parent a3ae81cadb
commit dbe55ba46a
7 changed files with 807 additions and 202 deletions

View File

@@ -271,6 +271,7 @@ fn example_plot(ui: &mut egui::Ui) -> egui::Response {
let line = Line::new(line_points);
egui::plot::Plot::new("example_plot")
.height(32.0)
.show_axes(false)
.data_aspect(1.0)
.show(ui, |plot_ui| plot_ui.line(line))
.response