From 4818a5a611db0912649c03bf4a2ac3a335a140ec Mon Sep 17 00:00:00 2001 From: ahmedk <karim.ahmed@xfel.eu> Date: Thu, 21 Dec 2023 15:35:00 +0100 Subject: [PATCH] improve plt text fonts --- .../Gotthard2/Correction_Gotthard2_NBC.ipynb | 21 ++++++++++--------- .../Summary_Darks_Gotthard2_NBC.ipynb | 8 ++++--- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb index 4f8f4901c..a577130fb 100644 --- a/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Correction_Gotthard2_NBC.ipynb @@ -564,20 +564,20 @@ "\n", "step_timer.start()\n", "\n", - "fig, ax = plt.subplots(figsize=(20, 10))\n", + "fig, ax = plt.subplots(figsize=(15, 15))\n", "raw_data = mod_dcs[corr_data_source][\"train_raw_data\"]\n", "im = ax.plot(np.mean(raw_data, axis=0))\n", - "ax.set_title(title.format(\"RAW\"))\n", + "ax.set_title(title.format(\"RAW\"), fontsize=20)\n", "ax.set_xlabel(\"Strip #\", size=20)\n", "ax.set_ylabel(\"12-bit ADC output\", size=20)\n", "plt.xticks(fontsize=20)\n", "plt.yticks(fontsize=20)\n", "pass\n", "\n", - "fig, ax = plt.subplots(figsize=(20, 10))\n", + "fig, ax = plt.subplots(figsize=(15, 15))\n", "corr_data = mod_dcs[corr_data_source][\"train_corr_data\"]\n", "im = ax.plot(np.mean(corr_data, axis=0))\n", - "ax.set_title(title.format(\"CORRECTED\"))\n", + "ax.set_title(title.format(\"CORRECTED\"), fontsize=20)\n", "ax.set_xlabel(\"Strip #\", size=20)\n", "ax.set_ylabel(\"10-bit KeV. output\", size=20)\n", "plt.xticks(fontsize=20)\n", @@ -599,8 +599,8 @@ "for plt_data, dname in zip(\n", " [\"train_raw_data\", \"train_corr_data\"], [\"RAW\", \"CORRECTED\"]\n", "):\n", - " fig, ax = plt.subplots(figsize=(15, 20))\n", - " plt.rcParams.update({\"font.size\": 15})\n", + " fig, ax = plt.subplots(figsize=(15, 15))\n", + " plt.rcParams.update({\"font.size\": 20})\n", "\n", " heatmapPlot(\n", " mod_dcs[corr_data_source][plt_data],\n", @@ -608,6 +608,7 @@ " x_label=\"Strips\",\n", " title=title.format(dname),\n", " use_axis=ax,\n", + " cb_pad=0.8,\n", " )\n", " pass\n", "step_timer.done_step(\"Plotting RAW and CORRECTED data for one train\")" @@ -653,7 +654,7 @@ "source": [ "display(Markdown(\"### RAW and CORRECTED even/odd pulses for one train:\"))\n", "display(Markdown(f\"Train: {tid}\"))\n", - "fig, ax = plt.subplots(figsize=(20, 20))\n", + "fig, ax = plt.subplots(figsize=(15, 15))\n", "raw_data = mod_dcs[corr_data_source][\"train_raw_data\"]\n", "corr_data = mod_dcs[corr_data_source][\"train_corr_data\"]\n", "\n", @@ -661,7 +662,7 @@ "if even_pulse:\n", " ax.plot(raw_data[even_pulse], label=f\"Even Pulse {even_pulse}\")\n", "\n", - "ax.set_title(title.format(\"RAW\"))\n", + "ax.set_title(title.format(\"RAW\"), fontsize=20)\n", "ax.set_xlabel(\"Strip #\", size=20)\n", "ax.set_ylabel(\"12-bit ADC RAW\", size=20)\n", "plt.xticks(fontsize=20)\n", @@ -669,11 +670,11 @@ "ax.legend()\n", "pass\n", "\n", - "fig, ax = plt.subplots(figsize=(20, 20))\n", + "fig, ax = plt.subplots(figsize=(15, 15))\n", "ax.plot(corr_data[odd_pulse], label=f\"Odd Pulse {odd_pulse}\")\n", "if even_pulse:\n", " ax.plot(corr_data[even_pulse], label=f\"Even Pulse {even_pulse}\")\n", - "ax.set_title(title.format(\"CORRECTED\"))\n", + "ax.set_title(title.format(\"CORRECTED\"), fontsize=20)\n", "ax.set_xlabel(\"Strip #\", size=20)\n", "ax.set_ylabel(\"10-bit KeV CORRECTED\", size=20)\n", "plt.xticks(fontsize=20)\n", diff --git a/notebooks/Gotthard2/Summary_Darks_Gotthard2_NBC.ipynb b/notebooks/Gotthard2/Summary_Darks_Gotthard2_NBC.ipynb index 45e802f99..756097845 100644 --- a/notebooks/Gotthard2/Summary_Darks_Gotthard2_NBC.ipynb +++ b/notebooks/Gotthard2/Summary_Darks_Gotthard2_NBC.ipynb @@ -169,9 +169,11 @@ " ax.set_xticks(\n", " np.arange(0, plt_map[cname].shape[0]+1, plt_map[cname].shape[0]//16)\n", " )\n", - " ax.set_xlabel(\"Stripes #\")\n", - " ax.set_xlabel(cname)\n", - " ax.set_title(title.format(f\"{cname} map - Cell {cell}\"))\n", + " ax.set_xlabel(\"Stripes #\", fontsize=15)\n", + " ax.set_ylabel(\"ADU\", fontsize=15)\n", + " ax.set_title(title.format(f\"{cname} map - Cell {cell}\"), fontsize=15)\n", + " if cname == \"BadPixelsDark\":\n", + " ax.set_ylim([0, 5])\n", " ax.legend()\n", " plt.show()" ] -- GitLab