# [Tutor] Fwd: Plotting baseline to my CV

Alan Gauld learn2program at gmail.com
Mon Apr 10 03:48:08 EDT 2023

```Forward to list

-------- Forwarded Message --------

Subject: 	Re: [Tutor] Plotting baseline to my CV
To: 	Alan Gauld <alan.gauld at yahoo.co.uk>
Content-Type: 	multipart/related; boundary="000000000000d76b6105f8f06095"
Content-Length: 	144320

import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import scipy
from scipy import signal
import re

x = nD['Trace_1_26_3_2'][:,1]
y = nD['Trace_1_26_3_1'][:,1]
smoothy = signal.savgol_filter(y,40,3)

#rflat_start = np.array(())
#rflat_end = np.array(())
#lflat_start = np.array()
#lflat_end = np.array()

ltang_reg = []
ltang_m = []
ltangb = []
ltang_eg = [[], [], [], [], [], [], []]
rtang_reg = []
rtang_m = []
rtang_b = []
rtang_eq = [[], [], [], [], [], [], []]
lpeak_index = []
ipcs = np.array(())
Epcs = np.array(())
rpeak_index = []
ipas = np.array(())
Epas = np.array(())

#ltang_reg.append(stats.linregress(x/y)
#ltang_m.append(ltang_reg[x/y].slope)
#ltang_b.append(ltang_reg[y].intercept)

#for V in potential [i]:
#ltang_eq[i].append(ltang_m[i] * V + ltang_b[i])

#currentdif = current[i] - ltang_eq[i]
# rpeak_index.append(np.argmax(currentdif))
# ipas = np.append(ipas, currentdif[rpeak_index[i]])
# Epas = np.array(Epas, potential[i][rpeak_index[i]])
#
rtang_reg.append(stats.linregress(potential[i][rflat_start[i]:rflat_end[i]],\current[i][rflat_start[i]:rflat_end[i]]))

#  rtang_m.append(rtang_reg[i].slope)
# rtang.append(rtang_reg[i].intercept)

# for v in potential[i]:
#rtang_eq[i].append(rtang_m[i] * V + rtang_b[i])

#currentdif = current[i] - rtang_eq[i]
#lpeak_index.append(np.armin(currentdif))
# ipcs = np.append(ipcs, -currentdif[lpeak_index[i]])
# Epcs = np.array(Epcs, potential[i][lpeak_index[i]])

fig = plt.figure()
ax = plt.axes()
s = ' mV/s'
ax.plot(x,y*1E12,c='Black')
#ax.plot(x,smoothy*1E6,c='Blue',label='5' + s)
ax.set_xlabel('Potential \$\mathregular{(V\ vs\ Li/Li^{+}}\$)')
ax.set_ylabel('Current (\u03bcA)')
#ax.legend(loc='upper left', frameon=False)
#plt.ylim(-215, 325)
#plt.savefig('10 mM MPT 2.8-4.6V.')
plt.show()

for key in nD:

nD = loadmat('20230327- 10 mM MPT')
type(nD)
#nD

On Sun, Apr 9, 2023 at 2:57 PM Alan Gauld via Tutor <tutor at python.org
<mailto:tutor at python.org>> wrote:

On 09/04/2023 18:49, Maddison Eisnor wrote:
> Hello,
>
> I need to add baselines to my CV.

Where I come from a CV is what Americans call a Resume.
I'm guessing you mean something different but I have no idea what.

Can you explain?

What is a CV?
How are you producing it?
Are you using particular libraries like numpy for example?

What kind of baseline do you mean?
A line on a chart or a baseline set of data?
Or something else?

Don't assume we live in your world. You need to explain the context.

> I have the code to plot the CV

And if you have any code showing what you've tried that always helps
too. Don't make us guess.

--     Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/ <http://www.alan-g.me.uk/>
http://www.amazon.com/author/alan_gauld
<http://www.amazon.com/author/alan_gauld>
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
<http://www.flickr.com/photos/alangauldphotos>

_______________________________________________
Tutor maillist  -  Tutor at python.org <mailto:Tutor at python.org>
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
<https://mail.python.org/mailman/listinfo/tutor>

```