Customizing scale of x-axis
18 ビュー (過去 30 日間)
古いコメントを表示
Hello there,
I want to make a graph comparing my brother's hearing loss progress between the years. So far, so good.

However, audiograms generally have custom x-axis spacing between their values (they double for each interval). The spacing between 250 and 500 is the same as 500 to 1000, which is the same as 1000 to 2000, and so on, like the image shown below. How can I make this?

Thanks in advance.
0 件のコメント
採用された回答
Adam Danz
2021 年 6 月 2 日
編集済み: Adam Danz
2021 年 6 月 2 日
Set the XScale to log and then specify the x-ticks.
Demo:
x = [250 500 1000 1500 3000 4000 6000 8000];
y = rand(size(x));
ax = gca();
plot(ax, x,y,'--ok')
xticks = [250 500 1000 2000 4000 8000];
set(ax, 'XScale','log','XLim',[250,10000],...
'XTick',xticks,'XMinorTick','off')
grid(ax,'on')
ax.MinorGridLineStyle = 'none';
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Title についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
