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 all 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
======================

The title of each image indicates the name of the function.

"""
import matplotlib.pyplot as plt
import matplotlib

from skimage import data

matplotlib.rcParams['font.size'] = 18

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


for name in images:
caller = getattr(data, name)
image = caller()
plt.figure()
plt.title(name)
if image.ndim == 2:
plt.imshow(image, cmap=plt.cm.gray)
else:
plt.imshow(image)

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

The title of each image indicates the name of the function.

"""
import matplotlib.pyplot as plt
import matplotlib

from skimage import data

matplotlib.rcParams['font.size'] = 18

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


for name in images:
caller = getattr(data, name)
image = caller()
plt.figure()
plt.title(name)
if image.ndim == 2:
plt.imshow(image, cmap=plt.cm.gray)
else:
plt.imshow(image)

plt.show()
46 changes: 46 additions & 0 deletions doc/examples/data/plot_specific.py
@@ -0,0 +1,46 @@
"""
===============
Specific images
===============

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

from skimage import data

matplotlib.rcParams['font.size'] = 18
Copy link
Member

Choose a reason for hiding this comment

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

I've just noticed that you don't set titles in this example. The font config doesn't really make sense then.

Copy link
Member

Choose a reason for hiding this comment

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

Other examples look great!

Copy link
Member Author

@sciunto sciunto Oct 3, 2018

Choose a reason for hiding this comment

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

It's just to keep the tics homogeneous...


######################################################################
#
# Stereo images
# =============


fig, axes = plt.subplots(1, 2, figsize=(8, 4))
ax = axes.ravel()

images = data.stereo_motorcycle()
ax[0].imshow(images[0])
ax[1].imshow(images[1])

fig.tight_layout()
plt.show()

######################################################################
#
# Faces and non-faces dataset
# ===========================
#
# A sample of 20 over 200 images is displayed.


fig, axes = plt.subplots(4, 5, figsize=(20, 20))
ax = axes.ravel()
images = data.lfw_subset()
for i in range(20):
ax[i].imshow(images[90+i], cmap=plt.cm.gray)
ax[i].axis('off')
fig.tight_layout()
plt.show()