def fig_ax3d(**kwds): fig = plt.figure(**kwds) try: ax = fig.add_subplot(111, projection='3d') except: # mpl < 1.0.0 ax = Axes3D(fig) return fig, ax