问题
I have a bar graph, and I am using text() to display fractions above each of the bars. For example:
text(1, 20, "300/400")
displays the string "300/400" at position (1,20).
I would now like to prettify the fractions so that "300" appears over the "400":
300
---
400
Is there a way to do this, eg with tex or latex?
I tried each of these, but the interpreter is not getting called:
text(1, 20, '\frac{300}{400}');
text(1, 20, '\frac{300}{400}', 'interpreter', 'tex');
text(1, 20, '\frac{300}{400}', 'interpreter', 'latex');
回答1:
It looks like it's not yet possible in Octave. The TeX interpreter doesn't support the \frac structure, and the LaTeX interpreter isn't yet implemented.
http://www.network-theory.co.uk/docs/octave3/octave_172.html
来源:https://stackoverflow.com/questions/9075575/how-to-add-tex-to-octave-graph