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

non interactive plots

parent 10449c07
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ from interface import * ...@@ -2,7 +2,7 @@ from interface import *
import control import control
from help import * from help import *
import time import time
from IPython.display import clear_output from IPython.display import clear_output,display
import numpy as np import numpy as np
import datetime import datetime
import pandas as pd import pandas as pd
...@@ -157,10 +157,9 @@ def on_measure_clicked(b): ...@@ -157,10 +157,9 @@ def on_measure_clicked(b):
ax6.set_ylabel("Cp (F)") ax6.set_ylabel("Cp (F)")
ax6_twin.set_ylabel("D") ax6_twin.set_ylabel("D")
figManager = plt.get_current_fig_manager()
figManager.window.state('zoomed')
for bias in biases: for i,bias in enumerate(biases):
clear_output(wait = True)
view["v-value"].value = str(bias) view["v-value"].value = str(bias)
# voltage index # voltage index
...@@ -227,30 +226,31 @@ def on_measure_clicked(b): ...@@ -227,30 +226,31 @@ def on_measure_clicked(b):
# do the plots # do the plots
# first the live ones # first the live ones
if i>1:
curve1.pop(0).remove()
curve1_twin.pop(0).remove()
curve2.pop(0).remove()
curve2_twin.pop(0).remove()
curve3.pop(0).remove()
#clear the live axes
ax1.clear()
ax1_twin.clear()
ax2.clear()
ax2_twin.clear()
ax3.clear()
# frequency Cp/D plot # frequency Cp/D plot
ax1.plot(freq,Cp,color = 'b') curve1 = ax1.plot(freq,Cp,color = 'b')
ax1.tick_params(axis = 'y',labelcolor = 'b') ax1.tick_params(axis = 'y',labelcolor = 'b')
ax1_twin.plot(freq,D, color = 'y') curve1_twin=ax1_twin.plot(freq,D, color = 'y')
ax1_twin.tick_params(axis='y',labelcolor = 'y') ax1_twin.tick_params(axis='y',labelcolor = 'y')
# frequecy Z-phi # frequecy Z-phi
ax2.plot(freq,Z,color = 'b') curve2=ax2.plot(freq,Z,color = 'b')
ax2.tick_params(axis = 'y',labelcolor = 'b') ax2.tick_params(axis = 'y',labelcolor = 'b')
ax2_twin.plot(freq,phi, color = 'y') curve2_twin = ax2_twin.plot(freq,phi, color = 'y')
ax2_twin.tick_params(axis='y',labelcolor = 'y') ax2_twin.tick_params(axis='y',labelcolor = 'y')
# Rez - Imz # Rez - Imz
ax3.plot(ReZ,ImZ,color = 'b') curve3=ax3.plot(ReZ,ImZ,color = 'b')
ax3.tick_params(axis = 'y',labelcolor = 'b') ax3.tick_params(axis = 'y',labelcolor = 'b')
# now the rest of the plots # now the rest of the plots
...@@ -280,10 +280,12 @@ def on_measure_clicked(b): ...@@ -280,10 +280,12 @@ def on_measure_clicked(b):
ax6_twin.scatter(freq,D, color = 'y') ax6_twin.scatter(freq,D, color = 'y')
ax6_twin.tick_params(axis='y',labelcolor = 'y') ax6_twin.tick_params(axis='y',labelcolor = 'y')
plt.pause(0.1) display(fig)
if messparameter_dict["hysterisis"].value == True: if messparameter_dict["hysterisis"].value == True:
reversed_biases = reversed_array(biases) reversed_biases = reversed_array(biases)
for bias in reversed_biases: for bias in reversed_biases:
clear_output(wait = True)
view["v-value"].value = str(bias) view["v-value"].value = str(bias)
# voltage index # voltage index
...@@ -350,29 +352,28 @@ def on_measure_clicked(b): ...@@ -350,29 +352,28 @@ def on_measure_clicked(b):
# do the plots # do the plots
# first the live ones # first the live ones
#clear the live axes curve1.pop(0).remove()
ax1.clear() curve1_twin.pop(0).remove()
ax1_twin.clear() curve2.pop(0).remove()
ax2.clear() curve2_twin.pop(0).remove()
ax2_twin.clear() curve3.pop(0).remove()
ax3.clear()
# frequency Cp/D plot # frequency Cp/D plot
ax1.plot(freq,Cp,color = 'b') curve1=ax1.plot(freq,Cp,color = 'b')
ax1.tick_params(axis = 'y',labelcolor = 'b') ax1.tick_params(axis = 'y',labelcolor = 'b')
ax1_twin.plot(freq,D, color = 'y') curve1_twin = ax1_twin.plot(freq,D, color = 'y')
ax1_twin.tick_params(axis='y',labelcolor = 'y') ax1_twin.tick_params(axis='y',labelcolor = 'y')
# frequecy Z-phi # frequecy Z-phi
ax2.plot(freq,Z,color = 'b') curve2=ax2.plot(freq,Z,color = 'b')
ax2.tick_params(axis = 'y',labelcolor = 'b') ax2.tick_params(axis = 'y',labelcolor = 'b')
ax2_twin.plot(freq,phi, color = 'y') curve2_twin=ax2_twin.plot(freq,phi, color = 'y')
ax2_twin.tick_params(axis='y',labelcolor = 'y') ax2_twin.tick_params(axis='y',labelcolor = 'y')
# Rez - Imz # Rez - Imz
ax3.plot(ReZ,ImZ,color = 'b') curve3=ax3.plot(ReZ,ImZ,color = 'b')
ax3.tick_params(axis = 'y',labelcolor = 'b') ax3.tick_params(axis = 'y',labelcolor = 'b')
# now the rest of the plots # now the rest of the plots
...@@ -401,10 +402,8 @@ def on_measure_clicked(b): ...@@ -401,10 +402,8 @@ def on_measure_clicked(b):
ax6_twin.scatter(freq,D, color = 'r') ax6_twin.scatter(freq,D, color = 'r')
ax6_twin.tick_params(axis='y',labelcolor = 'r') ax6_twin.tick_params(axis='y',labelcolor = 'r')
display(fig)
plt.pause(0.1)
plt.show()
device.write('bias_off') device.write('bias_off')
# save to file # save to file
......
%% Cell type:code id:912606ea-a3b6-43e8-94c5-8f1fe5281375 tags: %% Cell type:code id:912606ea-a3b6-43e8-94c5-8f1fe5281375 tags:
``` python ``` python
%matplotlib tk
%run cv.py %run cv.py
``` ```
%% Output %% Output
%% Cell type:code id:4f6be5c3-0ab8-4f18-88f6-02ce464a99f7 tags: %% Cell type:code id:4f6be5c3-0ab8-4f18-88f6-02ce464a99f7 tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment