I want to plot different sized vector but fitted size in axes

4 ビュー (過去 30 日間)
Ki Beom Son
Ki Beom Son 2017 年 1 月 16 日
編集済み: Wilson A N 2017 年 1 月 20 日
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.

採用された回答

Wilson A N
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 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by