How to continue drawing bar charts on the basis of drawing maps

How to continue drawing bar charts on the basis of drawing maps using MATLAB softwore? Just like this one.

4 Comments

Hi Hongyun,
To answer your question,
Import the PNG map using imread function.
% Import the PNG map
map = imread('your_map.png');
Display the map using imshow.
% Display the map
imshow(map);
hold on;
Plot the bar chart on top of the map using bar function.
% Define data for the bar chart
data = [10, 20, 15, 25];
% Plot the bar chart on the map
bar(data);
Adjust the bar chart properties like color, width, and spacing to enhance visualization.
% Customize bar chart properties title('Bar Chart on Map'); xlabel('Categories'); ylabel('Values'); legend('Data');
If you follow these steps, you can seamlessly integrate bar charts with maps in MATLAB for effective data visualization. Please let me know if you have any further questions.
You may have misunderstood me
Hi Hongyun,
"continue drawing bar charts on the basis of drawing maps" is not clear.
Could you explain what you are trying to do ?
What I mean is to first use MATLAB to draw a map of China that includes 30 provinces, and then use a bar chart to plot the gender ratio of these 30 provinces on the map. Just like this one

Sign in to comment.

 Accepted Answer

Jatin
Jatin on 17 Jul 2024
Moved: Voss on 17 Jul 2024
Hi Hongyun,
You might want to have a look at this Merging a bar chart with a map, which does exactly that.

3 Comments

Thank you so much. I have obtained the perfect score answer I wanted.
Hi Hongyun,
Glad to know that your problem is resolved. Please give vote to Jatin and accept his answer for his efforts. Please let us know if you still have any further questions, we will be happy to help you out. Good luck!
Thankyou Ayush and Jatin for your contributions.
Thanks for Ayush, Jatin Voss and Umar.

Sign in to comment.

More Answers (0)

Products

Release

R2024a

Asked:

on 17 Jul 2024

Commented:

on 18 Jul 2024

Community Treasure Hunt

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

Start Hunting!