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

add macros that turn unit from cm/mm/in to px #5066

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

kaimacuser
Copy link

Description

It can be useful to be able to define the size of plots in other units.
Therefor these macros convert the tuple of size in px before the size tuple is evaluated by the function.

Attribution

Things to consider

It shouldn't affect anything since the macros are executed before the tuple is transferred to the plot function.

  • Does it work on log scales?
  • Does it work in layouts?
  • Does it work in recipes?
  • Does it work with multiple series in one call?
  • PR includes or updates tests?
  • PR includes or updates documentation?

Considerations

I have seen that other values like left_margin are implemented by the Measure package.
To apply this method to the plot size the changes would have more impact, because the pixels unit needs to be recalculated for the selected DPI value after receipt.

Syntax correction

fixing unknown variable ..Commons

macro syntax

correct unit calculation

final changes

Readd inch2px
@BeastyBlacksmith
Copy link
Member

Why do these need to be macros and what benefit do they have over the converter functions we already have further down in the code?

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

Successfully merging this pull request may close these issues.

2 participants