How do you change the color of legend lines? How do you make x axis go from 0 to 2pi?

1 回表示 (過去 30 日間)
Bryan Tassin
Bryan Tassin 2021 年 8 月 28 日
回答済み: Cris LaPierre 2021 年 8 月 28 日
plot(rad1, red)
hold on
plot(in, yellow)
plot(in1, blue)
plot(in2, green)
legend({ \theta3(rad), r3(in), r4(in), r5(in)})
  1 件のコメント
Wan Ji
Wan Ji 2021 年 8 月 28 日
Would you please write your code down precisely and state detailly about what you wanna do?

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

回答 (2 件)

dpb
dpb 2021 年 8 月 28 日
  1. Define the x vector to plot against; the one numeric argument form of plot, as documented, plots against the ordinal position, or
  2. Set the tick labels as desired independently of the value to the desired values. The first is generally simpler.
legend() will use the linestyle of the lines; you've also not provided a linestyle and so the points may not show up depending upon the actual number in each of the above instructions.

Cris LaPierre
Cris LaPierre 2021 年 8 月 28 日
It sounds like you would be well served by going through Ch 9 of MATLAB Onramp. It covers plotting. See the xlim function for specifying axis limits.

カテゴリ

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