python code for graphing

Masoud_n
Posts: 5
Joined: Sun Jul 02, 2023 11:35 am

python code for graphing

Post by Masoud_n »

Hi, thanks for your great app.

I used this app to save the signals into .csv file.

I can plot it using the graphing online but I want to integrate this graph into my own Python codes and my own GUI. is there any Python code that does the exact graphing as graphing online, so I don't miss any data?
User avatar
James
Site Admin
Posts: 1082
Joined: Wed Jan 02, 2013 9:06 pm

Re: python code for graphing

Post by James »

The online charts are made using the Google Charts API: https://developers.google.com/chart
You'd need to have a webbrowser HTML window to use Google Charts in your app, so probably not the best thing for a Python app.
Masoud_n
Posts: 5
Joined: Sun Jul 02, 2023 11:35 am

Re: python code for graphing

Post by Masoud_n »

thanks.
I need to calculate the concentration and focus level of the user. do you have any advice for me?
Masoud_n
Posts: 5
Joined: Sun Jul 02, 2023 11:35 am

Re: python code for graphing

Post by Masoud_n »

I have another question, how do you calculate the y axis? because my data is mainly in the range of 0 to 1 but in the graph, it is in the range of 55 to 100 while plotting in Absolute Brainwaves mode.
User avatar
James
Site Admin
Posts: 1082
Joined: Wed Jan 02, 2013 9:06 pm

Re: python code for graphing

Post by James »

I do a linear transform of range {-1:+1} to {0:100} for absolute value display as many people do not understand negative values being normal.
My algorithms for Concentration and Mellow are just simple trackers of Gamma Relative and Alpha Relative if that's what you're asking about.
Masoud_n
Posts: 5
Joined: Sun Jul 02, 2023 11:35 am

Re: python code for graphing

Post by Masoud_n »

James wrote: Mon Jul 03, 2023 9:47 am I do a linear transform of range {-1:+1} to {0:100} for absolute value display as many people do not understand negative values being normal.
My algorithms for Concentration and Mellow are just simple trackers of Gamma Relative and Alpha Relative if that's what you're asking about.
thanks. for plotting, I did as you said and its fine now.

Can you be more specific about tracker? are you applying any thresholds? for example if Gamma is greater than, lets say, 60, the person is focused?
User avatar
James
Site Admin
Posts: 1082
Joined: Wed Jan 02, 2013 9:06 pm

Re: python code for graphing

Post by James »

Not even that complex. Wait a bit to get your "zero", then plot Relative from there. There's a reason my algorithms are hidden. They're bad! ;-)
Masoud_n
Posts: 5
Joined: Sun Jul 02, 2023 11:35 am

Re: python code for graphing

Post by Masoud_n »

James wrote: Mon Jul 03, 2023 10:05 am Not even that complex. Wait a bit to get your "zero", then plot Relative from there. There's a reason my algorithms are hidden. They're bad! ;-)
:D

Sorry. I didn't catch that. For this data, I don't have any "zero". Does it mean that I was always focused?
Image
User avatar
James
Site Admin
Posts: 1082
Joined: Wed Jan 02, 2013 9:06 pm

Re: python code for graphing

Post by James »

My algorythm sets the output zero as whatever the relative value is at T+30seconds.
LinDN
Posts: 13
Joined: Tue Jul 25, 2023 4:33 am

Re: python code for graphing

Post by LinDN »

James wrote: Mon Jul 03, 2023 10:40 am My algorythm sets the output zero as whatever the relative value is at T+30seconds.
Do you mean that gamma is set to relative zero from the moment the algorithm is turned on? All gamma values are subtracted from this relative zero, right?
Post Reply