Save figure as image in R2014b without causing legend customization to revert

1 Ansicht (letzte 30 Tage)
How can I keep the increases in line width in the legend of my plot when I save the figure as an image? It always reverts it to the corresponding data's line width and saves like that. When put into a document it is nearly impossible to tell what the line color is in the legend. I went back to my R2013b install and it worked no problem.
Using the following commands in both versions:
[hLeg,objLeg,outh,outm] = legend(...); set(objLeg,'LineWidth',5); saveas(hFig,[FileName '.png']);

Antworten (1)

Adam Hug
Adam Hug am 1 Jul. 2015
Bearbeitet: Adam Hug am 1 Jul. 2015
I think a better way of doing this is to adjust the linewidth of your plot. For example,
hold on
plot(t, sin(t), 'LineWidth', 5);
plot(t, cos(t), 'LineWidth', 5);
legend('Sine', 'Cosine');
hold off
saveas(gcf, 'test.png');
This way the "saveas" command will not trample over any changes you made to the legend. Additionally, you will be able to see the lines better in your image.

Kategorien

Mehr zu Printing and Saving finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by