plotting of 2D surfaces

5 次查看(过去 30 天)
Nasir Rehman
Nasir Rehman 2022-12-17
评论: Nasir Rehman 2022-12-18
For the same size variable (33 * 1), I have found two distinct values. To compare the differences in a single plot, I'd want to plot these values as surface plots or some other creative way. For the same, I only plotted bar comparisons.
The variables are:
X= [1 0.9932 0.9735 0.97 0.9702 0.9479 0.915 0.913 0.9002 0.8877 0.8893 0.8927 0.8819 0.8672 0.8668 0.872 0.8435 0.8295 0.9914 0.9773 0.9745 0.9721 0.9596 0.9296 0.9172 0.9525 0.9595 0.9788 0.9949 1.0048 1.0568 1.0934 1.0731 ];
Y = [ 1.018 0.9933 0.9847 0.9879 0.9948 1.002 1.0004 1.0012 1.0138 1.026 1.0518 1.0318 1.0207 1.0049 1.0046 1.0102 0.9796 0.9644 0.9931 0.9789 0.9762 0.9737 0.9707 0.9405 0.9281 1.0067 1.014 1.0339 1.0505 1.0607 1.114 1.1516 1.1308 ];

回答(1 个)

John D'Errico
John D'Errico 2022-12-17
编辑:John D'Errico 2022-12-17
Totally CONFUSING.
X= [1 0.9932 0.9735 0.97 0.9702 0.9479 0.915 0.913 0.9002 0.8877 0.8893 0.8927 0.8819 0.8672 0.8668 0.872 0.8435 0.8295 0.9914 0.9773 0.9745 0.9721 0.9596 0.9296 0.9172 0.9525 0.9595 0.9788 0.9949 1.0048 1.0568 1.0934 1.0731 ];
Y = [ 1.018 0.9933 0.9847 0.9879 0.9948 1.002 1.0004 1.0012 1.0138 1.026 1.0518 1.0318 1.0207 1.0049 1.0046 1.0102 0.9796 0.9644 0.9931 0.9789 0.9762 0.9737 0.9707 0.9405 0.9281 1.0067 1.014 1.0339 1.0505 1.0607 1.114 1.1516 1.1308 ];
plot(X,Y,'o')
Are you telling us that X and Y should be essentially replicates at each position, but they are clearly not, and now you want to see how they are different? What does a surface plot have to do with this? You have not even provided us with the third variable anyway. Ok, so the plot of X versus Y seems to offer little information content. Try this instead.
plot(X-Y,'o')
Perhaps the difference plot about is what you want to see. It shows the difference at each location in the vector. So zero tells you that both vectors werre the same at that point. Below zero tell you that Y was the larger of the two. Above zero tells you that X was the larger.
Or, perhaps what you want to see is something like this:
plot(1:numel(X),[X;Y],'-r')
Where at each position in the vector, we see the two curves plotted. In blue I show the average of the two curves.
plot([1;1]*(1:numel(X)),[X;Y],'-ro',1:numel(X),(X+Y)/2,'b--')
In hat last one, I've plotted the two variables, showing the difference between each with a vertical line.
Or perhaps you want to see a bar plot.
bar(1:numel(X),[X;Y])
But honestly, I have no idea what you are asking. The idea of a surface plot makes no real sense at all that I can see.
  1 个评论
Nasir Rehman
Nasir Rehman 2022-12-18
Thank you very much for the effort and time. I want to plot the comparison or difference of these two variables with respect to value 1 ( refrence mark). Like in bar plot, the comparison of both are shown. The hat plot where you have shown the differnce between them as vertical lines is related plot. But, if you can please spare some time to plot them in some other way. I will be very thanful of you.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by