merge remote repo

This commit is contained in:
2019-06-22 22:40:27 +10:00
6 changed files with 87 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import numpy as np
import matplotlib.pyplot as plt
# data = np.random.randn(1000)
# plt.hist(data, bins=50)
# plt.show()
mean = [0, 0]
cov = [[1, 1], [1, 2]]
x, y = np.random.multivariate_normal(mean, cov, 10000).T
# plt.hist2d(x, y, bins=30, cmap="Blues")
plt.hexbin(x, y, gridsize=30, cmap="Oranges")
cb = plt.colorbar()
cb.set_label("counts in bin")
plt.show()
+20
View File
@@ -0,0 +1,20 @@
import numpy as np
import matplotlib as matl
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import Image
plt.style.use("seaborn-whitegrid")
x = np.linspace(0, 10, 100)
figure = plt.figure()
ax = plt.axes()
plt.plot(x, np.sin(x), "-", label="sin(x)")
plt.plot(x, np.cos(x), "o", label="cos(x)")
plt.legend()
plt.show(block=True)
+14
View File
@@ -0,0 +1,14 @@
import matplotlib.pyplot as plt
import numpy as np
rng = np.random.RandomState(0)
for marker in ["o", ".", ",", "x", "+", "v", "^", "<", ">", "s", "d"]:
plt.plot(rng.rand(5), rng.rand(5), marker, label="marker='{0}'".format(marker))
plt.legend(numpoints=1)
plt.xlim(0, 2)
plt.show()
+13
View File
@@ -0,0 +1,13 @@
import matplotlib.pyplot as plt
import numpy as np
rng = np.random.RandomState(0)
x = rng.randn(100)
y = rng.randn(100)
colors = rng.rand(100)
sizes = 1000 * rng.rand(100)
plt.scatter(x, y, c=colors, s=sizes, alpha=0.5, cmap="viridis")
plt.colorbar() # show color scale
plt.show()
+24
View File
@@ -0,0 +1,24 @@
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("seaborn-whitegrid")
x = np.linspace(0, 10, 100)
figure = plt.figure()
ax = plt.axes()
sub1 = plt.subplot(2, 2, 1)
sub1.plot(x, np.sin(x), "-", label="sin(x)")
sub1.legend()
sub2 = plt.subplot(2, 2, 2)
sub2 = plt.plot(x, np.cos(x), "o", label="cos(x)")
sub2 = plt.legend()
plt.subplot(2, 2, 3)
plt.plot(x, np.tan(x), "-", label="tan(x)")
plt.legend()
plt.show(block=True)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB