Log scale differs between tiledlayout plots

Hi,
I would like to include a log y axis on the first four tiles (A-D) of my plot. Tile E-H do not need a log y axis. The log y axis should include both positive and negative values. The log axis works perfectly when plotting one boxplot tile (e.g. A only), but when using the tile function to plot all boxplots, the logs no longer display negative values on the y axis or are simply not a log axis anymore (C & D).

 채택된 답변

Voss
Voss 2023년 8월 18일
It may appear that plots C and D are not log y-axis, but that's only because MATLAB doesn't draw the small ticks under certain conditions (depending on the axes height and ylimits). They are still log-scale, they just don't show the small tick marks between the decades.
For example, with this figure size (height: 1000 pixels) plots C and D do not show the small ticks:
figure('Position',[1 1 1000 1000])
boxplots_logaxis
But with this figure size (height: 1500 pixels) plots C and D do show the small ticks (so they look like how you expect a log-scale axis should look):
figure('Position',[1 1 1000 1500])
boxplots_logaxis
Conclusion: make the figure taller in order to see the log axes ticks.
You're not going to be able to include negative values on a log-scale axis.

댓글 수: 2

Sophia
Sophia 2023년 8월 20일
Amazing, thank-you!
Voss
Voss 2023년 8월 20일
You're welcome!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Log Plots에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2023년 8월 18일

댓글:

2023년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by