Xaxis log scale labels overlapping with yaxis labels
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I can't seem to get my xaxis labels to not overlap with the top of my yaxis labels when I use a log scale on the xaxis with exponents (see figure). I've tried manually setting the axis labels but that doesn't work. I basically want to move the xaxis labels upwards so they are above the Xticks. Any help is appreciated!
plot(Peat.Ksat,Peat.Depth,'ko','MarkerSize',10,'MarkerFaceColor',[0.4 0.4 0.4])
text(1.1E-6,0.29,'n = 36','fontsize',20)
box on
set(gca, 'YDir','reverse')
set(gca, 'XAxisLocation', 'top')
set(gca, 'TickDir','in');
set(gca, 'XScale', 'log')
xlabel('Ksat (m/s)','FontSize',20)
ylabel('Depth (m)','FontSize',20)
print(gcf,'/Users/Kelly/Dropbox/Documents/MATLAB/PhD/Figures/Soil Data/Profile/Peat/Ksat','-djpeg','-r300')
1 comentario
Adam Danz
el 12 de Sept. de 2020
What about setting ylim() so that there's a bit more space at the top after y=0?
Respuestas (1)
Ameer Hamza
el 13 de Sept. de 2020
Try to set the position y-position of the XLabels manually. For example
ax = gca;
ax.XLabel.Position(2) = -0.02; % -0.02 is location on y-axis
5 comentarios
Ameer Hamza
el 20 de Oct. de 2020
In that case, you can try the following
ax = gca;
ax.XAxis.TickLabelGapOffset = 5
Ver también
Categorías
Más información sobre Log Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!