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 comentarios

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

Iniciar sesión para comentar.

 Respuesta aceptada

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

3 comentarios

Hongyun
Hongyun el 17 de Jul. de 2024
Movida: Voss el 17 de Jul. de 2024
Thank you so much. I have obtained the perfect score answer I wanted.
Umar
Umar el 17 de Jul. de 2024
Movida: Voss el 17 de Jul. de 2024
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.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2024a

Etiquetas

Preguntada:

el 17 de Jul. de 2024

Comentada:

el 18 de Jul. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by