how write legend plot right side)
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
採用された回答
Star Strider
2023 年 9 月 7 日
Try this —
x = linspace(0, 10);
y = randn(size(x,2), 5);
figure
plot(x, y)
legend(compose('Vector %2d',1:5), 'Location','NE')

.
7 件のコメント
pipor
2023 年 9 月 7 日
i saw that legend but i dont want this
i want to display on right sidede
Dyuman Joshi
2023 年 9 月 7 日
編集済み: Dyuman Joshi
2023 年 9 月 7 日
"but i dont want this"
pipor
2023 年 9 月 7 日

at the bottom of each line there must be the name (not in the legend with the colors)..When you have many lines the legend becomes very messy...
i do it with octave...several year ago

Star Strider
2023 年 9 月 7 日
編集済み: Star Strider
2023 年 9 月 7 日
I do not have your data, however something like this using the text function will work to put labels at the ends of the lines —
x = linspace(0, 2, 150);
y = (0:0.5:2).'+sin((1:5).'*2*pi*x);
figure
plot(x, y)
text(ones(1,4)*x(end), y(4:-1:1,end), {{'A'},{'B'},{'C'},{'D'}})
xlim(xlim+[0 0.1])

EDIT — (7 Sep 2023 at 21:05)
Corrected typographical errors.
.
pipor
2023 年 9 月 7 日
good!
Star Strider
2023 年 9 月 7 日
Thank you!
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

