Aplpy multiplot dynamic axis sharing

后端 未结 1 1431
孤独总比滥情好
孤独总比滥情好 2020-12-18 09:43

Is there any way to make multiplot aplpy plots dynamically share axes so that when one is moved or zoomed, it moves and zooms the others?

I can achieve the affect u

相关标签:
1条回答
  • 2020-12-18 10:35

    It seems that the plotting functionality of aplpy is completely based on matplotlib. So any plot formatting that can be done with aplpy can in one way or the other be done with matplotlib.

    But if you still want to stick to aplpy for creating the plots, there should still be a solution which does not need complicated event listeners.

    Unfortunately, unlike plotting functionalities of other libraries, aplpy seems to only accept the figure as argument, not the axes.

    It should nonetheless be possible to link the axes even after their creation:

    axes = fig.get_axes()
    axes[0].get_shared_x_axes().join(axes[0], axes[1])
    axes[0].get_shared_y_axes().join(axes[0], axes[1])
    axes[0].autoscale() # <-- needed if no axes limits are explicitely set.
    
    0 讨论(0)
提交回复
热议问题