[Matplotlib-users] Need assistance with inconsistent matplotlib plots from computer to computer...

I wrote a program that gathers data and plots it (y) over time (x). I use Python 3.7.7, with matplotlib 3.2.2, on Windows 10 Pro. I have compiled the program using pyinstaller, into an .exe and put it on additional computers to run. The program has worked properly on all computers, except an HP i5, running Windows 10. I’ve attached a picture of both graphs to help explain my problem… Good and Bad Graph.

def Laser_WaferScan(self, lst, display1, time_lst):

“”" Laser - WAFER SCAN PLOT “”"

waferScan = lst

rpms = display1 # Displays the RPMs in plt.title

waferScan_fullScan_time_lst = time_lst

TESTING - Moved from main() 6.1.20

if gv.bandpass_yes == True:

plt.subplot(3, 1, 1)

else:

plt.subplot(2, 1, 1)

Hi,
Comparing the two plots, I am not sure matplotlib is the faulty one here.
The y values just seem different between the two graphs. Did you tried to record the data and look at numerical values in order to check their consistency ? You may even transfer the data of the “bad plot” to the other computer (the good one), just to ensure whether it is a data problem or a plot problem…

If they come from some experimental setup, maybe one of the devices is wrong…

Fabrice

···

Le lundi 21 septembre 2020, Anthony Billings a écrit :

I wrote a program that gathers data and plots it (y) over time (x). I use Python 3.7.7, with matplotlib 3.2.2, on Windows 10 Pro. I have compiled the program using pyinstaller, into an .exe and put it on additional computers to run. The program has worked properly on all computers, except an HP i5, running Windows 10. I’ve attached a picture of both graphs to help explain my problem… Good and Bad Graph.

The data is sampled from an external device based on the speed (rpms) of a spinning platen. The y-axis values are just set up by a function to adjust according to the range of the sampled data.

As I mentioned in the OP the program works well on most computers. It’s just this HP, i5 10th gen I’m having trouble with. It may or may not be a matplotlib issue, but I don’t know what else it could be.

I was referred to trying to change the epoch in matplotlib 3.3.2 and seeing if I could get it to work there. That did not fix the issue either.

···

From: Matplotlib-users matplotlib-users-bounces+abillings=axustech.com@python.org On Behalf Of Fabrice Silva
Sent: Monday, September 21, 2020 12:07 PM
To: matplotlib-users@python.org
Subject: Re: [Matplotlib-users] Need assistance with inconsistent matplotlib plots from computer to computer…

Le lundi 21 septembre 2020, Anthony Billings a écrit :

I wrote a program that gathers data and plots it (y) over time (x). I use Python 3.7.7, with matplotlib 3.2.2, on Windows 10 Pro. I have compiled the program using pyinstaller, into an .exe and put it on additional computers to run. The program has worked properly on all computers, except an HP i5, running Windows 10. I’ve attached a picture of both graphs to help explain my problem… Good and Bad Graph.

Hi,

Comparing the two plots, I am not sure matplotlib is the faulty one here.

The y values just seem different between the two graphs. Did you tried to record the data and look at numerical values in order to check their consistency ? You may even transfer the data of the “bad plot” to the other computer (the good one), just to ensure whether it is a data problem or a plot problem…

If they come from some experimental setup, maybe one of the devices is wrong…

Fabrice

Can you try plotting as

plt.plot(waferScan_fullScan_time_lst, waferScan, ‘-o’, label=“Laser Readings”, color=‘k’)

which will put a marker at each point to get a better sense of what the datapoints are and what parts are the interpretation is.

Tom

···

Thomas Caswell
tcaswell@gmail.com

That was a neat idea! I added the ‘-o’ to the plot. My current workbench setup is currently tied to a power supply outputting 1.2v. The data is then read for approximately 0.108 (108 ms) - 0.1096 seconds (109.6 ms) and then displayed on the plot. I have a debug version running that shows there is a range of 160-170 entries in the list, all valid floats. Thus the plot that should be displayed is a straight line at 1.2 with ~160 dots.

As the data was collected and displayed I saw variance in the plots. Most plots looked like this https://imgur.com/gallery/bEXc3t9, with about 7 or 8 equally distanced dots. This plot also shows an additional dot around the x=30 coordinate. Other plots had a ton of dots in between selected nodes, and then nothing between others, like this https://imgur.com/gallery/AezWLck. These 7/8 dots though are consistent throughout all of the plots.

Which is curious? Why would only select values be displayed while others are not? Why on some scans are there LOTS of dots, and others barely any?

That was a neat idea! I added the ‘-o’ to the plot. My current workbench setup is currently tied to a power supply outputting 1.2v. The data is then read for approximately 0.108 (108 ms) - 0.1096 seconds (109.6 ms) and then displayed on the plot. I have a debug version running that shows there is a range of 160-170 entries in the list, all valid floats. Thus the plot that should be displayed is a straight line at 1.2 with ~160 dots.

As the data was collected and displayed I saw variance in the plots. Most plots looked like this https://imgur.com/gallery/bEXc3t9, with about 7 or 8 equally distanced dots. This plot also shows an additional dot around the x=30 coordinate. Other plots had a ton of dots in between selected nodes, and then nothing between others, like this https://imgur.com/gallery/AezWLck. These 7/8 dots though are consistent throughout all of the plots.

Which is curious? Why would only select values be displayed while others are not? Why on some scans are there LOTS of dots, and others barely any?

Problem Solved. McAfee Antivirus was causing the problem.