Move legend to middle of figure

159 ビュー (過去 30 日間)
AmericanExpat26
AmericanExpat26 2016 年 10 月 15 日
回答済み: Image Analyst 2016 年 10 月 15 日
I am try to stacked plots of bar graphs for a scientific publication. When trying to the position of the legend, it does not fit well inside the figure area on either side and I would rather put it on the outside of the figure area to save on space. Is it possible to manually set the position of the legend in the plot area and move it into the middle where it would fit nicely. The sample code (top plot) I have for the legend so far is:
plotleg = legend('\DeltaTA','TA^{DIC-TA}_{calc}','Salinity','Location','northwest','Orientation','horizontal');
legend('boxoff');
set(plotleg,'FontSize',11);
Figure below.

回答 (2 件)

Pritesh Shah
Pritesh Shah 2016 年 10 月 15 日
In figure editor, you can move legend. (Edit-> Figure properties -> click on legend)

Image Analyst
Image Analyst 2016 年 10 月 15 日
You can use an "outside" location option, for example
legend(ca, 'Location', 'eastoutside');
See the help for all the location options.

Community Treasure Hunt

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

Start Hunting!

Translated by