TransWikia.com

Is it possible to display the embed color palette of a TIFF file using earthPy?

Geographic Information Systems Asked on October 4, 2021

I try to display a map that I have created. This map embed a color palette that I can read in QGIS to obtain directly this kind of display :

enter image description here

I discovered recently that I can as well directly plot this image using earthPy.plot:

raster = pm.getGfcDir() + 'PU_glad_check.tif'

# Use rasterio to import the reprojected data as img
with rio.open(raster) as src:
    img = src.read()
    
ax = ep.plot_bands(
    img,
    title="Country boundaries",
    scale=False
)

But it’s displayed with a gray-scale from 0 to 255. I’ve been to this doc page that explains how to create a custom discrete legend but I’d like to extract it from my file.

Is there a way to use the embed color palette as in QGIS but in earthPy?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP