Currently using R2020a Student.
How an I manipulate top and bottom x axes individually?
73 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rod Letchford
el 30 de Ag. de 2020
Respondida: Rod Letchford
el 31 de Ag. de 2020
I want to control the x axis top and bottom individually / separately.
Specifically I want to point the bottom x axis ticks out and the top x axis ticks in ( and point left y axis out and right y axis in).
2 comentarios
dpb
el 30 de Ag. de 2020
The 'TickDirection' property is global for the X- and Y- axis objects; there's insufficient granularity of properties to modify one but not the other.
You could make two axes, and set one 'in' and one 'out', but then both would show anyway...
Don't see any way to do this other than to physically draw ticks where wanted if it's that important to go to the trouble.
Respuesta aceptada
J. Alex Lee
el 30 de Ag. de 2020
Actually, dpb's suggestion of 2 axes should work as long as you don't turn "box on", and you may need to sync their positions if you do things like add axis labels, etc.
fig = figure;
ax(1) = axes(fig,'Color','none');
ax(2) = axes(fig,'Color','none');
ax(2).YAxisLocation = 'right';
ax(2).XAxisLocation = 'top';
ax(2).XAxis.TickDirection = 'out'
ax(1).YAxis.TickDirection = 'out'
1 comentario
dpb
el 30 de Ag. de 2020
" 2 axes should work as long as you don't turn "box on"
Ah-so! Indeed. Didn't think about box leaving off the opposite side ticks...good catch.
Más respuestas (1)
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels 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!