samexaxis (nice subplots with same x axis)

Makes it alot easier to make nice figures with the same x axis.
13,7K téléchargements
Mise à jour 29 mars 2005

Aucune licence

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)

Citation pour cette source

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. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R14
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Combine Multiple Plots dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
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.