How to remove frame from matplotlib (pyplot.figure vs matplotlib.figure ) (frameon=False Problematic in matplotlib)

后端 未结 11 2139
猫巷女王i
猫巷女王i 2020-11-27 09:53

To remove frame in figure, I write

frameon=False

works perfect with pyplot.figure, but with matplotlib.Figure it

11条回答
  •  粉色の甜心
    2020-11-27 09:58

    df = pd.DataFrame({
    'client_scripting_ms' : client_scripting_ms,
     'apimlayer' : apimlayer, 'server' : server
    }, index = index)
    
    ax = df.plot(kind = 'barh', 
         stacked = True,
         title = "Chart",
         width = 0.20, 
         align='center', 
         figsize=(7,5))
    
    plt.legend(loc='upper right', frameon=True)
    
    ax.spines['right'].set_visible(False)
    ax.spines['top'].set_visible(False)
    
    ax.yaxis.set_ticks_position('left')
    ax.xaxis.set_ticks_position('right')
    

提交回复
热议问题