What is the best graphical option to display two multivariate datasets so that the differences are conspicuous enough?
2 次查看(过去 30 天)
显示 更早的评论
I have two datasets. Each dataset is an output from a model and each dataset contains an array of values in the x (horizontal) axis and 10 arrays of values in the y (vertical) axis. I have tried to create two different visualizations. The first one was created in Excel with the 'scatter plot with smooth lines' option and the second was created using Excel but with manual addition of shades for visualization purpose only. I am new to MATLAB and I would appreciate if someone can help to create the second plot in MATLAB. Even better if someone can suggest a better graphical/visualization/plot option.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152938/image.png)
Following are my data values for 2 scenarios
SCENARIO A
x= [0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
y1= [0, 0, 0.02, 0.01, 0, 0, 0, 0, 0, 0, 0, 0]
y2= [0.01, 0, 0.05, 0.1, 0.19, 0.6, 0.87, 1, 1, 1, 1, 1]
y3= [0.02, 0.05, 0.2, 0.69, 0.99, 1, 1, 1, 1, 1, 1, 1]
y4= [0.02, 0.12, 0.25, 0.97, 1, 1, 1, 1, 1, 1, 1, 1]
y5= [0, 0.12, 0.68, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y6= [0, 0.2, 0.84, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y7= [0.01, 0.49, 0.97, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y8= [0.01, 0.51, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y9= [0.01, 0.82, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y10= [0, 0.84, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
SCENARIO B
x= [0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
y1= [0.01, 0.03, 0.01, 0, 0.01, 0, 0, 0, 0, 0, 0, 0]
y2= [0.01, 0.07, 0.04, 0.13, 0.23, 0.5, 0.92, 1, 1, 1, 1, 1]
y3= [0.01, 0.03, 0.2, 0.61, 0.99, 1, 1, 1, 1, 1, 1, 1]
y4= [0.02, 0.06, 0.4, 0.99, 1, 1, 1, 1, 1, 1, 1, 1]
y5= [0, 0.24, 0.61, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y6= [0, 0.26, 0.88, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y7= [0, 0.51, 0.99, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y8= [0.02, 0.64, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y9= [0.02, 0.87, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
y10= [0.01, 0.94, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
2 个评论
jgg
2015-12-30
I think I would suggest making it a 3D plot. Use x as one axis, then an indicator for A or B as the y axis. Then, plot the values of the functions as the height on the z axis. That might be suitable.
You could also just plot the differences in the functions, if that's the main object of interest.
回答(1 个)
Vineeth Kartha
2016-1-4
编辑:Vineeth Kartha
2016-1-4
Hi James,
I feel the bar graphs will be a suitable plot for the dataset that you have, There is the 2D bar graph and the 3D bar graph in MATLAB.
In order to plot the bar charts you can execute the following commands.
y=[y1' y2' y3' y4' y5' y6' y7' y8' y9' y10'];
bar(x,y)
this will plot the 2D bar graph. If you need the 3d bar graph then execute the following command.
y=[y1' y2' y3' y4' y5' y6' y7' y8' y9' y10'];
bar3(x,y)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Bar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!