Remove top and bottom ticks AND maintain ylabel and xlabel inside the figure
Afficher commentaires plus anciens
Hi, I am trying to remove the ticks on the top and right axis (which I managed to obtain from a previous posting); however, upon doing so, the xlabel and ylabel seem to lie outside the figure, and don't shift accordingly when I re-scale the figure (rather they get cropped out):

the code used to produce the figure is as follows:
a1 = axes('box','on','xtick',[],'ytick',[]); %Under axis, used as background color and box;
a2 = axes(); %Over axis, used for ticks, labels, and to hold data
propLink = linkprop([a1 a2],'position'); %Keep the positions the same
bar(a2, [1 2 3 4], [1 2 3 4], 0.4, 'FaceColor',[0.5 0.3 1])
ylabel('Rate (mmol_{consumed} g_{cat}^{-1} min^{-1})','FontSize', 14)
xlabel('Wavelength','fontsize',14)
set(gca,'TickDir','out','fontsize',11)
ylim([0 10])
set(gcf,'Position',[0,0,360,350])
set(a2,'box','off','color','none'); %Set top axes props last ("plot" overrides some properties)
Is there some way to avoid this and have the labels adjust accordingly when re-sizing the figure like in a regular matlab plot?
Many thanks,
Mark
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Axes Appearance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
