I am very new to python and coding in general. I have a CSV file that has the first row a string of flight attributes (ie. time, speed, heading, battery voltage etc.) I want to be able to plot time vs speed vs battery voltage. Or battery voltage vs speed. I have tried several examples, however, every example I have seen it is either plots everything in the CSV file which I do not want. Or the csv file only has 2 columns.
CSV File format:
time(ms), ground_speed, battery_voltage(v), airspeed(m/s)
1322,45,12,42
1342,64,11,60
1352,30,11,27
import pandas as pd
from pandas import DataFrame, read_csv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
df = pd.DataFrame.from_csv('myflight.csv', index_col=False)
df.plot(x='mSec', y='Airspeed(m/s)', color="g")
df.plot(x='mSec', y='AS_Cmd(m/s)', color="r")
My issue with this it always plots vs the first index which is time. Also, I get two separate graphs. How do I join both airspeed and AS_Cmd into one graph and be able to plot someone else beside time vs something else?


pd.read_clipboard()works correctly. Also the keys you use for plotting do not match the keys in your example data.