Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't 'imshow' DEM for some unkown reason #231

Open
ronativ opened this issue Oct 18, 2023 · 1 comment
Open

Can't 'imshow' DEM for some unkown reason #231

ronativ opened this issue Oct 18, 2023 · 1 comment

Comments

@ronativ
Copy link

ronativ commented Oct 18, 2023

Hi,

When using the following code:

fig, ax = plt.subplots(figsize=(8,6)) plt.imshow(grid.dem, extent=grid.extent, cmap='cubehelix', zorder=1) plt.colorbar(label='Elevation (m)') plt.title('Digital elevation map') plt.xlabel('Longitude') plt.ylabel('Latitude')

I get the following error:

AttributeError: 'sGrid' object has no attribute 'dem'

Even though I did use grid = Grid.from_raster('.../example/dem.tif')

Any thoughts on this issue?

Thanks!
R.

@everettsp
Copy link

The grid doesn't store the DEM, you have to load it separately using
dem = grid.read_raster('.../example/dem.tif')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants