Subplots with axes of same scale but different lengths

조회 수: 12 (최근 30일)
Rosalie Tostevin
Rosalie Tostevin 2019년 2월 14일
댓글: Star Strider 2019년 2월 14일
I'm trying to plot some geological data. I have multiple subplots in the same figure, representing similar geological units sampled at different locations. Each section has a different height. I want all the subplots to have the same scale (i.e. 1 cm = 100 m), but since the sections are all different heights, the axes will end up being different lengths. I can't work out how to do this! Thanks
  댓글 수: 1
Rik
Rik 2019년 2월 14일
Try to make a MWE so we can run your code without any other dependencies and can reproduce your issue. It is easier to edit existing code with feasible data. If you generate random data, you can make sure the magnitudes are more or less correct.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2019년 2월 14일
I am not certain what you are asking. If you want all the subplots to have the same axis limits, use the axis (link) function. You can also set the axis limits individually with xlim and ylim (linked to in that page).
  댓글 수: 4
Rosalie Tostevin
Rosalie Tostevin 2019년 2월 14일
This works perfectly - thank you!!
Star Strider
Star Strider 2019년 2월 14일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by