Log scale differs between tiledlayout plots

5 次查看(过去 30 天)
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.

更多回答(0 个)

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by