Scatter Plot with multiple 'levels' on the Xaxis
조회 수: 9 (최근 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!