Skip to content

Commit 54f047a

Browse files
committed
Switch default colormap for scatterplot to 'Greys'
In #7780, I added colormap support to scatter, but choose to override the default rainbow colormap (7780#issuecomment-49533995). I'm now regreting choosing 'RdBu' as the default colormap. I think a simple black-white colormap is a more conservative and better default choice for coloring scatter plots -- binary colormaps really only make sense if the data is signed. 'Greys' is also the default colormap set by the seaborn package, and @mwaskom has done far more thinking about colormaps than I have. If possible, I would love to get this in before 0.15 is released, so we don't have to worry about changing how anyone's plots look. CC @sinhrks
1 parent 32c5016 commit 54f047a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/tests/test_graphics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1605,8 +1605,8 @@ def test_plot_scatter_with_c(self):
16051605
axes = [df.plot(kind='scatter', x='x', y='y', c='z'),
16061606
df.plot(kind='scatter', x=0, y=1, c=2)]
16071607
for ax in axes:
1608-
# default to RdBu
1609-
self.assertEqual(ax.collections[0].cmap.name, 'RdBu')
1608+
# default to Greys
1609+
self.assertEqual(ax.collections[0].cmap.name, 'Greys')
16101610

16111611
if self.mpl_ge_1_3_1:
16121612

pandas/tools/plotting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ def _make_plot(self):
14051405
cb = self.kwds.pop('colorbar', self.colormap or c in self.data.columns)
14061406

14071407
# pandas uses colormap, matplotlib uses cmap.
1408-
cmap = self.colormap or 'RdBu'
1408+
cmap = self.colormap or 'Greys'
14091409
cmap = plt.cm.get_cmap(cmap)
14101410

14111411
if c is None:

0 commit comments

Comments
 (0)