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

Colorbar only works for raster plots #557

Open
lwasser opened this issue Jun 9, 2020 · 0 comments · May be fixed by #572
Open

Colorbar only works for raster plots #557

lwasser opened this issue Jun 9, 2020 · 0 comments · May be fixed by #572
Assignees
Labels
enhancement New feature or request

Comments

@lwasser
Copy link

lwasser commented Jun 9, 2020

It's trying to run get_array on the figure but that doesn't return anything because it's a vector plot. ...

import earthpy.plot as ep
country_data_url = "https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip"
et.data.get_data(url=country_data_url)

# Create a path to the countries shapefile
countries_path = os.path.join("data", "earthpy-downloads",
                              "ne_10m_admin_0_countries", 
                              "ne_10m_admin_0_countries.shp")


gpd.read_file(countries_path)
# Create a path to the countries shapefile
countries_path = os.path.join("data", "earthpy-downloads",
                              "ne_10m_admin_0_countries", 
                              "ne_10m_admin_0_countries.shp")
f, ax1 = plt.subplots(figsize=(10,6))
im = countries.plot(column='POP_EST',
              ax=ax1)
ep.colorbar(im)
plt.show()
@lwasser lwasser added the enhancement New feature or request label Jun 15, 2020
@lwasser lwasser linked a pull request Mar 3, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants