Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions prettyplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
import matplotlib as mpl
from matplotlib import cm

from cycler import cycler


# Get Set2 from ColorBrewer, a set of colors deemed colorblind-safe and
Expand All @@ -18,11 +18,11 @@

#class Common(object):
# def __init__(self):
set2 = brewer2mpl.get_map('Set2', 'qualitative', 8).mpl_colors
set2 = brewer2mpl.get_map('Set2', 'qualitative', 8).hex_colors

# Another ColorBrewer scale. This one has nice "traditional" colors like
# reds and blues
set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors
set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).hex_colors

# A colormapcycle for stacked barplots
stackmaps = [brewer2mpl.get_map('YlGn', 'sequential', 8).mpl_colormap,
Expand All @@ -31,7 +31,7 @@
# This context-decorator makes it possible to change the color cycle inside
# prettyplotlib without affecting pyplot
class _pretty:
rcParams = {'axes.color_cycle': set2, 'lines.linewidth': .75}
rcParams = {'axes.prop_cycle': cycler(color=set2), 'lines.linewidth': .75}
mpl_contexts = []

def __call__(self, func):
Expand Down