How to plot like this ?
Show older comments
I found an image from statista. I’d like to plot like that in matlab is it possible ?
3 Comments
Peter O
on 29 Sep 2020
It's possible, just not easy or practical, and I wouldn't advise trying it. The connected box chart lines is not a standard style in MATLAB, and a quick search suggests it isn't one in most other language's plotting engines either.
Is the image you posted auto-generated from Statista? It looks like they may have started with a bar chart, exported it, and added the text and connecting lines in Adobe Illustrator. That's a workflow you can certainly do with MATLAB (and Adobe). I'd suggest saving the bar chart as SVG, PDF, or EPS to make it easier to work with in the graphics program.
Adam Danz
on 29 Sep 2020
In Matlab, that plot can be reproduced by a bar plot plus 4 patch objects. You'll need to know the properties of bar objects to understand how the bar width and interval can be grabbed. From there, it's just figuring out how to use those values to compute the patch perimeters.
Alternatively, the entire plot could be produced with patch objects alone. I haven't thought about which approach would be easiest.
Jeevan Kumar Bodaballa
on 29 Sep 2020
Answers (0)
Categories
Find more on Annotations 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!