-
Notifications
You must be signed in to change notification settings - Fork 16
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
how to make a hips plot without the tile boundaries plotted #130
Comments
Thanks for opening this issue. The second image you draw using I think it would be nice if the user could turn off the tile boundaries in result.plot() method, since we also provide the same functionality in plot_mpl_hips_tile_grid method. @cdeil - What do you think? |
@adl1995 - If you want, you can add an option or two to the existing But even more importantly, I think we have to make it clearer that this is just a little quicklook helper method, and point users to http://docs.astropy.org/en/stable/visualization/ to make nice plots, maybe showing an example or two (or showing the code for the existing example towards the end of that page). I'm -1 to add options to control the grid - that grid is really only useful for us to debug the package. Maybe add an option Basically we need to significantly update https://hips.readthedocs.io/en/latest/getting_started.html to explain better to people how to make nice, even publication quality plots; mostly point to http://docs.astropy.org/en/stable/visualization/, but do provide an example. Maybe move that to a second docs page |
@cdeil - Would adding a section on "Plot using Astropy visualization toolkit" in the "Getting started" page be enough? We could redirect users to Astropy docs for further reading. What sort of example should we provide using the from astropy.visualization.mpl_normalize import simple_norm
ax = plt.subplot(projection=geometry.wcs)
norm = simple_norm(result.image, 'sqrt', min_percent=1, max_percent=99)
ax.imshow(result.image, origin='lower', norm=norm, cmap='gray') |
OK, if you want to keep the current single high-level docs page approach for now. A key point to make is that usually grayscale / FITS images are plotted differently than RGB images. For grayscale / FITS usually one will want to control the stretch, as you show in the example already. For RGB, usually one will want to plot the pixels "as-is", without applying an extra stretch. In both cases, one can just save images / pixels as-is (mpl imsave), or plot using axes (mpl imshow / wcsaxes). So really there's four cases / examples how to plot (float greyscale vs RGB input; and imsave vs imshow with MPL plotting). Improving the docs on this plotting could go hand in hand with addressing #40, i.e. explaining what the output images contain. (for RGB it's uint8 values in the range 0 to 255, plus in the case of PNG a transparency channel) The documentation on this in this hips package can be short, linking to the astropy.visualisaiton or scikit-iamge docs where useful; but it really should be improved to make it clearer to users what they get out and how to work with it. |
I am using the example plot_fits.py with a smaller fov:
https://github.com/hipspy/hips/blob/master/docs/getting_started.rst
width=360, height=360, fov="0.1 deg"
See attached png; How do I NOT get the tile boundaries plotted?
help(make_sky_image) does not tell me:
help(plot) tells me that the tiles arre are plotted but not how to NOT plot them
plot(self) -> None
| Plot the all sky image and overlay HiPS tile outlines.
If I do not call result.plot() before the plt sequence I get:
So somewhere behind the scenes some matplotlib hidden magic is taking place. e.g. is make_sky_image doing some matplotlib work
As well as turning of the tile boundaries, it could be useful to know how to specify line color and line style for the tile boundaries too.
The text was updated successfully, but these errors were encountered: