0

I'm very beginner in python and I have the following data and I need to plot time vs data

 // input string is read from a file
 data.append(np.fromstring(
                    inputstring,
                    dtype=[('time', '<f8'),
                           ('data', '<f8', (sublen, ))]))


 newdata = np.zeros((len(data),),
                               dtype=[('time', '<f8'),
                                      ('data', '<f8', (sublen, ))])
            newdata[:] = data

How would I plot newdata time vs data

andre
  • 653
  • 7
  • 22
  • Please edit your question to provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). What is the data structure of your input? – Mr. T Jul 21 '18 at 14:48
  • it's a array indexed to a list, so element 1 has a list, element 2 has a list, elements are time, the list is the data – andre Jul 21 '18 at 15:14
  • Have you read the link? [What do you mean by "time"?](https://stackoverflow.com/a/21916253/8881141) – Mr. T Jul 21 '18 at 15:17

1 Answers1

0

You can use matplotlib. A simple way to plot charts:

import numpy as np
import matplotlib.pyplot as plt

plt.figure(1)
plt.plot(newdata, data)
plt.show()
Eduardo Soares
  • 954
  • 3
  • 13