PLOTXX Create graphs with x axes on both top and bottom
Similar to PLOTYY, but ... the independent variable is on the y-axis, and both dependent variables are on the x-axis.
For example, you may wish to plot temperature and salinity as a function of depth in the ocean. In the atmosphere, plot temperature and relative humidity as a function of altitude, etc.
Denis Gilbert (2020). plotxx.m (https://www.mathworks.com/matlabcentral/fileexchange/317-plotxx-m), MATLAB Central File Exchange. Retrieved .
does not work for multiple plots
Thanks!! Working great!
Finally! A subroutine that did exactly what I wanted right away. Thank you!
Thank you very much!!
Just what I was looking for !
Try to do this with pcolor plot with one of the x-axis being an inverse of the other x-axis times some constant. Can't seem to get it to work.
Can someone help me??I´m trying to use this rotine with subplot, but I can´t do this and I saw another comments about this!Thank you
very useful but sloppy code...
Could have done better...
Yet very useful
% This works at least:
% From web('jar:file:///C:/Program Files/MATLAB/R2009b/help/techdoc/help.jar!/ref/set.html', '-helpbrowser')
Is it possible to make a bar graph and a line graph with different x axes on the same figure using this program? Thanks.
Good stuff. How can I make it work for inversely proportionnal axes : i.e. wavelength (in microns) and wavenumbers (in cm^-1) ?
thanks a lot for this solution ! (very usefull for vertical profiles)
to get autoscale on both x axis
or you may prefer to use :
[low,high,ticks] = bestscale(ylim1(1),ylim1(2),ylim2(1),ylim2(2),islog1 | islog2);
if you want to get a better ticks layout
(see open plotyy to copy bestscale sub function)
very useful thanks
to get the position right
To use with subplot, you need to comment out
set(ax(1),'Position',[0.12 0.12 0.75 0.70])
on line 65.
Is it just me, or does this not work with subplots?
To avoid inconsistent axes ranges, I suggest calling
> axis tight
after plotxx. You might consider adding this to the function as a precausion.
Useful as a corollary to plotyy. Would be useful to have two inversely proportional axes for one plot (e.g., wavelength on bottom and energy on top). Though this isn't too hard to do from plotxx. Thanks!
Thanks, saved me a lot of programming
Well done Dennis by your scripts, I agree with Lina Chang.
Very useful. I often why mathworks didnt have a function similar to plotyy..
I think additional parameters like passing colors,line width can be helpful too..
Very helpful for creating nomographs. Thanks.
Two new input arguments have been added to ease the task of labeling the axes.