How to use latex interpreter for xticklabels?
617 次查看(过去 30 天)
显示 更早的评论
How to use latex interpreter for xticklabels or yticklabels?
0 个评论
采纳的回答
更多回答(2 个)
Stefan Ineichen
2018-11-13
编辑:Stefan Ineichen
2018-11-13
Insert the code before plotting.
set(groot,'defaultAxesTickLabelInterpreter','latex');
Further, add these to set other useful interpreter to latex.
set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex');
1 个评论
Ali Afruzi
2022-4-13
You can set 'latex' or 'tex' for only one of your axis plot.
Using TickLabelInterpreter, one can define latex for only x-axis and tex for y-axis. for example:
x=1:10;
y=rand(10,1);
plot(x,y)
xaxisproperties= get(gca, 'XAxis');
xaxisproperties.TickLabelInterpreter = 'latex'; % latex for x-axis
yaxisproperties= get(gca, 'YAxis');
yaxisproperties.TickLabelInterpreter = 'tex'; % tex for y-axis
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!