Skip to content

Commit

Permalink
Last fixes before release (#20)
Browse files Browse the repository at this point in the history
* Splitting fire, rainbow, jet to be individual images

* Adding bokeh usage example

* Don't align right

* Fixed typo
  • Loading branch information
jsignell authored Feb 14, 2019
1 parent cf776a0 commit 11f7540
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 5 deletions.
18 changes: 16 additions & 2 deletions doc/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,28 @@ in two formats:
..., \[1.0,1.0,1.0\] \], 256)

Import colorcet and use the new colormaps anywhere you would use a
regular colormap. For instance::
regular colormap.

**Matplotlib**::

import numpy as np
import matplotlib.pyplot as plt
import colorcet as cc
import matplotlib.pyplot as plt

xs, _ = np.meshgrid(np.linspace(0, 1, 80), np.linspace(0, 1, 10))
plt.imshow(xs, cmap=cc.cm.colorwheel); # use tab completion to choose

**Bokeh**::

import numpy as np
import colorcet as cc
from bokeh.plotting import figure, show

xs, _ = np.meshgrid(np.linspace(0, 1, 80), np.linspace(0, 1, 10))
p = figure(x_range=(0, 80), y_range=(0, 10), height=100, width=400)

p.image(image=[xs], x=0, y=0, dw=80, dh=10, palette=cc.fire) # use tab completion to choose
show(p)

If you have any questions, please refer to the `User Guide <../user_guide/index>`_
and if that doesn't help, feel free to post an issue on GitHub, question on stackoverflow,
Expand Down
Binary file added examples/assets/images/fire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/assets/images/fire_rainbow.png
Binary file not shown.
Binary file added examples/assets/images/hot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/assets/images/hot_jet.png
Binary file not shown.
Binary file added examples/assets/images/jet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/assets/images/rainbow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions examples/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"## Background\n",
"Apart from the four [uniform colormaps now provided with\n",
"matplotlib](http://matplotlib.org/users/colormaps.html), most\n",
"colormaps shipping with Python plotting Python programs are highly\n",
"colormaps shipping with Python plotting programs are highly\n",
"perceptually nonuniform. That is, small changes in data values\n",
"result in large changes in the perceptual appearance of the\n",
"corresponding colors, or vice versa. For instance, the popular matplotlib\n",
"\"hot\" and \"jet\" colormaps have long stretches where the apparent\n",
"colors change imperceptibly, such as the yellow region in \"hot\" and\n",
"the cyan/green region in \"jet\":\n",
"\n",
"![hot/jet](assets/images/hot_jet.png) \n",
"![hot](assets/images/hot.png) ![jet](assets/images/jet.png)\n",
"\n",
"When colormaps are used for visualizing scientific datasets, these\n",
"perceptual nonlinearities can make interpretation of this data very\n",
Expand All @@ -44,7 +44,7 @@
"perceptually uniform versions of the above colormaps are called \"fire\"\n",
"and \"rainbow\" in this package:\n",
"\n",
"![fire/rainbow](assets/images/fire_rainbow.png)\n",
"![fire](assets/images/fire.png) ![rainbow](assets/images/rainbow.png)\n",
"\n",
"You should be able to see the differences right away, revealing more\n",
"detail, more faithfully than if you use non-uniform maps. For\n",
Expand Down

0 comments on commit 11f7540

Please sign in to comment.