Closed sefffal closed 9 months ago
Maybe adopt [unit] instead of (unit)? This is the notation that most papers adopt as far as I know.
Em ter., 28 de nov. de 2023 16:19, William Thompson < @.***> escreveu:
This PR address the feature request in #22 https://github.com/sefffal/PairPlots.jl/issues/22. We strip off the units for columns and display them as labels (unless user has provided labels, in which case they are ignored).
The units are displayed in dark grey and in brackets. If the user wants a different style, they can as always just pass in the labels themselves.
Supports both Unitful and DynamicQuantities, and even mixtures of both packages on different columns.
using Unitful # or DynamicQuantities df = DataFrame((;a=randn(10000)u"m",b=randn(10000)u"m/s"))pairplot(df)
image.png (view on web) https://github.com/sefffal/PairPlots.jl/assets/7330605/fc82019f-0a96-43c0-9e64-aeeee3a9f187
You can view, comment on, or merge this pull request online at:
https://github.com/sefffal/PairPlots.jl/pull/30 Commit Summary
- db8a276 https://github.com/sefffal/PairPlots.jl/pull/30/commits/db8a2765c7c1ec83d73714c9de87733de71566c2 Drop dependency on Latexify and leave this up to the user
- bc9e517 https://github.com/sefffal/PairPlots.jl/pull/30/commits/bc9e517d9363cbfebe224d81173e558dbfa99df1 Merge branch 'master' into units
- 68e264e https://github.com/sefffal/PairPlots.jl/pull/30/commits/68e264e1378be89edd556ada01620c8a5348dc2c Add support for Unitful and DynamicQuantities
File Changes
(4 files https://github.com/sefffal/PairPlots.jl/pull/30/files)
- M Project.toml https://github.com/sefffal/PairPlots.jl/pull/30/files#diff-72ed386c2a0cd1d23c0968297e70023ed98c22490d146dd89fc91f48369bad4d (6)
- A ext/PairPlotsDynamicQuantitiesExt.jl https://github.com/sefffal/PairPlots.jl/pull/30/files#diff-0ee132b1248e55152318e25ddf32e3934072aa4a5b60c9051e80dc8bd4b86c60 (27)
- A ext/PairPlotsDynamicUnitfulExt.jl https://github.com/sefffal/PairPlots.jl/pull/30/files#diff-aa716dbbc3cf930410e74ab72123e61c0299e1d8a33b67f714287a7b82984568 (29)
- M src/PairPlots.jl https://github.com/sefffal/PairPlots.jl/pull/30/files#diff-d733c29b39328ccba9e0b4c52745f7388ed6e1eebae11b6978136b4afd91c435 (92)
Patch Links:
- https://github.com/sefffal/PairPlots.jl/pull/30.patch
- https://github.com/sefffal/PairPlots.jl/pull/30.diff
— Reply to this email directly, view it on GitHub https://github.com/sefffal/PairPlots.jl/pull/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQW3NO6RCU34ZHQJ67RGTYGY2LVAVCNFSM6AAAAAA76ISONCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTKMJTHA3TEMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Appreciate the suggestion. Indeed, this NIST style guide recommends square brackets, so sure we can go with these. https://www.nist.gov/pml/special-publication-811/nist-guide-si-chapter-7-rules-and-style-conventions-expressing-values
I do worry that this is field-dependent though (I often see round brackets).
There will no doubt be issues requesting other styles in future (eg. for angular units to have a space, etc.) but I think my position will be not to allow any customization here. We already have a dead-simple way to specify the labels that is infinitely customizable.
Attention: 32 lines
in your changes are missing coverage. Please review.
Comparison is base (
8794d65
) 69.85% compared to head (7dbfe52
) 66.05%.
Files | Patch % | Lines |
---|---|---|
ext/PairPlotsDynamicQuantitiesExt.jl | 0.00% | 13 Missing :warning: |
ext/PairPlotsDynamicUnitfulExt.jl | 0.00% | 13 Missing :warning: |
src/PairPlots.jl | 84.61% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR address the feature request in #22. We strip off the units for columns and display them as labels (unless user has provided labels, in which case they are ignored).
The units are displayed in dark grey and in brackets. If the user wants a different style, they can as always just pass in the labels themselves.
Supports both Unitful and DynamicQuantities, and even mixtures of both packages on different columns.