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
Conversation
Hello @sciunto! Thanks for updating the PR.
Comment last updated on October 02, 2018 at 10:02 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #3388 +/- ##
==========================================
+ Coverage 86.81% 86.81% +<.01%
==========================================
Files 339 341 +2
Lines 27385 27412 +27
==========================================
+ Hits 23773 23798 +25
- Misses 3612 3614 +2
Continue to review full report at Codecov.
|
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.
I like the idea of displaying pictures of available images in the gallery. My only concern is that the thumbnails will be unreadable with a large number of subplots, maybe organize the images with several rows for the general-purpose images? I had a quick look at the gallery, 6 subplots is still OK, 9 is very crowded.
doc/examples/data/plot_general.py
Outdated
#'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 comment
The reason will be displayed to describe this comment to others. Learn more.
isn't sharex/y
False by default?
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.
Yes, I can get ride of it.
doc/examples/data/plot_general.py
Outdated
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 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?
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.
I preferred to keep it as it gives an idea of the image size.
doc/examples/data/plot_general.py
Outdated
@@ -0,0 +1,42 @@ | |||
""" | |||
====================== | |||
General purpose images |
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
You are absolutely right for the thumbnail. It's an issue. The idea I got in the mean time to solve this is to take one image as an example for the thumbnail, and then display them all. I'm afraid that, even if we succeed in generating a correct rendering, the future additions will destroy it anyway. |
@sciunto you can do that by displaying a first image in the example, and then the whole subplots. I don't remember if sphinx-gallery takes the first or the last figure for the thumbnail, and whether it can be configured. The doc of sphinx-gallery is quite thorough, but its organization is sometimes a bit weird. |
It's now ready for reviews. |
@scikit-image/core Anyone for reviewing this please? |
The added gallery examples don't seem to show up under "Examples using ..." sections of skimage.data (i.e. http://scikit-image.org/docs/dev/api/skimage.data.html#examples-using-skimage-data-astronaut). Any ideas on this? Also, I'd make the font in the image titles a bit larger. Otherwise, LGTM! |
@soupault I increased the font size. Regarding the fact it doesn't show up in section, I guess it's because we use getattr, and not a direct call. A parser cannot get the call here... but i don't think it's significant miss. |
|
||
from skimage import data | ||
|
||
matplotlib.rcParams['font.size'] = 18 |
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.
I've just noticed that you don't set titles in this example. The font config doesn't really make sense then.
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.
Other examples look great!
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.
It's just to keep the tics homogeneous...
@sciunto Ah, you are right. That's, most likely, the case. |
Why don't we add the titles here also then? :)
…On Wed, 3 Oct 2018 at 12.08, François Boulogne ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In doc/examples/data/plot_specific.py
<#3388 (comment)>
:
> @@ -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
It just to keep the tics homogeneous...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3388 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQTBaYYt5OMSEMf2f0tRdN6XzznbGCbks5uhH54gaJpZM4WXLvW>
.
|
Because we have a header for each image/set of images that already introduces the content... I can add it, but I did not feel it's necessary. |
@emmanuelle I'm confused. Where do I call |
@sciunto sorry I got mixed up (with one of my local files). Sorry about that, ignore my comment! |
LGTM. It could be good to order the sections of the gallery so that the section on data appears on top (as described here https://sphinx-gallery.readthedocs.io/en/stable/advanced_configuration.html?highlight=sorting#sub-gallery-order). But we can also merge this PR first and do the ordering later, depending on your time. |
Good point. I open another issue for that. I think that ordering our examples would be useful beyond this PR (eg operation on numpy arrays could come among the first ones). |
Merging, thanks! |
Description
To pursue on the idea in #3384 I thought that it would be useful to show the data we are shipping with scikit-image. We could separate images for general purposes, scientific images and other specific images (like stereo).
Checklist
[It's fine to submit PRs which are a work in progress! But before they are merged, all PRs should provide:]
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
[For detailed information on these and other aspects see scikit-image contribution guidelines]
For reviewers
(Don't remove the checklist below.)
later.
__init__.py
.doc/release/release_dev.rst
.@meeseeksdev backport to v0.14.x