8000 MEP 12: Gallery cleanup and reorganization by tonysyu · Pull Request #1623 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MEP 12: Gallery cleanup and reorganization #1623

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

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
31c4b57
STY: Refactor string formatting/templating
tonysyu Dec 18, 2012
a16e793
Clean-up and move scatter_demo
tonysyu Dec 18, 2012
a22ed53
Cleanup and move fill_demo
tonysyu Dec 18, 2012
48caac8
Cleanup and move pie_demo
tonysyu Dec 18, 2012
7f1887b
Cleanup and move errorbar_demo.
tonysyu Dec 18, 2012
b10a877
Cleanup and move fill_demo2
tonysyu Dec 18, 2012
6995e54
Cleanup and move histogram_demo
tonysyu Dec 18, 2012
48fab58
Cleanup and move hinton_demo
tonysyu Dec 18, 2012
e9bfbb9
Cleanup and move image_demo3.py
tonysyu Dec 18, 2012
87aba29
DOC: Minor rewording
tonysyu Dec 21, 2012
c0f42d7
Fix doc build to search in new example sections.
tonysyu Dec 21, 2012
e244d9b
Cleanup and move subplot_demo
tonysyu Dec 21, 2012
002ca7a
Update example section titles
tonysyu Dec 21, 2012
402b301
Cleanup and move unicode_demo
tonysyu Dec 21, 2012
529d9f7
Consolidate histogram examples
tonysyu Dec 22, 2012
6acc43a
Cleanup and move vertical_ticklabels demo
tonysyu Dec 22, 2012
7f7c013
Cleanup and move clippath_demo
tonysyu Dec 23, 2012
ab417eb
Rename imshow_demo to image_demo
tonysyu Dec 23, 2012
5a77ad8
Cleanup and move polar_bar demo
tonysyu Dec 23, 2012
e4dce4e
Cleanup and move polar scatter demo
tonysyu Dec 23, 2012
cc18501
Cleanup and move text themes demo
tonysyu Dec 23, 2012
d02d560
Cleanup and move path_patch demo
tonysyu Dec 23, 2012
ec8a487
Clean up and move integral demo
tonysyu Dec 23, 2012
acc69cc
Extract spines_demo_bounds from spine_placement_demo
tonysyu Dec 23, 2012
800deb4
Extract spines_demo from spine_placement_demo
tonysyu Dec 23, 2012
edce62b
Cleanup integral_demo
tonysyu Dec 23, 2012
405cbc5
Cleanup and move dash_control demo
tonysyu Dec 23, 2012
30a85ba
Clean up and move color_cycle demo
tonysyu Dec 24, 2012
7175e06
Tweak subplot layout to prevent label clipping
tonysyu Dec 24, 2012
5020952
Add colormap references based on show_colormaps
tonysyu Dec 24, 2012
fae23d6
Clean up and move artist demo
tonysyu Dec 24, 2012
abfdea4
Clean up and move streamplot demos
tonysyu Dec 24, 2012
8f4be5b
Combine colormap reference examples
tonysyu Dec 24, 2012
917c329
Clean up and move barh_demo
tonysyu Dec 24, 2012
1e579d8
STY: Combine declarations of example directories
tonysyu Dec 30, 2012
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
Prev Previous commit
Next Next commit
Combine colormap reference examples
  • Loading branch information
tonysyu committed Dec 24, 2012
commit 8f4be5bdffecb37bda6d8208d33cce83252ae3c3
2 changes: 1 addition & 1 deletion doc/users/image_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ object:

There are many other colormap schemes available. See the `list and
images of the colormaps
<http://matplotlib.org/examples/pylab_examples/show_colormaps.html>`_.
<http://matplotlib.org/examples/color/colormaps_reference.html>`_.

.. _`Color Bars`:

Expand Down
2 changes: 1 addition & 1 deletion doc/users/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ Other improvements

* Pim Schellart added a new colormap called "cubehelix".
Sameer Grover also added a colormap called "coolwarm". See it and all
other colormaps :ref:`here <pylab_examples-show_colormaps>`.
other colormaps :ref:`here <color-colormaps_reference>`.

* Many bug fixes and documentation improvements.

Expand Down
79 changes: 79 additions & 0 deletions examples/color/colormaps_reference.py
8000
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
"""
Reference for colormaps included with Matplotlib.

This reference example shows all colormaps included with Matplotlib. Note that
any colormap listed here can be reversed by appending "_r" (e.g., "pink_r").
These colormaps are divided into the following categories:

Sequential:
These colormaps are approximately monochromatic colormaps varying smoothly
between two color tones---usually from low saturation (e.g. white) to high
saturation (e.g. a bright blue). Sequential colormaps are ideal for
representing most scientific data since they show a clear progression from
low-to-high values.

Diverging:
These colormaps have a median value (usually light in color) and vary
smoothly to two different color tones at high and low values. Diverging
colormaps are ideal when your data has a median value that is significant
(e.g. 0, such that positive and negative values are represented by
different colors of the colormap).

Qualitative:
These colormaps vary rapidly in color. Qualitative colormaps are useful for
choosing a set of discrete colors. For example::

color_list = plt.cm.Set3(np.linspace(0, 1, 12))

gives a list of RGB colors that are good for plotting a series of lines on
a dark background.

Miscellaneous:
Colormaps that don't fit into the categories above.

"""
import numpy as np
import matplotlib.pyplot as plt


cmaps = [('Sequential', ['binary', 'Blues', 'BuGn', 'BuPu', 'gist_yarg',
'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd',
'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu',
'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']),
('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper',
'gist_gray', 'gist_heat', 'gray', 'hot', 'pink',
'spring', 'summer', 'winter']),
('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr',
'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'seismic']),
('Qualitative', ['Accent', 'Dark2', 'hsv', 'Paired', 'Pastel1',
'Pastel2', 'Set1', 'Set2', 'Set3', 'spectral']),
('Miscellaneous', ['gist_earth', 'gist_ncar', 'gist_rainbow',
'gist_stern', 'jet', 'brg', 'CMRmap', 'cubehelix',
'gnuplot', 'gnuplot2', 'ocean', 'rainbow',
'terrain', 'flag', 'prism'])]


nrows = max(len(cmap_list) for cmap_category, cmap_list in cmaps)
gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))

def plot_color_gradients(cmap_category, cmap_list):
fig, axes = plt.subplots(nrows=nrows)
fig.subplots_adjust(top=0.95, bottom=0.01, left=0.2, right=0.99)
axes[0].set_title(cmap_category + ' colormaps', fontsize=14)

for ax, name in zip(axes, cmap_list):
ax.imshow(gradient, aspect='auto', cmap=plt.get_cmap(name))
pos = list(ax.get_position().bounds)
x_text = pos[0] - 0.01
y_text = pos[1] + pos[3]/2.
fig.text(x_text, y_text, name, va='center', ha='right', fontsize=10)

# Turn off *all* ticks & spines, not just the ones with colormaps.
for ax in axes:
ax.set_axis_off()

for cmap_category, cmap_list in cmaps:
plot_color_gradients(cmap_category, cmap_list)

plt.show()
32 changes: 0 additions & 32 deletions examples/color/colormaps_reference_diverging.py

This file was deleted.

27 changes: 0 additions & 27 deletions examples/color/colormaps_reference_miscellaneous.py

This file was deleted.

34 changes: 0 additions & 34 deletions examples/color/colormaps_reference_qualitative.py

This file was deleted.

32 changes: 0 additions & 32 deletions examples/color/colormaps_reference_sequential.py

This file was deleted.

32 changes: 0 additions & 32 deletions examples/color/colormaps_reference_sequential2.py

This file was deleted.

29 changes: 0 additions & 29 deletions examples/pylab_examples/show_colormaps.py

This file was deleted.

0