![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174433/image.png)
Scatter Plot: plotting vector against a matrix
4 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166007/image.png)
Very rusty with matlab, but I'm trying to do something like the image above, i.e. plotting the first row (categories) against the following four rows (the data points). Been searching for hours and can't seem to find the answer to this rather simplistic problem. Advice?
0 个评论
采纳的回答
Star Strider
2016-6-8
MATLAB Will plot all the rows in each column against specific x-values:
BS = [144 377 326 273 449; 434 493 337 299 472; 500 521 348 323 485; 412 373 225 248 371];
x = 1:size(BS,2);
figure(1)
plot(x, BS, '+b') % Plot Matrix
axis([0 6 0 550]) % Set Axis Limits
set(gca, 'XTick',x, 'XTickLabel',{'A','B','C','D','E'}) % Set Tick Labels
xlabel('Rope Type') % X Axis Label
ylabel('Breaking Strength (lb)') % Y Axis Label
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174433/image.png)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!