20
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

matplotlibの2次元マップで色を指定する

Posted at

matplotlibで色を指定するにはcmapを指定します

import numpy as np
import matplotlib.pyplot as plt

x = np.random.random((100, 100))
plt.imshow(x, cmap="GnBu")
plt.colorbar()

tmp.png

ここではGnBu(Green-Blueだとおもう)を指定しましたが、他にもさまざまな色が定義されています:
http://matplotlib.org/examples/color/colormaps_reference.html

これらの多くには逆向きの色が用意されています(_rを後ろにつける:gray_rとか)

20
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?