Plot 3 scale graph
2 ビュー (過去 30 日間)
古いコメントを表示
Hi I need help with this code.
Weight=(37000:2000:74000);
CG=(16:1:42);
Index=(((Weight/1000)*(CG-25)*0.041935)+50);
I want to do a scattered plot with Weight on the Y axis, Index on the X axis(Bottom) and CG on X axis (Top). Please help.
Regards Anoop
0 件のコメント
回答 (2 件)
mashtine
2014 年 11 月 27 日
Hi Anoop, you can do this
Weight=(37000:2000:74000);
CG=(16:1:42);
Index=(((Weight/1000)*(CG-25)*0.041935)+50);
figure
h = scatter3(CG,Index,Weight);
First you will need to make sure your Weight and CG are of the same dimensions. One is 1x19 and the other is 1x27 of which you cannot calculate index from. Once you do that, from there you can look at all the scatter3 plot options to change the graph or you can do this interactively with the figure edit tools.
Image Analyst
2014 年 11 月 27 日
You need to use meshgrid to get all possible combinations of Weight and CG:
Weight=(37000:2000:74000);
CG=(16:1:42);
[x, y] = meshgrid(Weight, CG);
Index=(((x/1000).*(y-25)*0.041935)+50);
h = scatter3(y(:), Index(:), x(:));
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176916/image.png)
4 件のコメント
Image Analyst
2014 年 11 月 28 日
I don't really know. Perhaps you can get it by manipulating the camera angle. Or else just create it at a very low level with calls to line().
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!