Octave: LaTeX tics

こ雲淡風輕ζ 提交于 2019-12-06 12:13:06

latex isn't implemented yet in GNU Octave. You can use a subset of TeX for Greek symbols and so on.

If you just want to have LaTex in the generated print (for publication), you can use for example the device epslatexstandalone and render it afterwards with latex:

close all
graphics_toolkit fltk

title ("for thyme:")

t = linspace (0, 2 * pi, 100);

plot (t, sin (t))
set (gca, "xtick", [0 0.5 1 1.5 2] * pi)
set (gca, "xticklabel", {'$0$', '$\frac{\pi}{2}$', '$\pi$', '$\frac{3\pi}{2}$', '$2\pi$'})
grid on
set(gca, "fontsize", 20);

print -depslatexstandalone thyme

## process generated files with pdflatex
system ("latex thyme.tex");

## dvi to ps
system ("dvips thyme.dvi");

## convert to png for stackoverflow
system ("gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r100x100 -dEPSCrop -sOutputFile=thyme.png thyme.ps")

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!