-
Notifications
You must be signed in to change notification settings - Fork 901
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
BUG: explore() using cmap
instead of color
attribute for *list-like of colors* when if column
and categorical
is set
#3194
Comments
Thanks for reporting this @turbotimon, I'll let @martinfleis suggest what the best option is in terms of merging into one keyword or supporting both properly as currently documented. |
|
I hope this is not intentional and also included in the plotting refactoring? As in my copy-paste example, it is very helpful to pass a list of colors along with a categorical column to give the categories a meaningful or more visible color compared to the map background. Anyway, let me know if I can help with something. |
The refactoring is not planned in detail yet but this use case will surely be included. |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of geopandas.
(optional) I have confirmed this bug exists on the main branch of geopandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
I was trying to set colors for a categorical plot but was not able doing so with
colors
(list-like of colors) as the docs say.Instead, after inspecting the source code, I saw that it is possible passing the list as
cmap
. BUT, this is not in the docs (only says str, matplotlib.Colormap, branca.colormap or function)Recomendation
colors
cmap
: str, matplotlib.Colormap, branca.colormap, function or array-likeHappy to do a MR for both (whatever you choose). However, in my opinion
colors
would be more consistent and intuitive.Output of
geopandas.show_versions()
SYSTEM INFO
python : 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
executable : /usr/bin/python3
machine : Linux-6.1.58+-x86_64-with-glibc2.35
GEOS, GDAL, PROJ INFO
GEOS : 3.11.2
GEOS lib : None
GDAL : 3.6.4
GDAL data dir: /usr/local/lib/python3.10/dist-packages/fiona/gdal_data
PROJ : 9.3.0
PROJ data dir: /usr/local/lib/python3.10/dist-packages/pyproj/proj_dir/share/proj
PYTHON DEPENDENCIES
geopandas : 0.13.2
numpy : 1.25.2
pandas : 1.5.3
pyproj : 3.6.1
shapely : 2.0.2
fiona : 1.9.5
geoalchemy2: None
geopy : 2.3.0
matplotlib : 3.7.1
mapclassify: 2.6.1
pygeos : None
pyogrio : None
psycopg2 : 2.9.9 (dt dec pq3 ext lo64)
pyarrow : 10.0.1
rtree : None
The text was updated successfully, but these errors were encountered: