Skip to content
Snippets Groups Projects
Commit 7e1febb6 authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

fixed matplotlib bug plotting in transfer curve

parent ce11987e
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:6defdb49-06c2-469d-beb5-bc2e147e3f79 tags: %% Cell type:code id:6defdb49-06c2-469d-beb5-bc2e147e3f79 tags:
``` python ``` python
%matplotlib ipympl
%run ADU_version_2.py %run ADU_version_2.py
``` ```
%% Output %% Output
%% Cell type:code id:0331b265-0fe6-4749-ac85-099509f735ea tags: %% Cell type:code id:d480980e-f36a-4096-89b0-f65fe874d8a6 tags:
``` python ``` python
``` ```
......
...@@ -27,7 +27,7 @@ def plot_transfer(x,y1,y2,curves,norm_unit='mA/mm'): ...@@ -27,7 +27,7 @@ def plot_transfer(x,y1,y2,curves,norm_unit='mA/mm'):
for i in range(curves): for i in range(curves):
ax1.plot(x[i], y1[i], color = color) ax1.plot(x[i], y1[i], color = color)
#ax1.plot(Vgs, Idmm, color = color) #ax1.plot(Vgs, Idmm, color = color)
ax1.tick_params(axis ='y', labelcolor = color,which = 'both') ax1.tick_params(axis ='y', labelcolor = color)
# Adding Twin Axes # Adding Twin Axes
ax2 = ax1.twinx() ax2 = ax1.twinx()
...@@ -37,13 +37,15 @@ def plot_transfer(x,y1,y2,curves,norm_unit='mA/mm'): ...@@ -37,13 +37,15 @@ def plot_transfer(x,y1,y2,curves,norm_unit='mA/mm'):
ax2.set_ylabel('$g_{m} (mS/mm)$', color = color) ax2.set_ylabel('$g_{m} (mS/mm)$', color = color)
else: else:
ax2.set_ylabel('$g_{m} (uS/um)$', color = color) ax2.set_ylabel('$g_{m} (uS/um)$', color = color)
for i in range(curves): for i in range(curves):
ax1.plot(x[i], y2[i], color = color) ax2.plot(x[i], y2[i], color = color)
#ax2.plot(Vgs, gm, color = color) #ax2.plot(Vgs, gm, color = color)
ax2.tick_params(axis ='y', labelcolor = color,which = 'both') ax2.tick_params(axis ='y', labelcolor = color)
# Adding title # Adding title
fig.suptitle('Transfer Curve', fontweight ="bold") fig.suptitle('Transfer Curve', fontweight ="bold")
fig.tight_layout()
# Show plot # Show plot
display(fig) display(fig)
...@@ -62,9 +64,10 @@ def plot_output(x,y1,y2,curves,norm_unit = "mA/mm"): ...@@ -62,9 +64,10 @@ def plot_output(x,y1,y2,curves,norm_unit = "mA/mm"):
ax1.set_ylabel('$I_{D} (mA/mm)$', color = color) ax1.set_ylabel('$I_{D} (mA/mm)$', color = color)
else: else:
ax1.set_ylabel('$I_{D} (uA/um)$', color = color) ax1.set_ylabel('$I_{D} (uA/um)$', color = color)
for i in range(curves): for i in range(curves):
ax1.plot(x[i],y1[i],color=color) ax1.plot(x[i],y1[i],color=color)
ax1.tick_params(axis ='y', labelcolor = color,which = 'both') ax1.tick_params(axis ='y', labelcolor = color)
ax2 = ax1.twinx() ax2 = ax1.twinx()
color = 'tab:green' color = 'tab:green'
...@@ -72,11 +75,14 @@ def plot_output(x,y1,y2,curves,norm_unit = "mA/mm"): ...@@ -72,11 +75,14 @@ def plot_output(x,y1,y2,curves,norm_unit = "mA/mm"):
ax2.set_ylabel('$I_{G} (mA/mm)$', color = color) ax2.set_ylabel('$I_{G} (mA/mm)$', color = color)
else: else:
ax2.set_ylabel('$I_{G} (uA/um)$', color = color) ax2.set_ylabel('$I_{G} (uA/um)$', color = color)
for i in range(curves): for i in range(curves):
ax2.plot(x[i], y2[i], color = color) ax2.plot(x[i], y2[i], color = color)
ax2.tick_params(axis ='y', labelcolor = color,which = 'both') ax2.tick_params(axis ='y', labelcolor = color)
fig.suptitle("Output Curve",fontweight ="bold") fig.suptitle("Output Curve",fontweight ="bold")
fig.tight_layout()
display(fig) display(fig)
def plot_gatediode(x,y,norm_unit = "mA/mm"): def plot_gatediode(x,y,norm_unit = "mA/mm"):
...@@ -93,9 +99,10 @@ def plot_gatediode(x,y,norm_unit = "mA/mm"): ...@@ -93,9 +99,10 @@ def plot_gatediode(x,y,norm_unit = "mA/mm"):
y = np.absolute(y) y = np.absolute(y)
ax1.plot(x,y, color = color) ax1.plot(x,y, color = color)
ax1.tick_params(axis ='y', labelcolor = color,which = 'both') ax1.tick_params(axis ='y', labelcolor = color)
fig.suptitle('Gatediode Curve', fontweight ="bold") fig.suptitle('Gatediode Curve', fontweight ="bold")
fig.tight_layout()
display(fig) display(fig)
......
...@@ -174,8 +174,6 @@ class HP4155a(object): ...@@ -174,8 +174,6 @@ class HP4155a(object):
command = command + f"{repr(variable)}" command = command + f"{repr(variable)}"
if index != len(variables_list)-1: if index != len(variables_list)-1:
command = command + "," command = command + ","
#test
print(command)
self.inst.write(command) self.inst.write(command)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment