question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should we override the matplotlib color shorthands?

See original GitHub issue

Matplotlib lets you specify colors like "b" for blue, "r" for red, etc. which is nice. But, those colors are mapped to the corners of RGB space, which, bleh.

This is additionally problematic as some functions (like plt.scatter) hardcode these values as default.

It occurs to me that seaborn could override this by messing with the values in the mpl.colors.ColorConverter.colors dictionary. But that might be too much manipulation?

Opening this issue for discussion.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:27 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
shoyercommented, Sep 16, 2014

For what it’s worth, I think this would be fine (and appreciated). Users who are concerned preserving the exact original styling of their matplotlib figures won’t be using import seaborn anyways.

0reactions
alexbwcommented, Dec 8, 2014

Thanks, I see the fix in 0.5.1, sorry to muddle the current thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

matplotlib.pyplot.plot — Matplotlib 2.1.2 documentation
Line styles and colors are combined in a single format string, as in 'bo' for blue circles. The kwargs can be used to...
Read more >
Increment matplotlib color cycle - python - Stack Overflow
There must be a shorthand way to instruct the second plot to increment the color cycle rather than explicitly giving the color. It...
Read more >
How To Change Line Color In Matplotlib - YouTube
This video talks about the various ways to set line color in Matplotlib.Blog: http://www.shwetalodha.in/Medium: ...
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
Just as we use the np shorthand for NumPy and the pd shorthand for Pandas, we will use some standard shorthands for Matplotlib...
Read more >
Line plot styles in Matplotlib - GeeksforGeeks
The following line styles are available in Matplotlib: ... Color code abbreviations that can be used along with the line styles: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found