フィルターのクリア

How to get handles of a legend that was automatically generated?

20 ビュー (過去 30 日間)
KJVKU999
KJVKU999 2017 年 9 月 26 日
回答済み: Aiyush 2019 年 3 月 23 日
I am trying to move an automatically generated (did not create command like: lgd=legend(...)) legend in a subplot.
How to access that legend? so that I can use lgd.location=best.
Also, legend moving sometimes disturbs axis extents, how to avoid that? ------------------------
Edit1: I am using following code to generate plot that generates automatic legends:
parallelcoords(P1to5,'Group',...
Group1to5,'Labels',Labels1to5);

採用された回答

Jos (10584)
Jos (10584) 2017 年 9 月 26 日
H = findobj('type','legend')
H.Location = 'best'
  1 件のコメント
KJVKU999
KJVKU999 2017 年 9 月 26 日
編集済み: KJVKU999 2017 年 9 月 26 日
Thank you.

サインインしてコメントする。

その他の回答 (1 件)

Aiyush
Aiyush 2019 年 3 月 23 日
This only works when you want to retrieve 1 legend. If there are multiple legends on a complex figure, and you want to modify let's say the font size of the 2nd legend, then this is more difficult.

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by