How to change the Xtick direction of ONLY one of the two (top or bottom) X-axis lines ?
8 views (last 30 days)
Show older comments
The following example shows two thick X-axis lines, one at the bottom and one at the top.
I would like to set the "TickDirection" as "Out" for the bottom X-axis line, and still keep the "TickDirection" as "In" for the top X-axis line.
How to do it?
% my plot
ax = gca;
xax = ax.XAxis;
dpb on 16 Mar 2023
% my plot
hAx1 = gca;
And you see you still have the ticks on the opposite side of each the X- and Y- axes. HG2 (Handle Graphics 2) doesn't have the granularity to control the tick marks individually; either they show if 'Box' is 'on' or they don't if 'off'.
You would have to draw either ticks or the outer box manually to create the effect you're after, unfortunately.
More Answers (1)
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!