-
Notifications
You must be signed in to change notification settings - Fork 97
Description
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.