Skip to content

Commit

Permalink
Adjust font size
Browse files Browse the repository at this point in the history
  • Loading branch information
jcohenadad committed Jan 10, 2024
1 parent 36356d2 commit fd6c37b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions data_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@
"source": [
"# Make figure of B1+ values along the spinal cord across shim methods\n",
"\n",
"plt.rcParams['font.family'] = 'Arial'\n",
"\n",
"def smooth_data(data, window_size=20):\n",
" \"\"\" Apply a simple moving average to smooth the data. \"\"\"\n",
" return uniform_filter1d(data, size=window_size, mode='nearest')\n",
Expand All @@ -348,6 +350,7 @@
"\n",
"# Create a figure with multiple subplots\n",
"fig, axes = plt.subplots(n_rows, 1, figsize=(10, 6 * n_rows))\n",
"font_size = 18\n",
"\n",
"# Check if axes is an array or a single object\n",
"if n_rows == 1:\n",
Expand Down Expand Up @@ -389,12 +392,13 @@
" ax.set_xticks(custom_xticks)\n",
" ax.set_xticklabels([''] * len(original_vector))\n",
"\n",
" ax.set_title(f'{subject}')\n",
" ax.set_ylabel('B1+ efficiency [nT/V]')\n",
" ax.set_title(f'{subject}', fontsize=font_size)\n",
" ax.set_ylabel('B1+ efficiency [nT/V]', fontsize=font_size)\n",
" ax.tick_params(axis='y', which='major', labelsize=font_size-4)\n",
"\n",
" # Add legend only to the first subplot\n",
" if i == 0:\n",
" ax.legend()\n",
" ax.legend(fontsize=font_size)\n",
"\n",
" ax.grid(True)\n",
"\n",
Expand Down

0 comments on commit fd6c37b

Please sign in to comment.