Skip to content

Commit b3e949f

Browse files
committed
update aspect ratios
1 parent 568085b commit b3e949f

4 files changed

+22
-22
lines changed

tutorial/10_hextof_workflow_trXPS_bam_correction.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
"metadata": {},
239239
"outputs": [],
240240
"source": [
241-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
241+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
242242
"res.plot(robust=True, ax=ax[0], cmap='terrain')\n",
243243
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
244244
"ax[0].set_title('raw')\n",
@@ -338,7 +338,7 @@
338338
"outputs": [],
339339
"source": [
340340
"\n",
341-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
341+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
342342
"res_bam.sel(bam=slice(-6400,-5100)).sum('trainId').plot(ax=ax[0],robust=True, cmap='terrain')\n",
343343
"res_bam.sel(bam=slice(-6400,-5100)).sum('pulseId').plot(ax=ax[1],robust=True, cmap='terrain')\n",
344344
"plt.show()"
@@ -404,7 +404,7 @@
404404
"metadata": {},
405405
"outputs": [],
406406
"source": [
407-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
407+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
408408
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
409409
"res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
410410
"ax[0].set_title('raw')\n",
@@ -497,7 +497,7 @@
497497
"metadata": {},
498498
"outputs": [],
499499
"source": [
500-
"fig,ax=plt.subplots(2,2,figsize=(6,8),layout=\"constrained\")\n",
500+
"fig,ax=plt.subplots(2,2,figsize=(6,6),layout=\"constrained\")\n",
501501
"\n",
502502
"plt.axes(ax[0,0])\n",
503503
"res.plot(cmap='terrain', robust=True)\n",

tutorial/11_hextof_workflow_trXPS_energy_calibration_using_SB.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@
327327
"bins = [100,60]\n",
328328
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
329329
"\n",
330-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
330+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
331331
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
332332
"res_corr.plot(ax=ax[0], cmap='terrain')\n",
333333
"ax[0].set_title('raw')\n",
@@ -443,7 +443,7 @@
443443
"bins = [200,60]\n",
444444
"res_corr = sp_44498.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
445445
"\n",
446-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
446+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
447447
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
448448
"res_corr.plot(ax=ax[0], cmap='terrain')\n",
449449
"ax[0].set_title('raw')\n",

tutorial/4_hextof_workflow.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@
345345
"metadata": {},
346346
"outputs": [],
347347
"source": [
348-
"fig,ax = plt.subplots(1,3,figsize=(6,4), layout='tight')\n",
349-
"res_chessy.plot(ax=ax[0], robust=True)\n",
350-
"res_t05.plot(ax=ax[1], robust=True)\n",
351-
"res_t10.plot(ax=ax[2], robust=True)"
348+
"fig,ax = plt.subplots(1,3,figsize=(6,2), layout='tight')\n",
349+
"res_chessy.plot(ax=ax[0], robust=True, add_colorbar=False)\n",
350+
"res_t05.plot(ax=ax[1], robust=True, add_colorbar=False)\n",
351+
"res_t10.plot(ax=ax[2], robust=True, add_colorbar=False)"
352352
]
353353
},
354354
{
@@ -759,7 +759,7 @@
759759
"metadata": {},
760760
"outputs": [],
761761
"source": [
762-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
762+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
763763
"res.plot(robust=True, ax=ax[0])\n",
764764
"bg = res.isel(delayStage=slice(0,10)).mean('delayStage')\n",
765765
"(res-bg).plot(robust=True, ax=ax[1])"
@@ -827,7 +827,7 @@
827827
},
828828
"outputs": [],
829829
"source": [
830-
"fig,ax = plt.subplots(1,2,figsize=(6,4))\n",
830+
"fig,ax = plt.subplots(1,2,figsize=(6,3))\n",
831831
"res.plot(robust=True, ax=ax[0])\n",
832832
"bg = res.sel(delayStage=slice(-1,-0.2)).mean('delayStage')\n",
833833
"(res-bg).plot(robust=True, ax=ax[1])\n",
@@ -848,7 +848,7 @@
848848
"outputs": [],
849849
"source": [
850850
"res = sp.compute(bins=bins, axes=axes, ranges=ranges, normalize_to_acquisition_time=\"delayStage\")\n",
851-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
851+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
852852
"res.plot(robust=True, ax=ax[0])\n",
853853
"bg = res.sel(delayStage=slice(-1,-.2)).mean('delayStage')\n",
854854
"(res-bg).plot(robust=True, ax=ax[1])"
@@ -966,7 +966,7 @@
966966
"metadata": {},
967967
"outputs": [],
968968
"source": [
969-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
969+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
970970
"res.plot(robust=True, ax=ax[0])\n",
971971
"bg = res.sel(delayStage=slice(-1,-.2)).mean('delayStage')\n",
972972
"(res-bg).plot(robust=True, ax=ax[1])"

tutorial/9_hextof_workflow_trXPD.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
"metadata": {},
292292
"outputs": [],
293293
"source": [
294-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
294+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
295295
"fig.suptitle(f\"Run {run_number}: W 4f, side bands\")\n",
296296
"res_corr.plot(robust=True, ax=ax[0], cmap='terrain')\n",
297297
"ax[0].set_title('raw')\n",
@@ -341,7 +341,7 @@
341341
"plt.show()\n",
342342
"\n",
343343
"## XPD plots\n",
344-
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
344+
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
345345
"res_kx_ky.sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
346346
"ax[0,0].set_title(\"XPD of $1^{st}$ order sidebands\")\n",
347347
"res_kx_ky.sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
@@ -381,7 +381,7 @@
381381
"## Apply Gaussian Blur to background image\n",
382382
"bgd_blur = xr.apply_ufunc(gaussian_filter, bgd, 15)\n",
383383
"\n",
384-
"fig,ax = plt.subplots(1,2,figsize=(6,4), layout='constrained')\n",
384+
"fig,ax = plt.subplots(1,2,figsize=(6,3), layout='constrained')\n",
385385
"bgd.plot(robust=True, cmap='terrain', ax=ax[0])\n",
386386
"ax[0].set_title('Background image')\n",
387387
"bgd_blur.plot(cmap='terrain', ax=ax[1])\n",
@@ -397,23 +397,23 @@
397397
"outputs": [],
398398
"source": [
399399
"## XPD normalized by background image\n",
400-
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
400+
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
401401
"(res_kx_ky/bgd).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
402402
"(res_kx_ky/bgd).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
403403
"(res_kx_ky/bgd).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
404404
"(res_kx_ky/bgd).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
405405
"fig.suptitle(f'Run {run_number}: XPD patterns after background normalization',fontsize='18')\n",
406406
"\n",
407407
"## XPD normalized by Gaussian-blurred background image\n",
408-
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
408+
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
409409
"(res_kx_ky/bgd_blur).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
410410
"(res_kx_ky/bgd_blur).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
411411
"(res_kx_ky/bgd_blur).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
412412
"(res_kx_ky/bgd_blur).sel(energy=slice(-37.0,-36.0)).mean('energy').plot(robust=True, ax=ax[1,1], cmap='terrain')\n",
413413
"fig.suptitle(f'Run {run_number}: XPD patterns after Gaussian-blurred background normalization',fontsize='18')\n",
414414
"\n",
415415
"## XPD normalized by Gaussian-blurred background image and blurred to improve contrast\n",
416-
"fig,ax = plt.subplots(2,2,figsize=(9,7), layout='constrained')\n",
416+
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
417417
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-30.3,-29.9)).mean('energy').plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
418418
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-31.4,-31.2)).mean('energy').plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
419419
"(xr.apply_ufunc(gaussian_filter, res_kx_ky/bgd_blur, 1)).sel(energy=slice(-33.6,-33.4)).mean('energy').plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
@@ -451,7 +451,7 @@
451451
"W_5p_blur = xr.apply_ufunc(gaussian_filter, W_5p, 15)\n",
452452
"\n",
453453
"### Visualize results\n",
454-
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
454+
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
455455
"(SB/SB_blur).plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
456456
"(W_4f_7/W_4f_7_blur).plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
457457
"(W_4f_5/W_4f_5_blur).plot(robust=True, ax=ax[1,0], cmap='terrain')\n",
@@ -465,7 +465,7 @@
465465
"W_5p_norm = xr.apply_ufunc(gaussian_filter, W_5p/W_5p_blur, 1)\n",
466466
"\n",
467467
"### Visualize results\n",
468-
"fig,ax = plt.subplots(2,2,figsize=(6,8), layout='constrained')\n",
468+
"fig,ax = plt.subplots(2,2,figsize=(6,6), layout='constrained')\n",
469469
"SB_norm.plot(robust=True, ax=ax[0,0], cmap='terrain')\n",
470470
"W_4f_7_norm.plot(robust=True, ax=ax[0,1], cmap='terrain')\n",
471471
"W_4f_5_norm.plot(robust=True, ax=ax[1,0], cmap='terrain')\n",

0 commit comments

Comments
 (0)