MATLAB Answers

Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#">ここ</a>」をクリックしてください。

MByk
0

Plotting Matrix with Small and Large Values

MByk
さんによって質問されました 2019 年 3 月 22 日
最新アクティビティ MByk
さんによって 編集されました 2019 年 4 月 2 日 14:07
I am trying to plot the matrix (machines (rows) vs. production times (in sec) (columns)) below.
C1=[0.6018 0.6238 0.6001 0.6716 0.6054 0.6178 0.6978;
0.5701 0.5835 0.5734 0.6230 0.5744 0.5661 0.6630;
0.5702 0.5787 0.5746 0.6397 0.5593 0.5605 0.6867;
0.5631 0.5788 0.5782 0.6535 0.5777 0.5728 0.7069;
0.6503 0.6403 0.6607 0.7870 0.6666 0.6313 1.3154;
1.960 3.020 4.006 5.652 2.614 1.507 22.956;
25.935 31.486 46.325 41.668 6.312 8.867 110.668];
I think because of the large values small valued units not showing properly. I tried log scale and yyaxis, yyaxis works but it plots only in two colors. Is there a way to fix the problem? Thanks for the help.

  2 件のコメント

dpb
2019 年 3 月 22 日
What, specifically, are you trying to plot against what?
MByk
2019 年 3 月 23 日
Sorry for the late reply. I am using this line.
plot(C1','-s','LineWidth',1);

サインイン to comment.

タグ

1 件の回答

回答者: dpb
2019 年 3 月 23 日
 採用された回答

'Kay; that's what I surmised...on one plot it's probably going to be messy no matter what you do. Two options I can think of
  • Use left/right axes to plot differing magnitudes on alternate axes; can adjust one axis limits to minimize overlap:
yyaxis left
hLL=plot(C1(1:3,:).');
ylim([0.45 0.7
yyaxis right
plot(C1(4:5,:).')
  • Use subplots instead

  2 件のコメント

MByk
2019 年 3 月 23 日
As I told yyaxis works and I think it is the best solution, but it plots only in two colors. Thanks for your answer.
dpb
2019 年 3 月 23 日
I thought you were complaing about yyaxis still overlaying the plots.
You can use whatever color you want--that's a property of the line not the axis. Just assign whatever color you want when you call plot or save the handle and change properties later...

サインイン to comment.



Translated by