简体   繁体   中英

Insert a 2 horizontal lines on a bar plot

I am trying to insert 2 lines on a bar plot with the following code:

PosisEink_Liq['weights'].plot(kind='bar',color=('darkgray'))
PosisEink_Liq['TAA+1'].plot(kind='line',color=('black'),linestyle = '--')
PosisEink_Liq['TAA-1'].plot(kind='line',color=('black'),linestyle = '--')

Unfortunately, the 2 horizontal lines do not happear along the all graph from right to left. Do you know a remedy for this problem. If possible no plot.axhline formula

Use

import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = [7.50, 3.50] #Size of Graph
plt.rcParams["figure.autolayout"] = True
fig, ax = plt.subplots() #For multiple subplots

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM