I need help with plotting the data from excel into matplotlib. The data is taken from one worksheet. The columns have similar structure:column a -x values, column b – y values, column c – x values, d – y values etc.. I want python to loop through the data set and plot it in separate plots. Also I want to learn how to combine multiple data sets in one plot. Here is what I managed so far:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import openpyxl as xl
df=pd.read_excel("C:\temp\test.xlsx", 'Sheet1', skipwors=5)
x=df['distance']
y=df['HV']
plt.xlim(0.1,20)
plt.ylim(100,1000)
plt.plot(x,y)
plt.show
It does what I want with one x and one y columns. However, I want to add multiple columns next to each other in the same worksheet and create a loop to plot them. Thank you in advance for any tips!
I tried to plot one data set and it worked. I dont know how to create a loop.