0

I have similar problem as this question through this linkenter link description here, but I tried to follow many times and it did not work for my case. So, please kindly help me.

I have the table/data as below and would like to plot column Guideline as Line plot and the rest of the column as Bar plot into one chart without secondary_y.

May data:

Year Guidline LMX LPB LVT LBF LBH LSD LKL LDN 2007 100 50 50 160 222 473 1,408 17 194 2008 200 47 231 17 508 19 278 219 1,707 2011 300 31 42 29 56 27 102 40 145 2013 500 11.7 9 8 10 17 30 5 14 2015 22.33 50 90 150 178 82 159 86 226

Below is my code:

import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt

df=pd.read_excel('F:/MRCS_New_struture/2. EHM_Vanna/2015 Reports/Statistic_Env.xlsx', sheetname='Zooplankton (3)', header=0, index_col='Year')

Guideline=df.iloc[:5,:1]
LaoAB=df.iloc[:5,1:9]

plt.figure()
ax = plt.subplots()

Guideline.plot(ax=ax)
LaoAB.plot(kind='bar', ax=ax)
plt.show()

Please kindly help me. Many thanks

Vanna
  • 191
  • 2
  • 2
  • 10
  • And what is wrong with your code? Do you get an error? Separate plots? Something else? You have told us what you are trying to achieve, but not where you are stuck. In any case, just because you haven't been able to get the solution working for you doesn't mean this is not a duplicate of the question you linked to. – SiHa Dec 04 '17 at 08:32
  • @SiHa, yes I get a separate plots. I want both plots combined together in one chart. Could please kindly help? – Vanna Dec 04 '17 at 13:10

0 Answers0