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

Include / document / improve single-colour chart options #2

Closed
asongtoruin opened this issue May 4, 2020 · 1 comment
Closed

Include / document / improve single-colour chart options #2

asongtoruin opened this issue May 4, 2020 · 1 comment

Comments

@asongtoruin
Copy link

Particularly when it comes to the bar charts, I can see the merit in making a chart using a single colour for the bars (indeed, I can see the merit in that being the default behaviour). I can't quite work out whether this is possible at present.

I guess from the definition of get_colours() it should be, if you provided cmap as a list containing a single colour?

https://github.com/JackMcKew/pandas-alive/blob/ac770eecb2173e2d06fa852b0d65c03674f18b98/pandas_alive/charts.py#L110-L125

At a minimum it'd be nice to document this if it is possible, and maybe rework it to make it a little easier to just use one colour.

@JackMcKew
Copy link
Owner

This functionality is included in 6b62992

Use-case: df.plot_animated(cmap='b')

Example output:

vlc_MUuobJlQGM

https://github.com/JackMcKew/pandas-alive/blob/6b629924f0637d8c28d5323750a6c73571a76792/pandas_alive/charts.py#L110-L117

If a string is passed through the cmap keyword, and is not a defined colormap, this will then search the base colours of matplotlib and generate a repeating list of the RGB of this colour

Supported single colours:
https://matplotlib.org/2.0.2/api/colors_api.html

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