How can I create a figure with a pie chart and a bar in the same window using subplot
3 views (last 30 days)
Show older comments
How can I create a figure with a pie chart and a bar in the same window using subplot? I haven't used any inbuilt functions and I just want to know how to get them in the same window with different axis
0 Comments
Accepted Answer
KSSV
on 28 Nov 2017
X = [1 3 0.5 2.5 2];
figure
subplot(121)
bar(X)
subplot(122)
pie(X)
2 Comments
KSSV
on 28 Nov 2017
Read about subplot https://in.mathworks.com/help/matlab/ref/subplot.html. It specifies the position of the sub-plot.
More Answers (0)
See Also
Categories
Find more on Pie Charts 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!