I want to plot different sized vector but fitted size in axes
1 次查看(过去 30 天)
显示 更早的评论
I want to plot A which is contour and B which is scatter 3d on same axes.
But they have different size so i can't plot same size. ex) A = 300 X 300, B = 100 X 100
if i increase B's size and relocation B's value, it will fine. But i can't use this method.
So i want to know to plot different sized vector but fitted size in axes. like as one is background picture.
My goal is contour A that is used floor(z=0), and surf 3d B(z=0~h) above the A.
0 个评论
采纳的回答
Wilson A N
2017-1-20
编辑:Wilson A N
2017-1-20
You can check the code given below:
% Creating a surface and contour plot together with the surfc command
[X,Y,Z] = peaks(30);
figure
k = surfc(X,Y,Z)
% Creating another plot for the contour plot with different dimension data
p = linspace(-2*pi,2*pi);
q = linspace(0,4*pi);
[P,Q] = meshgrid(p,q);
R = sin(P)+cos(Q);
% Assigning and plotting the contour plot of the surface plot with the new data.
k(2).XData = P;
k(2).YData = Q;
k(2).ZData = R;
Here the new contour plot is of different dimension and it gets plotted below the surface plot of another dimension. More information on the 'surfc' command is given in the link below:
You can also hide the desired data points in the plot by assigning the data point to NaN. The following link shows how to hide data points:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!