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

Enable MathJax functionality #11

Merged
merged 2 commits into from Sep 19, 2023
Merged

Conversation

jd-foster
Copy link
Contributor

Enable LaTeX to appear in images produced using savefig().

Note that LaTeX rendering in VS Code doesn't seem to work. This applies to saved figures however.

MWE

julia> using LaTeXStrings

julia> using PlotlyKaleido

julia> import PlotlyJS

julia> import PlotlyJS: scatter, attr, Layout

julia> p2 = PlotlyJS.plot(PlotlyJS.scatter(x = rand(10)), Layout(
                       font_size=14,
                       margin=attr(l=80, r=60, b=60, t=80),
                       title = "My Plot",
                       xaxis_title = L"\sqrt{N_c}".s,
                       yaxis_title = L"\int r".s))

julia> PlotlyKaleido.start()

julia> PlotlyKaleido.savefig(p2, "plot3.pdf")
"plot3.pdf"

Before:
plot4

After:
plot3

Allow LaTeX to appear in images produced using savefig().
@BeastyBlacksmith
Copy link
Member

I think it would be good, if there were some way to opt-out or adjust the version.

@jd-foster
Copy link
Contributor Author

Thanks, I've modified it to opt-in with a Bool, or provided you own URL, or just the version number

@BeastyBlacksmith BeastyBlacksmith merged commit 68db760 into JuliaPlots:main Sep 19, 2023
4 checks passed
@jd-foster jd-foster mentioned this pull request Sep 20, 2023
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.

None yet

2 participants