fig.gca() vs. fig.add_subplot()

后端 未结 2 396
一向
一向 2020-12-29 05:39

Most examples of object-oriented matplotlib get an Axis object with something like

import matplotlib.pyplot as plt

fig1 = plt.figure()
ax1 = fig1.add_subplo         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 06:19

    To creat 3D instance, there are three ways:

    plt.gca(projection='3d')
    
    plt.subplot(projection='3d')
    
    fig = plt.figure()
    fig.add_subplot(111, projection='3d') 
    

    Maybe the third way is more complex.

提交回复
热议问题