-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededkind: bugSomething isn't workingSomething isn't working
Description
The plot method from the ImageAccessor is plotting continuous images and has lots of difficulties to plot classified images. I tried to play with the cmap of the following graph but never managed to make it work:
landcover = ee.Image(
ee.ImageCollection("USGS/NLCD_RELEASES/2019_REL/NLCD")
.filter(ee.Filter.eq('system:index', '2016'))
.first()
.select('landcover')
)
roi = ee.Geometry.Polygon([[
[-121.214213, 39.102459],
[-121.214213, 39.109467],
[-121.199295, 39.109467],
[-121.199295, 39.102459],
[-121.214213, 39.102459]
]])
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
landcover.geetools.plot(bands = ["landcover"], ax=ax, region=roi)
ax.set_xlabel("Longitude")
ax.set_ylabel("Latitude")
ax.tick_params(axis='both', which='both', length=0, labelbottom=False, labelleft=False)
ax.set_title("Landcover over a random AOI")
fig.colorbar(ax.images[0], label="landcover")
plt.show()
If someone finds a way to create a class clolorbar then it should be added to the documentation else a PR will be welcomed in the source code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededkind: bugSomething isn't workingSomething isn't working
