美文网首页
healpy plot two figure

healpy plot two figure

作者: uurr | 来源:发表于2018-09-26 15:57 被阅读0次

If you want to have healpy plots in matplotlib subplots, the following would be the way to go. The key is to use plt.axes() to select the active subplot and to use the hold=True keyword in the healpy functions.

import healpy as hp

import numpy as np

import matplotlib.pyplot as plt

fig, (ax1, ax2) = plt.subplots(ncols=2)

plt.axes(ax1)

hp.mollview(np.random.random(hp.nside2npix(32)), hold=True)

plt.axes(ax2)

hp.mollview(np.arange(hp.nside2npix(32)), hold=True)

相关文章

网友评论

      本文标题:healpy plot two figure

      本文链接:https://www.haomeiwen.com/subject/paxjoftx.html