Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show our data in the gallery #3388

Merged
merged 8 commits into from Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/examples/data/README.txt
@@ -0,0 +1,2 @@
Data
----
42 changes: 42 additions & 0 deletions doc/examples/data/plot_general.py
@@ -0,0 +1,42 @@
"""
======================
General purpose images
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General-purpose

======================

"""
import numpy as np
import matplotlib.pyplot as plt

from skimage import data


images = (
'astronaut',
'binary_blobs',
'camera',
'checkerboard',
'chelsea',
'clock',
'coffee',
'coins',
'horse',
'logo',
'page',
'text',
'rocket',
)

#'stereo_motorcycle'
#'lfw_subset',

fig, axes = plt.subplots(len(images), 1, figsize=(8, 4 * len(images)),
sharex=False, sharey=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't sharex/y False by default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can get ride of it.

ax = axes.ravel()

for i, image in enumerate(images):
caller = getattr(data, image)
ax[i].imshow(caller())
ax[i].set_title(image)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``ax[i].axis('off')```to gain some space in a crowded figure?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred to keep it as it gives an idea of the image size.


fig.tight_layout()
plt.show()
28 changes: 28 additions & 0 deletions doc/examples/data/plot_scientific.py
@@ -0,0 +1,28 @@
"""
=================
Scientific images
=================

"""
import numpy as np
import matplotlib.pyplot as plt

from skimage import data


images = ('hubble_deep_field',
'immunohistochemistry',
'moon',
)

fig, axes = plt.subplots(len(images), 1, figsize=(8, 4 * len(images)),
sharex=False, sharey=False)
ax = axes.ravel()

for i, image in enumerate(images):
caller = getattr(data, image)
ax[i].imshow(caller())
ax[i].set_title(image)

fig.tight_layout()
plt.show()