Plot bar chart with log scale on y axis
显示 更早的评论
Hello there,
I want to plot a group bar chart with differences about 10^-4 within the data, positiv and negativ. So the problem is, either I get a bar chart where just the big values are visible and the small ones disappear, or there is some trouble about plotting negative/postitiv data on a log scale.
I tried to add
set(axes1,'YScale','log')
in my code, but it doesn't work as expected, and i dont know which other options i got.
3 个评论
Rik
2019-7-16
A logarithmic scale doesn't work well when you need to cross the 0. Can you give a small example of your data and the intended output?
It may be the best solution to stick two axes together, one with the positive data and one for the negative.
Henrik Hembrock
2019-7-16
Rik
2019-7-16
Logarithmic scales don't play nice with mixing signs, so it is not entirely clear what you want as an end result. So can you try making an example in something like paint?
回答(1 个)
the cyclist
2019-7-16
编辑:the cyclist
2019-7-16
0 个投票
There are some good thoughts on how to handle this problem in response to this question. In particular, the accepted answer by Matt Tearle seems very useful.
You'll need to adapt to bar chart, but the concept is the same.
Notice that they are doing the log transformation on the X axis, not the Y.
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!