複数のラインを描写し​たとき、モノクロプリ​ンタに出力するために​、自動的にラインスタ​イルを指定する方法は​ありますか?

10 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 25 Oct 2013
複数のラインを描写したとき、モノクロプリンタに出力するために、自動的にラインスタイルを指定する方法はありますか?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Oct 2013
複数のラインを描写するとき、ラインスタイルを個々に指定するのではなく、自動的に指定するにはaxesオブジェクトのlinestyleorderプロパティを設定します。Linestyleorderプロパティを設定する際は、axesのcolororderプロパティを1色に設定してください。
例:ラインスタイルを実線、破線、点線、鎖線の順に設定します。
(コマンド例)
linestyle=str2mat('-','--',':','-.');
set(gca,'colororder',[0 0 0]);
set(gca,'linestyleorder',linestyle)
hold on
x=0:0.1:10;
y=[sin(x);cos(x);2*sin(x);2*cos(x)];
plot(x,y)
hold off
(コマンドの実行結果)

More Answers (0)

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!