How do I make tick marks longer?

10 views (last 30 days)
I'm trying to make my tick marks on the x-axis longer so that they're easier to see. Here is my script for creating the figure and what it looks like currently:
figure;
% grey for the day, but you can change :)
semilogx(freq_axis, spectrum_day,'LineWidth', 1.5, 'Color', [0.5 0.5 0.5]);
hold on;
% black for the night
semilogx(freq_axis, spectrum_night,'LineWidth', 1.5, 'Color', [0 0 0]);
set(gca, 'fontsize', 12)
xlim([10 40000])
ylim([50 85])
xlabel('Frequency (Hz)')
ylabel('PSD (dB re 1 µPa^2/Hz)')
% inserts a legend on the plot
legend({'Daytime (06:00-19:00)', 'Nighttime (19:00-06:00)'});
legend ('Location', 'southeast', 'FontSize', 12);
legend boxoff;
hold off;

Accepted Answer

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 21 Feb 2022
Use these, e.g.:
plot(x, y);
ax=gca;
ax.TickLength = [0.05 0.05]; shg

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!