plotを用いた二点鎖線の書き方

for x=0:pi/180:pi
y=sin(x);
end
plot(x,y,'g-..','LineWidth',5);
このようなプログラムを書きましたが、二点鎖線ではなく一点鎖線になりました。どのように修正すれば書けますか?

 Akzeptierte Antwort

Ma
Ma am 28 Jun. 2018

2 Stimmen

plot関数によると、2重鎖線はサポートされていないようです。
無理やり二点鎖線に見えるものを作ろうとすると、
x=0:pi/180:pi;
y=sin(x);
plot(x,y,'g--.','LineWidth',5);
(※図が1点になってたのでループをなくしました)とすると、破線と点が描けます。あとは画像の大きさを調整することで破線の間に見える点の数を2つにし、見かけ上は二点鎖線にすることができます。

1 Kommentar

N/A
N/A am 1 Jul. 2018
ありがとうございました。

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Version

R2018a

Gefragt:

N/A
am 28 Jun. 2018

Kommentiert:

N/A
am 1 Jul. 2018

Community Treasure Hunt

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

Start Hunting!