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

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

 Accepted Answer

Ma
Ma on 28 Jun 2018

2 votes

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

1 Comment

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

Sign in to comment.

More Answers (0)

Products

Release

R2018a

Asked:

N/A
on 28 Jun 2018

Commented:

N/A
on 1 Jul 2018

Community Treasure Hunt

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

Start Hunting!