Okay so to be frank I am new to python, and I am trying to interpret some data, this is what I have (below)
so What I am trying to do is make it so that the minimum value for my first column will cause the matplotlib to not plot any values after that specific row (for all three columns, not just area)
Does that make sense?
I thought the pandas pd stuff would do the trick but nope :c
so What I am trying to do is make it so that the minimum value for my first column will cause the matplotlib to not plot any values after that specific row (for all three columns, not just area)
Does that make sense?
I thought the pandas pd stuff would do the trick but nope :c
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.read_csv("C:\\Users\\Owner\\Desktop\\Thunberg,Dametre\\5-29 Data and movies\\New folder (2)\\Data 2.csv", sep=',')
rowmin = df.area.idxmin()
df[:(1 + rowmin)]
fig, ax1 = plt.subplots()
area, pressure, pixel = np.loadtxt ("C:\\Users\\Owner\\Desktop\\Thunberg,Dametre\\5-29 Data and movies\\New folder (2)\\Data 2.csv", delimiter=",", skiprows=1, unpack=True)
plt.plot(area,pressure, label='area/pressure!',color='b')
plt.xlabel('area', color='b')
plt.ylabel('Pressure', color='b')
ax1.tick_params('y', colors='b')
ax2 = ax1.twinx()
ax2.set_ylabel('Intensity (measured by average pixel value)', color='r')
ax2.tick_params('y', colors='r')
ax2.plot(area,pixel, color='r')
plt.title('Kibron Trough Pressure-Area-Intensity Graph')
plt.legend()
plt.show()
