plot two figures with same colorscale
3 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I want to plot x,y,z data with z as time series data in several figures. I want to plot using plot3. However, I found difficulties to plot that figures in same color scale. I have make a script like this :
clear;
x=xlsread('Merapideformation.xlsx', 'A:A');
y=xlsread('Merapideformation.xlsx', 'B:B');
z1=xlsread('Merapideformation.xlsx', 'D:D');
z2 = xlsread('Merapideformation.xlsx', 'E:E');
clear Merapideformation
bottom = min(min(min(z1)), min(min(z2)));
top = max(max(max(z1)), max(max(z2)));
subplot(1,2,1)
plot3(x,y,z1,'.');
view (5,90)
caxis manual
caxis ([bottom top]);
subplot(1,2,2)
plot3(x,y,z2,'.')
view (5,90)
caxis manual
caxis ([bottom top]);
colorbar;
However, when I run the script, the plot was just in blue color. It makes me difficult to analyze in time series. Does anybody can help me? thank you in advance.
0 件のコメント
回答 (2 件)
Hugo
2014 年 11 月 12 日
If I understood correctly, you want the colour to vary according to the value of "z". But the problem is that plot3 takes only one colour for the whole line. Furthermore, the colour is not affected by caxis.
The solution may be to use scatter3 instead. It seems that you are just plotting points, so it should be fine. Hope this helps.
2 件のコメント
Hugo
2014 年 11 月 17 日
Sorry for the delay.
The colour scale in scatter3 can be modified with caxis and thus can be made the same. The colours of each point in scatter3 can be specified as one of the inputs of scatter3. That is, if you write scatter3(x,y,z,10,z), it would plot points of size 10 and each point will have a colour proportional to the value of z in that point. Then the colormap can be changed using the command "colormap" followed by some predefined value or by a colormap of your own
Hope this helps.
Luuk van Oosten
2014 年 11 月 17 日
I tried something similar with scatter3. A slight modification of this answer will solve your problem.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Orange についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!