You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a LaTeX document for my thesis, and I'm generating my plots using Julia's Plots.jl package.
As such, I'm using the LaTeXStrings.jl package to have the font consistent with my thesis.
Now, I've been changing the formatter attribute of the axes to follow the LaTeX font as follows,
formatter=x->@sprintf("\$0.0f\$", x)
To generate axes as such,
However, when it came to the scientific notation, as shown in the y-axis, I had a hard time. I tried to do it manually as with the x-axis, but couldn't. I dug through the source code for Plot.jl to see what I was doing wrong, and I was pleasantly surprised to find that it already has that functionality built-in, see line 194 of axes.jl in Plots.jl.
Using this as,
formatter=:latex
Now, I get the plot in the manner I need,
Unfortunately, this is not documented under the axis attributes of the docs. Furthermore, there are also the options for choosing :engineering and :none as well. The docs only show three options for the axis attribute formatter as :plain, :scientific, and :auto. It is missing the additional options for :latex, :engineering, and :none.
Can we document this for other users? This can save some headaches for future users.
The text was updated successfully, but these errors were encountered:
I would like to add to this issue as it may help other who might come across it. I've discovered that I was approaching this incorrectly. As it turns out, Plots.jl supports the default LaTeX font by setting the following attribute,
fontfamily="Computer Modern"
In this manner, the font for the entire plotted is rendered in the default LaTeX font. Still, I think the documentation should mention the missing axis attributes for formatter.
I'm working on a
LaTeX
document for my thesis, and I'm generating my plots usingJulia
'sPlots.jl
package.As such, I'm using the
LaTeXStrings.jl
package to have the font consistent with my thesis.Now, I've been changing the
formatter
attribute of the axes to follow theLaTeX
font as follows,To generate axes as such,
However, when it came to the scientific notation, as shown in the y-axis, I had a hard time. I tried to do it manually as with the x-axis, but couldn't. I dug through the source code for
Plot.jl
to see what I was doing wrong, and I was pleasantly surprised to find that it already has that functionality built-in, see line 194 ofaxes.jl
inPlots.jl
.Using this as,
Now, I get the plot in the manner I need,
Unfortunately, this is not documented under the axis attributes of the docs. Furthermore, there are also the options for choosing
:engineering
and:none
as well. The docs only show three options for the axis attributeformatter
as:plain
,:scientific
, and:auto
. It is missing the additional options for:latex
,:engineering
, and:none
.Can we document this for other users? This can save some headaches for future users.
The text was updated successfully, but these errors were encountered: