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

Is it neccessary that UnitfulStrings outlive the recipe? #74

Open
BeastyBlacksmith opened this issue Jun 2, 2022 · 4 comments
Open

Comments

@BeastyBlacksmith
Copy link

I am asking because the pgfplots backend does some processing on labels etc. depending on whether its a LaTeXString or not.
But since UnitfulString{LaTeXString, ...} is not a LaTeXString, it goes the wrong path.

I could add extra handling for this, but in general I'd prefer if recipes didn't change the type of inputs.

@jw3126
Copy link
Owner

jw3126 commented Jun 2, 2022

Not sure. What I imagine could happen is that when constructing a plot in multiple steps, plot(...); plot!(...); plot!(...) units get added multiple times.

@gustaphe
Copy link
Collaborator

gustaphe commented Jun 2, 2022

Yes-ish. We need to keep track of both the unit and the manual part of the label separately so that we can

  • plot! correctly
  • change the axis unit after the fact (actually checking now we don't actually do this ...)

Perhaps there's another option, but it gets pretty tricky. What does pgfplots need to know it for?

@BeastyBlacksmith
Copy link
Author

What does pgfplots need to know it for?

It does escape certain characters, e.g. if you want to label something "100%".

@gustaphe
Copy link
Collaborator

gustaphe commented Jun 3, 2022

Edit dumb. Is that something you want? I would expect % in a LaTeXString to be the comment char. UnitfulLatexify for instance gives

But maybe the specific example is beside the point.

If you have a good suggestion of how else we could convey and store this information I'd love to hear it. Otherwise maybe a guide interface somehow?

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