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
Changes from 2 commits
0b0d285
f4d59bf
d4e6824
0966ed0
b1554a3
03ee21f
4cef9af
7d48ee0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Data | ||
---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
====================== | ||
General purpose images | ||
====================== | ||
|
||
""" | ||
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ``ax[i].axis('off')```to gain some space in a crowded figure? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General-purpose