Scatter Plot with multiple 'levels' on the Xaxis
8 ビュー (過去 30 日間)
古いコメントを表示
Hello Everyone,
I am trying to make a relatively complex plot.
Can the community please help me - I would like to have multiple 'levels' of X axis?
To explain myself better, below is the desired result (image) and attached is the example data (with constrains noted in the excel)....

Thank you.
Bharat
0 件のコメント
回答 (1 件)
Adam Danz
2021 年 2 月 11 日
編集済み: Adam Danz
2021 年 2 月 11 日
I see two options.
1. Since the "test" and country labels are vertically stacked, you could set multiple rows of x-tick labels for those labels and single rows for the other tick labels, all in the same line of code.
ticks = {'1' 'Test' '10' '1' 'Test' '10' '1' 'Test' '10' '1' 'Test' '10'; ...
'' 'USA' '' '' 'Mexico' '' '' 'Canada', '' 'Peru' ''};
2 件のコメント
Adam Danz
2021 年 2 月 15 日
If you want the axes to be bordering each other, you can achieve that by setting axes directly with axes().
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!