I am running Mathematica 11.0, and am trying to create a bar chart to insert into a LaTeX document; since the document is in LaTeX, I would like the look of the chart to be in line with this, and so have been trying to use the MaTeX package to achieve this. Having set it all up however, when I run the code, the axis labels/numbers etc aren't changed into the computer modern font as I thought they would be. Here is my code:
<<MaTeX`
BarChart[{-10, -5, 10, 50},
AxesLabel -> {X-Axis, Y-Axis},
ChartLabels -> {"1", "2", "3", "4"}, ChartStyle -> {"Pastel"},
BaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 16}]
and here is what it returns (ignore the exact placing of labels, I'll fix that once I've got MaTeX working): Confused about why it wasn't working, I thought I'd try to run one of the examples given on the website to check my install of MaTeX was ok. The code given was:
texStyle = {FontFamily -> "Latin Modern Roman", FontSize -> 12};
ContourPlot[x^2 + y^4 == 1, {x, -1.2, 1.2}, {y, -1.2, 1.2},
BaseStyle -> texStyle,
Epilog -> {
Arrow[{{0.1, 0.3}, {0.5, 0.80}}],
Inset[MaTeX["x^2+y^4=1", Magnification -> 2], {0.1, 0.3}, Scaled[{0.5, 1}]]
}]
and on the website returned this: however when run on my version of Mathematica, returned this (ignore the sizing of the maths in the middle; this is just because I sized up the image before exporting it): What confuses me is that the axis labels in my version have not changed, as they didn't for my bar chart, even though the maths in the middle still renders fine (which suggests that MaTeX is correctly installed and working).
Any help is greatly appreciated! :)
AxesLabel -> {X-Axis, Y-Axis}
and I would try usingtexStyle = {FontFamily -> "Latin Modern Roman", FontSize -> 16}
instead ofBaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 16}
to see if it does what you want. $\endgroup$AxesLabel ->{"X-Axis","Y-Axis"}
? $\endgroup$X - Axis
as some expression. Since you had no value forX
and no value forAxis
it left it as is. But this is wrong. It should be string. $\endgroup$AxesStyle -> texStyle
or another command? $\endgroup$