Plotting with Matplotlib Tutorial -- Adding File Option

Heads up! You've already completed this tutorial.

parkerlewis4047061 | 2020-09-17 22:53:54 UTC | #1

Hi, I got the example to work and would love to plot from a file!

For example, I know to open a binary file is file = open("sample.bin", "rb")

But how could the data be placed into an array, for plotting? For example, assuming you prompt the user for file location, the number of bytes per data (1,2, 3 or 4), and the endiness.. i.e. the first byte is the MSB or LSB... how can I plot the data value on the y, and the sample number on the x?


Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Plotting with Matplotlib Tutorial -- Adding File Option was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular https://www.martinfitzpatrick.com/browse/books/ on the subject.