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

Unable to change colors in python package #23

Closed
orijitghosh opened this issue Jan 9, 2023 · 1 comment
Closed

Unable to change colors in python package #23

orijitghosh opened this issue Jan 9, 2023 · 1 comment

Comments

@orijitghosh
Copy link

Hi, can I use different colors if I use it in a colab notebook? I am sorry for such a naive question. Great work on this easy implementation!

@chrieke
Copy link
Owner

chrieke commented Mar 2, 2023

Hi @orijitghosh, thank you for the question! You can change the color scheme via the draw_settings parameter of the Plot class.

from prettymapp.settings import STYLES
print(STYLES["Peach"])

would be

{'urban': {'cmap': ['#FFC857', '#E9724C', '#C5283D'],
  'ec': '#2F3737',
  'lw': 0.5,
  'zorder': 4},
 'water': {'fc': '#a1e3ff',
  'ec': '#85c9e6',
  'hatch': 'ooo...',
  'hatch_c': '#2F3737',
  'lw': 1,
  'zorder': 1},
 'grassland': {'fc': '#D0F1BF', 'ec': '#2F3737', 'lw': 1, 'zorder': 2},
 'woodland': {'fc': '#64B96A', 'ec': '#2F3737', 'lw': 1, 'zorder': 2},
 'streets': {'fc': '#2F3737', 'zorder': 3},
 'other': {'fc': '#F2F4CB', 'ec': '#2F3737', 'lw': 1, 'zorder': 3}}

Then you can switch out colors here. In the end feed it back to the Plot class like in the example

customized_draw_settings_dictionary = STYLES["Peach"].copy()
customized_draw_settings_dictionary["water"]["fc"] = '#64B96A'
fig = Plot(
    df=df,
    aoi_bounds=aoi.bounds,
    draw_settings=customized_draw_settings_dictionary
).plot_all()

@chrieke chrieke closed this as completed Mar 2, 2023
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