1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
--- a/examples/inverse_transform_example.py
+++ b/examples/inverse_transform_example.py
@@ -41,7 +41,6 @@
plt.scatter(
trans.embedding_[:, 0],
trans.embedding_[:, 1],
- c=mnist.target,
cmap="Spectral",
s=0.25,
)
@@ -58,3 +57,4 @@
ax[i, j].get_yaxis().set_visible(False)
plt.show()
+plt.close()
--- a/examples/mnist_torus_sphere_example.py
+++ b/examples/mnist_torus_sphere_example.py
@@ -32,6 +32,7 @@
trans.embedding_[:, 0], trans.embedding_[:, 1], c=y_train, cmap="Spectral"
)
plt.show()
+ plt.close()
if "torus" in target_spaces:
# embed onto a torus
@@ -86,7 +87,7 @@
x, y, z, y_train, colormap="spectral", scale_mode="none", scale_factor=0.1
)
- mlab.show()
+ mlab.savefig('torus.png')
if "sphere" in target_spaces:
# embed onto a sphere
@@ -117,4 +118,4 @@
x, y, z, y_train, colormap="spectral", scale_mode="none", scale_factor=0.2
)
- mlab.show()
+ mlab.savefig('sphere.png')
--- a/examples/mnist_transform_new_data.py
+++ b/examples/mnist_transform_new_data.py
@@ -35,10 +35,10 @@
fig, ax = plt.subplots(1, 2, sharex=True, sharey=True, figsize=(12, 10))
ax[0].scatter(
- embedding_train[:, 0], embedding_train[:, 1], c=y_train, cmap="Spectral" # , s=0.1
+ embedding_train[:, 0], embedding_train[:, 1], cmap="Spectral" # , s=0.1
)
ax[1].scatter(
- embedding_test[:, 0], embedding_test[:, 1], c=y_test, cmap="Spectral" # , s=0.1
+ embedding_test[:, 0], embedding_test[:, 1], cmap="Spectral" # , s=0.1
)
plt.setp(ax[0], xticks=[], yticks=[])
plt.setp(ax[1], xticks=[], yticks=[])
@@ -46,3 +46,4 @@
ax[0].set_title("Training Set", fontsize=12)
ax[1].set_title("Test Set", fontsize=12)
plt.show()
+plt.close()
|