Skip to content

Commit

Permalink
boxplot colors
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnfarrell committed Sep 15, 2015
1 parent 5263b7d commit 70204f5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pandastable/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def plot2D(self):
'kind','rot','logx'],
'density': ['alpha', 'colormap', 'grid', 'legend', 'linestyle',
'linewidth', 'marker', 'subplots', 'rot', 'kind'],
'boxplot': ['rot', 'grid', 'logy'],
'boxplot': ['rot', 'grid', 'logy','colormap','alpha','linewidth'],
'scatter_matrix':['alpha', 'linewidth', 'marker', 'grid', 's'],
}

Expand Down Expand Up @@ -320,7 +320,16 @@ def _doplot(self, data, ax, kind, subplots, kwargs):
for a in self.fig.axes:
a.set_ylim(lims)
elif kind == 'boxplot':
axs = data.boxplot(ax=ax, rot=kwargs['rot'], grid=kwargs['grid'])
axs = data.boxplot(ax=ax, rot=kwargs['rot'], grid=kwargs['grid'],
patch_artist=True)
lw = kwargs['linewidth']
plt.setp(axs['boxes'], color='black', lw=lw)
plt.setp(axs['whiskers'], color='black', lw=lw)
plt.setp(axs['fliers'], color='black', marker='+', lw=lw)
cmap = plt.cm.get_cmap(kwargs['colormap'])
clr = cmap(0.5)
for patch in axs['boxes']:
patch.set_facecolor(clr)
#boxplot won't accept required kwargs?
if kwargs['logy'] == 1:
ax.set_yscale('log')
Expand Down

0 comments on commit 70204f5

Please sign in to comment.