putting colour onto map

1 visualización (últimos 30 días)
lala land
lala land el 16 de Mayo de 2022
Respondida: Prathamesh el 6 de Jun. de 2025
I imported a world map picture(bmp) using imread and show it using imshow. The map picture is currently black(value of black is zero). After I imported this, there is a uint8 file in the workspace that shows different numbers. for example, asia is 1, africa is 2 and so on and background is 0. I have the colorbar from 0 to 255 (black to white). I am supposed to put different shade of the colour bar onto the map from ascending order. For example, asia has the largest population so the colour is 255 for asia region. As the population decreases, the shade also decreases from 255 to 0 for different regions.
  2 comentarios
KSSV
KSSV el 16 de Mayo de 2022
Attach your image.
Tantalic Oak
Tantalic Oak el 20 de Mayo de 2022
This is the image

Iniciar sesión para comentar.

Respuestas (1)

Prathamesh
Prathamesh el 6 de Jun. de 2025
Hi,
I understand that there is a world map black image and you have a unit8 file which labels regions with different numbers. You want to put different shades of black and white on the map from 255 to 0 based on the population of that region.
You can follow these steps:
  • The uint8 file assigns a unique numerical ID to each region.
  • Provide the population value for each of these numerical region IDs.
  • Mathematically scale these population values to the full shade range of 0 to 255. The region with the highest population will be assigned the brightest shade (255), and the lowest population will be assigned the darkest shade (0). Populations in between will receive proportionally distributed shades.
  • Create a new map where each region is colored with its assigned shade, visually representing its population relative to others.
Refer below MATLAB Answer for detailed implementation:

Categorías

Más información sobre Color and Styling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by