Aufgrund einer Wartung wird GitLab am 21.09. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 21.09. between 8:00 and 9:00 am.

Commit 30f273ce authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

- minor bug fixes

parent 559cb6c6
Pipeline #290198 failed with stage
in 3 minutes and 47 seconds
......@@ -126,7 +126,7 @@
"s2, _, _ = rwth_transforms.ilaplace_ht(t, 1, pp, pz, [1], [], roc)\n",
"ax = axs[1]; ax.plot(t, np.real(s2), **rwth_plots.style_graph); \n",
"ax.set_xlabel(r'$\\rightarrow t$'); ax.set_ylabel(r'$\\uparrow s_2(t)$'); \n",
"ax.set_ylim([-45,5]); ax.grid(); rwth_plots.axis(ax)"
"ax.set_ylim([-45,5]); rwth_plots.grid(ax); rwth_plots.axis(ax)"
]
},
{
......
......@@ -188,7 +188,7 @@
"fig,ax = plt.subplots()\n",
"ax.plot(f/1000, np.abs(H_fourier(f))); rwth_plots.axis(ax)\n",
"ax.set_xlabel(r'$\\rightarrow f$ [kHz]'); ax.set_ylabel(r'$\\uparrow |H(f)|$');\n",
"rwth_plots.annotate_xtick(ax, r'$f_0 = \\omega_0/(2\\pi)$', omega0/(2*np.pi)/1000,-0.25,'k');\n",
"rwth_plots.annotate_xtick(ax, r'$f_0 = \\omega_0/(2\\pi)$', omega0/(2*np.pi)/1000,-0.25,'rwth:black');\n",
"ax.axvline(f0/1000,0,1, color='k',linestyle='--');"
]
},
......@@ -246,7 +246,7 @@
},
"outputs": [],
"source": [
"fig0,axs = plt.subplots(2, 1, figsize=(8,16)); fig0.canvas.layout.height= '600px'\n",
"fig0,axs = plt.subplots(2, 1, **rwth_plots.landscape)\n",
"@widgets.interact(Rsel=widgets.FloatSlider(min=0, max=200, step=1, value=R, description='$R$ [$\\Omega$]'))\n",
"def update_plot(Rsel):\n",
" H_laplace = lambda p: 1/(L*C*p**2+Rsel*C*p+1);\n",
......@@ -257,9 +257,9 @@
" h = lambda t: np.real(np.exp(-a*t)/(b*L*C)*(np.exp(b*t)-np.exp(-b*t))/2*unitstep(t))\n",
" \n",
" if not axs[0].lines: # Call plot() and decorate axes. Usually, these functions take some processing time\n",
" ax = axs[0]; ax.plot(f/1000, np.abs(H_fourier(f))); rwth_plots.axis(ax)\n",
" ax = axs[0]; ax.plot(f/1000, np.abs(H_fourier(f)), 'rwth:blue'); rwth_plots.axis(ax)\n",
" ax.set_xlabel(r'$\\rightarrow f$ [kHz]'); ax.set_ylabel(r'$\\uparrow |H(f)|$');\n",
" ax.axvline(f0/1000,0,1, color='k',linestyle='--');\n",
" ax.axvline(f0/1000,0,1, color='rwth:black',linestyle='--');\n",
" \n",
" ax = axs[1]; ax.plot(t*1000, h(t), 'rwth:blue'); rwth_plots.axis(ax); ax.set_xlim([-.225, 5])\n",
" ax.set_xlabel(r'$\\rightarrow t$ [ms]'); ax.set_ylabel(r'$\\uparrow h(t)$');\n",
......
......@@ -346,7 +346,7 @@
"source": [
"T0 = T/4 # width of rects for shape-top sampling\n",
"\n",
"plt.close(); fig, axs = plt.subplots(4, 1, **rwth_plots.landscape); plt.tight_layout();\n",
"fig, axs = plt.subplots(4, 1, **rwth_plots.landscape); plt.tight_layout();\n",
"@widgets.interact(sampling_type=widgets.Dropdown(options=['Shape-top', 'Flat-top'], description=r'Art der Abtastung:', style=rwth_plots.wdgtl_style),\n",
" s_type=widgets.Dropdown(options=list(signals_t.keys()), description=r'Wähle $s(t)$:'),\n",
" F=widgets.FloatSlider(min=0.1, max=2, value=0.9, step=.1, description=r'$F$', style=rwth_plots.wdgtl_style, continuous_update=False))\n",
......@@ -416,7 +416,7 @@
" ax.set_xlim([-2.9, 2.9]); ax.legend(loc=2); rwth_plots.grid(ax); rwth_plots.axis(ax);\n",
" \n",
" ax = axs[1]; ax.set_title('Frequenzbereich');\n",
" ax.plot(f, np.abs(H), '-', color='black', label=r'$|H(f)|$')\n",
" ax.plot(f, np.abs(H), '-', color='rwth:black', label=r'$|H(f)|$')\n",
" if s_type == 'cos-Funktion' or s_type == 'sin-Funktion':\n",
" ax.plot(f, np.ones_like(f)*np.nan, '-', color='rwth:red', label=r'$|S_0(f)|$');\n",
" rwth_plots.plot_dirac(ax, fS0dirac, np.abs(S0dirac), 'rwth:red');\n",
......@@ -426,8 +426,8 @@
" ax.plot(f, S(f), color='rwth:blue', linestyle='--', linewidth=1, label=r'$S(f)$')\n",
" ax.set_xlim([-7.5,7.5]); ax.set_ylim([-1,2]); ax.legend(loc=2);\n",
" ax.set_xlabel(r'$\\rightarrow f$'); rwth_plots.grid(ax); rwth_plots.axis(ax);\n",
" txt,_=rwth_plots.annotate_xtick(ax, r'$r=2$', r, -.15, 'black'); txt.get_bbox_patch().set_alpha(1);\n",
" txt,_=rwth_plots.annotate_xtick(ax, r'$f_\\mathrm{g}$', r/2, -.15, 'black'); txt.get_bbox_patch().set_alpha(1);\n",
" txt,_=rwth_plots.annotate_xtick(ax, r'$r=2$', r, -.15, 'rwth:black'); txt.get_bbox_patch().set_alpha(1);\n",
" txt,_=rwth_plots.annotate_xtick(ax, r'$f_\\mathrm{g}$', r/2, -.15, 'rwth:black'); txt.get_bbox_patch().set_alpha(1);\n",
" \n",
" ax = axs[2];\n",
" if s_type == 'cos-Funktion' or s_type == 'sin-Funktion':\n",
......
......@@ -118,7 +118,7 @@
"f = 0.5*fs*w/np.pi\n",
"\n",
"fig,ax = plt.subplots(1,1); ax.plot(f, np.abs(H), 'rwth:blue'); \n",
"ax.axvline(fg, color='k',linestyle='--',lw=0.5); # cutoff frequency\n",
"ax.axvline(fg, color='rwth:black',linestyle='--',lw=0.5); # cutoff frequency\n",
"ax.set_xlabel(r'$\\rightarrow f$ [Hz]'); ax.set_ylabel(r'$\\uparrow |H(f)|$', bbox=rwth_plots.wbbox); \n",
"ax.set_xlim([0,4000]); ax.set_ylim([-.25,1.19]); rwth_plots.axis(ax); "
]
......
......@@ -64,7 +64,7 @@
"\n",
"# PLot\n",
"T0 = 4\n",
"plt.close(); fig,ax=plt.subplots();\n",
"fig,ax=plt.subplots();\n",
"ax.plot(t, s(t), 'rwth:blue'); \n",
"ax.set_xlabel(r'$\\rightarrow t$'); ax.set_ylabel(r'$\\uparrow s(t)$')\n",
"ax.set_xlim([-5,5]); ax.set_ylim([0,0.5]); rwth_plots.axis(ax);"
......@@ -249,7 +249,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
"version": "3.8.2"
}
},
"nbformat": 4,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment