Commit 3c3fd09
committed
Add logarithmic plot axes
This commit is an initial implementation for adding logarithmic plotting
axis.
This very much needs more testing!
The basic idea is, that everything stays the same, but PlotTransform
does the much needed coordinate transformation for us.
That is, unfortunatley not all of the story.
* In a lot of places, we need estimates of "how many pixels does 1 plot
space unit take" and the likes, either for overdraw reduction, or
generally to size things. PlotTransform has been modifed for that for
now, so this should work.
* While the normal grid spacer renders just fine, it will also casually
try to generate 100s of thousands of lines for a bigger range log
plot. So GridInput has been made aware if there is a log axis
present. The default spacer has also been modified to work initially.
* All of the PlotBound transformations within PlotTransform need to be
aware and handle the log scaling properly. This is done and works
well, but its a bit.. icky, for lack of a better word. If someone has
a better idea how to handle this, be my guest :D
* PlotPoint generation from generator functions has to become aware of
logarithmic plotting, otherwise the resolution of the plotted points
will suffer.
Especially the spacer generation is still kinda WIP; it is messy at best
right now. Especially for zooming in, it currently only adds lines on the
lower bound due to the way the generator function works right now.
I will address this in a follow up commit/--amend (or someone else will).1 parent 6a7ff72 commit 3c3fd09
File tree
9 files changed
+493
-111
lines changed- demo/src
- egui_plot/src
- items
9 files changed
+493
-111
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
691 | 697 | | |
692 | 698 | | |
693 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
694 | 770 | | |
695 | 771 | | |
696 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
595 | | - | |
| 594 | + | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
751 | | - | |
| 750 | + | |
| 751 | + | |
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
| 892 | + | |
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
| |||
1167 | 1167 | | |
1168 | 1168 | | |
1169 | 1169 | | |
1170 | | - | |
1171 | | - | |
| 1170 | + | |
| 1171 | + | |
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
| |||
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
1325 | | - | |
| 1325 | + | |
1326 | 1326 | | |
1327 | | - | |
1328 | | - | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1329 | 1330 | | |
1330 | 1331 | | |
1331 | 1332 | | |
| |||
1514 | 1515 | | |
1515 | 1516 | | |
1516 | 1517 | | |
1517 | | - | |
| 1518 | + | |
1518 | 1519 | | |
1519 | 1520 | | |
1520 | 1521 | | |
| |||
1709 | 1710 | | |
1710 | 1711 | | |
1711 | 1712 | | |
1712 | | - | |
| 1713 | + | |
1713 | 1714 | | |
1714 | 1715 | | |
1715 | 1716 | | |
| |||
1883 | 1884 | | |
1884 | 1885 | | |
1885 | 1886 | | |
1886 | | - | |
| 1887 | + | |
1887 | 1888 | | |
1888 | 1889 | | |
1889 | 1890 | | |
| |||
2069 | 2070 | | |
2070 | 2071 | | |
2071 | 2072 | | |
2072 | | - | |
| 2073 | + | |
2073 | 2074 | | |
2074 | 2075 | | |
2075 | 2076 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
285 | 293 | | |
286 | 294 | | |
287 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
| |||
0 commit comments