Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subplot attributes documentation: px is invalid margin type #223

Open
glwagner opened this issue Nov 1, 2020 · 5 comments
Open

Subplot attributes documentation: px is invalid margin type #223

glwagner opened this issue Nov 1, 2020 · 5 comments

Comments

@glwagner
Copy link

glwagner commented Nov 1, 2020

The docs for subplot attributes suggests Measures.px as a type for the kwargs *_margin, eg:

Attribute Aliases Default Type Description
margin   1.0mm Measure (multiply by mm, px, etc) Base for individual margins... not directly used. Specifies the extra padding around subplots.

but

julia> using Measures: px
ERROR: UndefVarError: px not defined

My first thought was to submit a simple PR, but I wasn't able to find where this was written immediately since this part of docs are generated (and I hope I'm not misreading the docs!)

@BeastyBlacksmith
Copy link
Member

did you try Plots.px?

@t-bltg t-bltg closed this as completed Jul 9, 2021
@glwagner
Copy link
Author

Hm. I don't know why this issue was resolved since the docs are still confusing to me. To clarify the situation, there are "measures" that are defined in Plots rather than Measures:

julia> using Measures: px
ERROR:
UndefVarError: px not defined

julia> using Plots: px

julia> px
0.254mm

Some are defined in both:

julia> using Plots: mm

julia> mm
1.0mm

julia> using Measures: mm

julia> mm
1.0mm

mm is part of both Measures and Plots, but px only part of Plots. Note that px is not exported:

julia> using Plots

julia> px
ERROR: UndefVarError: px not defined

so users need to know to obtain px from Plots. Perhaps all "measures" are defined in Plots.jl?

@t-bltg
Copy link
Member

t-bltg commented Jul 10, 2021

Well, yes pct and px are defined in Plots only, see here and currently not exposed to the user.

Linked:

@t-bltg t-bltg reopened this Jul 10, 2021
@glwagner
Copy link
Author

If all relevant Measures for plotting are exported by Plots.jl, then a comment can be included at the top of docs for subplot attributes --- something like "Measures can be obtained from Plots; for example using Plots: px." Or something even more useful.

@t-bltg
Copy link
Member

t-bltg commented Jul 10, 2021

If it were just me, I'd integrate px and pct in either Measures.jl or Unitful.jl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants