How do I break y-axis to improve visualisation when plotting intervals as errorbars?
Mostra commenti meno recenti
I have the following set of data:
x = [1 2 3 4 5];
lower_bound = [7.41e-3 0.65 3.2e-4 2.1e-4 1.2e-4];
upper_bound = [9.35e-3 0.7 6.4e-4 2.4e-4 1.4e-4];
I have written some code to plot these vectors as intervals in a graph as follows:
subs = (upper_bound - lower_bound)/2;
num_inside = subs + lower_bound;
lb = abs(lower_bound - num_inside);
ub = abs(upper_bound - num_inside);
y = num_inside;
errorbar(x,y,lb,ub,'.')
So, how can I break the y-axis in such way that there is no too much wasted space in y-axis and that all the intervals are fairly visible?
I have tried the Breakplot function (https://blogs.mathworks.com/pick/2008/11/21/breaking-a-plot-to-improve-visualization/#3) however, I can only make it work to plot the intervals in the errorbar format.
P.D. If there is any other suggestion about how to plot intervals in matlab for good visualization I will appreciate it.
Risposte (1)
dpb
il 14 Mag 2019
"P.S. If there is any other suggestion about how to plot intervals in matlab for good visualization I will appreciate it."
For such widely disparate data sizes, I'd suggest
hAx=gca;
hAx.YScale='log';
xFact=0.25; % room-giving constant for x-axis boundaries
xlim([[x(1) x(end)]+[-1 1]*xFact)
hAx.XTicks=1:x(end);
I don't believe there's any linear axis that will be able to clearly amplify all the data across the range other than one for each order of magnitude which would be even more difficult for user to interpret than the log scale in my opinion...
1 Commento
Diego Estrada
il 15 Mag 2019
Categorie
Scopri di più su Errorbars in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!