Hi,
Just to be clear, I don't think i am asking the same question that is already abundant which is basically plotting two graphs with two axis in one graph.
But I need to plot one 2d contour plot with one dataset with two y axis on left and right side. But I am not plotting a second contour plot dependent on the second y axis but rather the 2nd yaxis is just there as a reference to different scales.
An example plot is included below. Ignore the filled gradient and focus on just line contour. This contour plot is plotted with respect to left yaxis and bottom xaxis. But it also includes secondary yaxis on the right and the secondary xaxis on top. If I just use yyaxis and plot another contour with the secondary yaxis, it will just generate a secondary contour which I don't want. I think this plot was generated using tecplot but I would like to use matlab if possible for scripting reasons. Is this possible in matlab? Thank you in advance.

 Akzeptierte Antwort

VBBV
VBBV am 12 Mär. 2022
Bearbeitet: VBBV am 12 Mär. 2022

0 Stimmen

dk = 1000;
dB = linspace(0.002,dk,7)*1e-6; % in micrometer
Sg = linspace(0.001,20,7);
hold all
M = rand(7);
t = tiledlayout(1,1);
ax1 = axes(t);
contour(ax1,Sg,dB/1e-6,M);
ax1 = gca;
ax1.XScale = 'log';
ax1.YScale = 'log' ;
hold(ax1);
Current plot held
ax2 = axes(t);
contour(ax2,Sg,dB/1e-6,M);
ax2 = gca;
ax2.XScale = 'log';
ax2.YScale = 'log';
ax2.XAxisLocation = 'top';
ax2.YAxisLocation = 'right';
colorbar;

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020b

Gefragt:

am 11 Mär. 2022

Bearbeitet:

am 12 Mär. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by