Page 1 of 2

python code for graphing

Posted: Sun Jul 02, 2023 11:52 am
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?

Re: python code for graphing

Posted: Sun Jul 02, 2023 12:39 pm
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.

Re: python code for graphing

Posted: Mon Jul 03, 2023 2:24 am
by Masoud_n
thanks.
I need to calculate the concentration and focus level of the user. do you have any advice for me?

Re: python code for graphing

Posted: Mon Jul 03, 2023 8:28 am
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.

Re: python code for graphing

Posted: Mon Jul 03, 2023 9:47 am
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.

Re: python code for graphing

Posted: Mon Jul 03, 2023 10:01 am
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?

Re: python code for graphing

Posted: Mon Jul 03, 2023 10:05 am
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! ;-)

Re: python code for graphing

Posted: Mon Jul 03, 2023 10:23 am
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

Re: python code for graphing

Posted: Mon Jul 03, 2023 10:40 am
by James
My algorythm sets the output zero as whatever the relative value is at T+30seconds.

Re: python code for graphing

Posted: Thu Jul 27, 2023 3:14 am
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?