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
Add MultiPanelFITSFigure class? #174
Comments
I would welcome it. This has been a common need in my daily work; last time I did this I think I did it in IDL! Maybe it would be best to have a wrapper that splits up the FITS file into sub-files to minimize memory usage? This would remove some of the flexibility aplpy provides, but would improve performance. Alternatively, maybe there's no need to do anything beyond #88, but instead include this in https://github.com/aplpy/aplpy-examples/ as a recipe? I haven't looked at #88 in a long time; @cdeil, any chance you want to help add some tests? |
I think this would be useful to have at the very least in http://aplpy.readthedocs.org/en/v0.9.11/howtos.html - whether it should make it into the core package is not as clear, but if you could already write a HOWTO with the simplest possible code, then we can see how we can generalize it to include it in the actual package. |
I still haven't figured out how to structure code for plotting multiple sky images on one matplotlib Figure well. import matplotlib.pyplot as plt
def plot_ax_1(fig, rect):
ax = fig.add_axes(rect)
ax.plot([1,2,3], [2,3,3], color='blue')
def plot_ax_2(fig, rect):
ax = fig.add_axes(rect)
ax.plot([1,2,3], [2,3,3], color='red')
def make_plot_1():
fig = plt.figure(figsize=(10, 10))
ax1 = plot_ax_1(fig, rect=[0.1, 0.2, 0.3, 0.4])
ax2 = plot_ax_2(fig, rect=[0.5, 0.6, 0.1, 0.2])
fig.savefig('/tmp/plot_1.png')
return fig
fig = make_plot_1() Is this the best way to structure such code, take a matplotlib Figure and subplot
|
@cdeil - just to check, is this something you can do with WCSAxes? For instance:
I'm still trying to figure out where to draw the line between WCSAxes and APLpy... and I need to understand the various use cases better. You should be able to do anything with WCSAxes but it will be a little more manual in some cases. For what you want to do here it seems you want to be close to the Matplotlib API so APLpy doesn't seem appropriate. |
@astrofrog – Here's an example of what I want to do: Show the same image twice for different zoomed in regions. I would like to have the two panels have the same height ... do you know how I can prevent |
@cdeil - for WCSAxes you can just use |
@cdeil @astrofrog for the colorbar issue, see #119 (which is about colorbars & resizing but doesn't say so in the title) |
I would like to add some code to
aplpy
to make it easy to plot very wide survey images in multiple panels, like in this example.I do have some (very messy) code to do it where the user has to sub-class to make a plot:
https://gist.github.com/cdeil/9090342
Would that be a welcome addition or is this too specialized?
If yes, what would be a nice API for this?
The current implementation seems overly complicated, plus I think it's very slow and memory intensive because for each panel there is a copy of the full survey image data ... any advice how to do this better?
#88 might help.
The text was updated successfully, but these errors were encountered: