Log scale differs between tiledlayout plots

5 views (last 30 days)
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).

Accepted Answer

Voss
Voss on 18 Aug 2023
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.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!