With PLOTYY you can add a new axis, which will be linearly related with the old one. With this function, the new axis may be related by ANY monotonic ascending or descending function with the old one (which should be specified), and works with the x-axis as well.
Besides, both axes will be linked to work with the ZOOM/PAN functionalities and even the DATETICK or TLABEL function for a time axis.
For example, to include a new x-axis with an exponential relationship with the old one just use:
Any comments and bug reports will be very appreciated!
This is great! Only thing I can't have working is the 'XTickLabel'.
I tried this syntax
and get this error
Error using addaxes>parseInputs (line
When 'TickLabel's are specified, the
respective 'Tick's should be given too.
Error in addaxes (line 188)
Error in Hydrogen_index_jouran_paper
Anybody able to help?
if I comment the 'XTickLabel' part (but leave the 'XTick' part) everything looks OK and the ticks at the expected locations...
Fantastic simple to use function which adds a second axis. Perfect for two different units plotted on two different x-axes. [Even handles the inversion.] Allows for zoom as well!
Simply terrific. I've wanted something like this for years. Thank you!
v1.1 Fixed bug with function inversion, thanks to Allen Hall. Added 'Inverse' options and 'Position' link. Fixed small bug related with 'off' option.
Inspired: xunits, yunits and zunits.m (Jul 2014)
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.