saving image using export_fig or saveas, messes up the axis labels
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
The x axis, labels either gets chopped off in the saved file or mixed up with the x-axis marks. I need to save an image like this, with large axis titles, and marks.
close all;
sizee = 20;
h = figure(1)
line([0 1],[0 1])
g = get(h,'Currentaxes');
set(g,'FontSize',sizee,'FontName','Times');
xlabel('$X_1$','interpreter','latex','FontSize',sizee,'FontName','Times');
ylabel('$X_2$','interpreter','latex','FontSize',sizee,'FontName','Times');
xlim([-pi,pi])
ylim([-pi,pi])
h = figure(1) ;
set(h,'Color',[1.0 1.0 1.0]);
set(h,'units','normalized','outerposition',[0 0 1 1]);
export_fig(h,'test') % you can try either one saveas(h,'test.png')
0 comentarios
Respuestas (1)
Image Analyst
el 25 de Dic. de 2012
Move the X over with some non-breaking spaces (slash space):
xlabel('\ \ \ \ \ \ \ \ \ $X_1$','interpreter','latex','FontSize',sizee,'FontName','Times');
Use as many as you need to nudge the X over.
Either that or reduce your font size.
0 comentarios
Ver también
Categorías
Más información sobre Printing and Saving en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!