필터 지우기
필터 지우기

How to make contour plot with two y axes.

조회 수: 7 (최근 30일)
ref
ref 2013년 2월 8일
Hello, I am running the code shown bellow to create contour plots. What I do not get is what to change in order to create a contour plot with two y axes.
% Determine the minimum and the maximum x and y values:
xVarMin = min(dataByColumn.(colheaders{1}));
xVarMax = max(dataByColumn.(colheaders{1}));
yVarMin = min(dataByColumn.(colheaders{2}));
yVarMax = max(dataByColumn.(colheaders{2}));
% Define the resolution of the grid:
xVarRes=200;
yVarRes=200;
gx=xVarMin:0.1:xVarMax;
gy=yVarMin:1:yVarMax;
Zinterp=gridfit(dataByColumn.(colheaders{1}),dataByColumn.(colheaders{2}),dataByColumn.(colheaders{i}),gx,gy);
% Generate the mesh plot :
fig(j) = figure('name',vars{i});
contour(gx,gy,Zinterp,50)
colormap(jet(100));
xlabel(vars(1)); ylabel(vars(2)); zlabel(vars(i));
% Generate data point on the same axes with specified properties:
figure(fig(j));
hold on
plot3(dataByColumn.(colheaders{1}),dataByColumn.(colheaders{2}),dataByColumn.(colheaders{i}),'marker','o','markerfacecolor','r','linestyle','none');
hidden off
colorbar('EastOutSide')%North, NorthOutSide,East, EastOutSide etc
If I insert the 2nd y axis values how the gridfit or a meshgrid command is been manipulated?
  댓글 수: 1
ref
ref 2013년 2월 13일
The example of the link creates two different contour plots and combines them, which is not correct if you have the same z values for the two y axes.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by