Still curious if there's an answer, but I solved my problem by plotting a horizontal line, plotting vertical bars for tick marks, text() for the tick labels, and setting x-axis color to none.
xticks not working with logscale axis
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'd like to show a log scale number line with some non-overlapping rectangles spanning the line. I'm having issues with showing only a subset of tick marks of the xlim range that I set. Despite specifying the xticks, all the ticks are shown (as would be if 'auto' was used). There's no issue if the xscale is linear, so I'm wondering if this is a bug.
Probably not relevant, I'm choosing to label only a few tick marks.
figure
% rectangle(...)
xlim([0.8 1100])
x_s = [(1:9)*10^0 (1:9)*10^1, (1:9)*10^2, 10^3]';
xticks(x_s)
x_labels = repmat({''},length(x_s),1);
x_labels([1, 10, 19, 28]) = num2cell([1 10 100 1000]);
xticklabels(x_labels)
set(gca, 'XScale','log')
0 Kommentare
Antworten (1)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!