Breaking up a long line of plot code
31 ビュー (過去 30 日間)
古いコメントを表示
How can I break up a long line of code into multiple lines? I don't want to break up my plot, I just want to make this long line of code easier to read and edit. The ultimate goal is to have a plot that displays 4 sets of data on the same x-y axis, using different shapes with different colors for each data set.
figure
plot(Dates, PW_4anom,' bd', 'MarkerEdgeColor', 'k', 'MarkerFaceColor', 'r', Dates, MW1_78anom, 'rs', 'MarkerEdgeColor', 'k'...
The code goes on to specify two more data sets. How can I write this code in multiple lines instead of one long line? Or is this the only way with the method I'm using?
I appreciate any and all help, I am totally new to Matlab!
0 件のコメント
採用された回答
Jan
2021 年 3 月 28 日
編集済み: Jan
2021 年 3 月 28 日
The marker for the line continuation in Matlab is "..." :
figure
plot(Dates, PW_4anom, ' bd', ...
'MarkerEdgeColor', 'k', 'MarkerFaceColor', 'r', ...
Dates, MW1_78anom, 'rs', 'MarkerEdgeColor', 'k');
See: https://www.mathworks.com/help/matlab/matlab_prog/continue-long-statements-on-multiple-lines.html
You can find such information by asking an internet search engine for "Matlab line continuation".
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!