Created
July 8, 2016 15:02
-
-
Save szdr/55970f711d61080373fc9bbf6a124e33 to your computer and use it in GitHub Desktop.
カラーバー付き散布図
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.cm as cm | |
import matplotlib.pyplot as plt | |
if __name__ == '__main__': | |
N = 100 | |
X = np.random.rand(N, 2) | |
y = np.random.rand(N) * 2 - 1 | |
sc = plt.scatter(X[:, 0], X[:, 1], vmin=-1, vmax=1, c=y, cmap=cm.seismic) | |
plt.colorbar(sc) | |
plt.savefig("demo.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment