Borrar filtros
Borrar filtros

How to make contour plot with two y axes.

7 visualizaciones (últimos 30 días)
ref
ref el 8 de Feb. de 2013
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 comentario
ref
ref el 13 de Feb. de 2013
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by