フィルターのクリア

Legend: is it possible to remove the border while leaving the background color?

69 ビュー (過去 30 日間)
Dear MatLab users,
I would like to generalize my plot legends visualization, but the legend border and background seem to interact together (see example below). In this case, the boxoff command prevails over the background color, as it disables both. Is it possible to remove ONLY the legend border while leaving the background color?
A = rand(5,1) ;
on_off = 'off' ;
legendcolor = 'r' ;
plot(A) ;
leg = legend('My text') ;
set( leg , 'fontsize' , 20 , 'location' , 'east', 'color' , legendcolor , 'box' , on_off )
grid on

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 12 月 9 日
set( leg , 'fontsize' , 20 , 'location' , 'east', 'color' , 'g' , 'box' , 'on','edgecolor','g' )
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2020 年 12 月 9 日
According to doc, "box" meant to include background and outline.
Legend box display, specified as one of these values:
  • 'boxon' — Display the legend background and outline.
  • 'boxoff' — Do not display the legend background and outline.
Gianluca Regina
Gianluca Regina 2020 年 12 月 9 日
Thank you for the clarification!

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

その他の回答 (0 件)

カテゴリ

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