Inversely proportional secondary axis as a reference of primary axis
显示 更早的评论
Hello everyone;
first time here, I will appreciate any feedback and help that I can get. I am plotting in the freq. domain, but I want add a second axis in wavelength, which is (wavelength=3e8/freq), inversely proportional. The code below is my attempt to add the second axis, I am only getting the limits right but the values in between do not correspond to each other. Thank you for your time
[AX,H1,H2] = plotyy(x1,y1,x1,y2);
ax1 = gca;
delta = 0.1;
set(ax1, 'Position', get(ax1, 'Position') + [0 delta 0 -delta ]);
ax2=axes('Position', get(ax1, 'Position').* [1 1 1 0.001]-[0 delat 0 0],'Color','none');
domain=get(ax1, 'XLim')
domain=fliplr(domain).^-1
set(ax2,'xdir','reverse','Xlim',domain);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
