Info
此问题已关闭。 请重新打开它进行编辑或回答。
Dual parallel X axis scale
1 次查看(过去 30 天)
显示 更早的评论
Hi guys, please help review the script below.
I am making a plot with a dual x-axis (in nm and cm-1). The goal is to make a plot of Intensity vs wavelength in nm but at the same time have the wavelength scale in wavenumber parallel to each other. With my current script, the axes doesn't correspond well, for example: 2500nm correspoonds to 4000 cm-1 but what I got doesn't corresponds to this. See image below.
#script
wavenumber = 1e7 ./ wv11;
figure;
plot(wv11, miroptimized(2:end-1,:)); % Plot intensity vs wavelength
xlabel('Wavelength (nm)');
ylabel('Intensity');
ax2 = axes('Position', get(gca, 'Position')+[0, -0.03, 0, 0], 'Color', 'none', 'YTick', [], 'XAxisLocation', 'bottom', 'XLim', [min(wv11), max(wv11)], 'NextPlot', 'add');
xlabel(ax2, 'Wavenumber (cm^{-1})');
ax2.XLim = [min(wavenumber), max(wavenumber)];
ax2.Position = get(gca, 'Position')+[0, -0.03, 0, 0];
set(gca, 'Box', 'off', 'Color', 'none');
set(ax2, 'Box', 'off');
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!