Logscale x axis of stacked bar chart, how to make the chart shows clearer results?

2 views (last 30 days)
Hi all,
I have some data, and I'd like to plot them into horizontal bar charts with log scale on x-axis. I wrote some code like this:
data1a = 63752;
data1b = 14122;
data1c = 48066 - 239;
data1d = 452 + 239;
data1e = data1a - data1b - data1c - data1d;
data2b = 10609 - 10193;
data2d = 10193;
data3 = data2d / 1620 * 1089 * 20;
dataAll = [data2d data2b 0 0; data3 data2b 0 0; data1d data1b data1e data1c ];
h = barh(dataAll, 'stacked');
set(gca,'xscale','log')
Among these variables, value and sequence of them cannot be changed. The plot is like this:
As you can see, data2b in bar 1 and 2 are tiny (invisible in bar 2), as well as data1e in bar 3, but data1e is not too bad. I know their values are small and it's plotted in log scale, but can I plot it better, i.e. make data2b more visible?
Many thanks!
  1 Comment
dpb
dpb on 4 Sep 2018
When relative magnitudes are <1:1000, it's just not going to show up much any way you try to display it with the full range of the data on one axes. You could set
ylim([100 2E5])
to at least use what blank space there is on the RH side of the present figure, but that isn't enough to make a significant difference in the overall appearance.
Only thing I think of that you could try would be to "blow up" a subsection of the x-axis as an inset (difficult to do w/ Matlab, unfortunately as an illusion of magnifying glass) and set the xlim([1.3E5 1.4E5]) for that small section.

Sign in to comment.

Answers (0)

Categories

Find more on Discrete Data Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!