Comments (3)
Hey there. Working on that in #34
from geoplot.
As of #114, markerfacecolor
and markeredgecolor
are now propagated to the legend when you pass color
/facecolor
and/or edgecolor
parameters to your plot.
Sorry to have left this issue open for so long. There are a ton of improvements to geoplot
coming out in the next 0.3.0 release, which fixes many many longstanding issues like this and others, you should check it out again once it's done.
from geoplot.
Following up to say that this is now addressed more directly by #127.
On geoplot@master
you can now pass marker*
arguments to legend_kwargs
(specifically: {marker
, markersize
, markeredgecolor
, markeredgewidth
, markerfacecolor
}), and those parameters will be passed to the legend markers.
For example, here is a code snippet demonstrating the current defaults:
import geopandas as gpd
import geoplot as gplt
import geoplot.crs as gcrs
continental_usa_cities = gpd.read_file(gplt.datasets.get_path('usa_cities'))
continental_usa_cities = continental_usa_cities.query('STATE not in ["AK", "HI", "PR"]')
contiguous_usa = gpd.read_file(gplt.datasets.get_path('contiguous_usa'))
ax = gplt.pointplot(
continental_usa_cities, projection=gcrs.AlbersEqualArea(),
scale='POP_2010', limits=(2, 30), hue='POP_2010',
legend=True, legend_var='scale', legend_labels=range(1,6)
)
gplt.polyplot(contiguous_usa, ax=ax)
We can fiddle with the legend marker params to get something very different:
import geopandas as gpd
import geoplot as gplt
import geoplot.crs as gcrs
continental_usa_cities = gpd.read_file(gplt.datasets.get_path('usa_cities'))
continental_usa_cities = continental_usa_cities.query('STATE not in ["AK", "HI", "PR"]')
contiguous_usa = gpd.read_file(gplt.datasets.get_path('contiguous_usa'))
ax = gplt.pointplot(
continental_usa_cities, projection=gcrs.AlbersEqualArea(),
scale='POP_2010', limits=(2, 30), hue='POP_2010',
legend=True, legend_var='scale', legend_labels=range(1,6),
legend_kwargs={
'markeredgecolor': 'gray',
'markeredgewidth': 3,
'markerfacecolor': 'lightgray',
'marker': '*'
}
)
gplt.polyplot(contiguous_usa, ax=ax)
Hope that helps. 😄
from geoplot.
Related Issues (20)
- projection=gcrs.OSGB() sometimes creates a blank plot HOT 1
- Pin geopandas version? HOT 2
- cProfiling geoplot vs Cartopy vs GeoPandas: puzzling results HOT 2
- Typo in UserWarnings
- geoplot installed but geoplot.crs is not found HOT 4
- Legends in Geoplot 0.4.4 HOT 1
- Unable to install geoplot with pipenv under Ubuntu 20.04LTS HOT 1
- Grey boxes when clipping data with kdeplot HOT 8
- geoplot.kdeplot --> overlapping isolines HOT 8
- Fix KDEPlot hue tests HOT 6
- Voronoi plot fails with Value Error: Points cannot contain Nan HOT 4
- Does geoplot only work with EPSG:4326 unless the projection argument is set?
- Tests fail with geopandas 0.11
- Feature request? Apply pointplot "hue" to edgecolor only
- ModuleNotFoundError: No module named 'matplotlib.axes._subplots' HOT 1
- AttributeError: 'MultiPolygon' object has no attribute 'exterior' / TypeError: 'MultiPolygon' object is not iterable HOT 2
- kdeplot not working when fill=True HOT 2
- New Feature request - question: Bivariate choropleth?
- Exporting a KDEPlot as KML
- Documentation Update: shade is deprecated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geoplot.