How to make contour plot with two y axes.

3 次查看(过去 30 天)
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 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by