Skip to content
Snippets Groups Projects
Commit 256d6ff1 authored by Loïc Le Guyader's avatar Loïc Le Guyader Committed by Laurent Mercadier
Browse files

Removes all tight_layout calls

parent eb65dce6
No related branches found
No related tags found
1 merge request!206Removes all tight_layout calls
...@@ -9,6 +9,7 @@ unreleased ...@@ -9,6 +9,7 @@ unreleased
- **Improvements** - **Improvements**
- remove calls to matplotlib tight_layout :mr:`206`
- **New Features** - **New Features**
......
...@@ -19,6 +19,21 @@ where in this example 2780 is the proposal number. After this and refreshing the ...@@ -19,6 +19,21 @@ where in this example 2780 is the proposal number. After this and refreshing the
browser, a new kernel named ``SCS Toolbox (p002780)`` is available and should browser, a new kernel named ``SCS Toolbox (p002780)`` is available and should
be used to run jupyter notebooks on the Maxwell Jupyter hub. be used to run jupyter notebooks on the Maxwell Jupyter hub.
Figures setup: enabling matplotlib constrained layout
+++++++++++++++++++++++++++++++++++++++++++++++++++++
To get the best looking figures generated by the SCS Toolbox, you
need to enable the experimental constrained_layout_ solver in matplotlib. This
is done in jupyter notebook with adding at the start the following lines:
.. code:: python
import matplotlib.pyplot as plt
plt.rcParams['figure.constrained_layout.use'] = True
.. _constrained_layout: https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html
Alternative: Manual ToolBox Installation Alternative: Manual ToolBox Installation
++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++
......
...@@ -1102,7 +1102,6 @@ def calibrateTIM(data, rollingWindow=200, mcp=1, plot=False, use_apd=True, intst ...@@ -1102,7 +1102,6 @@ def calibrateTIM(data, rollingWindow=200, mcp=1, plot=False, use_apd=True, intst
ax.set_ylabel(label_trace, size=10) ax.set_ylabel(label_trace, size=10)
ax.set_xlabel('sample #', size=10) ax.set_xlabel('sample #', size=10)
ax.legend(fontsize=8) ax.legend(fontsize=8)
plt.tight_layout()
return F return F
......
...@@ -171,7 +171,6 @@ def pulsePatternInfo(data, plot=False): ...@@ -171,7 +171,6 @@ def pulsePatternInfo(data, plot=False):
plt.plot(data['npulses_sase1'].trainId, data['npulses_sase1'], '^-', plt.plot(data['npulses_sase1'].trainId, data['npulses_sase1'], '^-',
ms=3, color='C2', label='SASE 1') ms=3, color='C2', label='SASE 1')
plt.legend() plt.legend()
plt.tight_layout()
def repRate(data=None, runNB=None, proposalNB=None, key='sase3'): def repRate(data=None, runNB=None, proposalNB=None, key='sase3'):
......
...@@ -110,5 +110,5 @@ def fluenceCalibration(hwp, power_mW, npulses, w0x, w0y=None, ...@@ -110,5 +110,5 @@ def fluenceCalibration(hwp, power_mW, npulses, w0x, w0y=None,
return 1e7*x*np.pi*w0x*w0y/2 return 1e7*x*np.pi*w0x*w0y/2
ax2 = ax.secondary_yaxis('right', functions=(fTe, eTf)) ax2 = ax.secondary_yaxis('right', functions=(fTe, eTf))
ax2.set_ylabel(r'Pulse energy [$\mu$J]') ax2.set_ylabel(r'Pulse energy [$\mu$J]')
fig.tight_layout()
return F*1e-1, fit_F, E*1e6, fit_E return F*1e-1, fit_F, E*1e6, fit_E
...@@ -235,7 +235,6 @@ def xas(nrun, bins=None, Iokey='SCS_SA3', Itkey='MCP3peaks', nrjkey='nrj', ...@@ -235,7 +235,6 @@ def xas(nrun, bins=None, Iokey='SCS_SA3', Itkey='MCP3peaks', nrjkey='nrj',
color='C0', alpha=0.2) color='C0', alpha=0.2)
ax2.set_xlabel('Energy (eV)') ax2.set_xlabel('Energy (eV)')
ax2.set_ylabel('counts') ax2.set_ylabel('counts')
plt.tight_layout()
return {'nrj': bins_c, 'muA': muA, 'sterrA': sterrA, return {'nrj': bins_c, 'muA': muA, 'sterrA': sterrA,
'sigmaA': nosample['sigmaA'], 'muIo': nosample['muIo'], 'sigmaA': nosample['sigmaA'], 'muIo': nosample['muIo'],
......
...@@ -93,4 +93,3 @@ def plot_knife_edge(positions, intensities, fit_params, rel_err, title, ...@@ -93,4 +93,3 @@ def plot_knife_edge(positions, intensities, fit_params, rel_err, title,
plt.ylabel(signalKey) plt.ylabel(signalKey)
plt.xlabel(axisKey + ' position [mm]') plt.xlabel(axisKey + ' position [mm]')
plt.title(title) plt.title(title)
plt.tight_layout()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment