samexaxis (nice subplots with same x axis)

Makes it alot easier to make nice figures with the same x axis.
13,8K download
Aggiornato 29 mar 2005

Nessuna licenza

Features:

* Automatically sets xlim to the same for all subplots Removes xticklabels where it is not needed.
* Can join a subplots (if it is made with subplot instead of subaxis)
* Can set the ylabel position to the same for all subplots
* Can almost allways avoid that the yticklabels are written on top of each other
* Can automatically add a),b),c) to each subplot

----------
% helper function to clean up subplots that have common x axises

USAGE: samexaxis([optionalarguments])

Optional arguments:
* YAxisLocation (default='left') : choose left,right, alternate or alternate2
* XAxisLocation (default='bottom') : choose bottom,top or both
* YLabelDistance (default=1.4)
* Box (default='on')
* XTick
* XTickLabel
* XMinorTick
* ABC : add a),b),c), ... to each sub plot
* Join: joins the subplots vertically
* YTickAntiClash: try to aviod yticklabel clashes (default=false)


Example:
subplot(3,1,1);
plot(randn(100,1),randn(100,1),'x');
ylabel('QF')
subplot(3,1,2);
plot(randn(100,1),randn(100,1)*10,'x');
ylabel('HT');
subplot(3,1,3);
plot(randn(100,1),randn(100,1)*33,'x');
ylabel('DV');

samexaxis('abc','xmt','on','ytac','join','yld',1)

Cita come

Aslak Grinsted (2024). samexaxis (nice subplots with same x axis) (https://www.mathworks.com/matlabcentral/fileexchange/7169-samexaxis-nice-subplots-with-same-x-axis), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R14
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Combine Multiple Plots in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0

Made more clever ytickanticlash. Should no longer hide lines exactly at the ylimits. And it will not change ylimits of axes that doesn't have ylim set to auto.