Skip to content

Commit

Permalink
Format summary plots as single column rather than row
Browse files Browse the repository at this point in the history
  • Loading branch information
fjclark committed Jun 17, 2024
1 parent 533589d commit 3cbf635
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions analysis/adaptive/adaptive_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@
"source": [
"# Repeat above, but just plot the bound vanish stages\n",
"# Plot the equilibration times for each stage for each leg for each system\n",
"fig = plt.figure(figsize = (19, 30), dpi = 600)\n",
"gs = gridspec.GridSpec(10, 5, figure = fig)\n",
"fig = plt.figure(figsize = (28, 19), dpi = 600)\n",
"gs = gridspec.GridSpec(5, 10, figure = fig)\n",
"for i, lig in enumerate(ligs):\n",
" for j, leg in enumerate([\"LegType.BOUND\"]):\n",
" for stage in [\"StageType.VANISH\"]: \n",
" combined_row_ind = 3*j \n",
" gs0 = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec = gs[combined_row_ind, i], hspace = 0)\n",
" combined_col_ind = 3*j \n",
" gs0 = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec = gs[i, combined_col_ind], hspace = 0)\n",
" ax1 = fig.add_subplot(gs0[0])\n",
" ax2 = fig.add_subplot(gs0[1], sharex = ax1)\n",
"\n",
Expand Down Expand Up @@ -435,9 +435,9 @@
"axs = fig.get_axes()\n",
"axs[-4].set_title(\"PDE2a Bound Vanish\")\n",
"\n",
"# Add a legend to the figure, off to the right hand side of all the plots\n",
"# Add a legend to the figure, off to the bottom of the last plot\n",
"axs = fig.get_axes()\n",
"axs[-2].legend(bbox_to_anchor = (1.05, 0.5), loc = \"center left\", borderaxespad = 0)\n",
"axs[8].legend(bbox_to_anchor = (0.5, -1.6), loc = \"upper center\", borderaxespad = 0)\n",
"fig.tight_layout()\n",
"fig.savefig(\"final_analysis/equil_times.png\", dpi = 600, bbox_inches = \"tight\")\n",
" "
Expand Down Expand Up @@ -1118,8 +1118,7 @@
" # Need 5 axes for the for each system\n",
" n_systems = len(comparitive_conv_data)\n",
" # Share y-axis scales along rows\n",
" #fig, axs = plt.subplots(5, n_systems, figsize=(4*5, 4*n_systems), dpi=300)\n",
" fig, axs = plt.subplots(1, 5, figsize=(4*5, 4), dpi=300)\n",
" fig, axs = plt.subplots(5, 1, figsize=(3.5, 3.5*5), dpi=300)\n",
" for i, system in enumerate(systems):\n",
" for plt_type in [\"Adaptive\", \"Non-Adaptive\"]:\n",
" ax_ind = 0\n",
Expand Down Expand Up @@ -1147,6 +1146,11 @@
" plot_dgs_conv(axs[i], dgs, times_local, leg_label, stage_label, system, label=plt_type, scale_er=scale_er)\n",
" ax_ind += 1\n",
"\n",
" # Hide the legend on all but the final plot, and move this to below the plot\n",
" for ax in axs[:-1]:\n",
" ax.get_legend().remove()\n",
" axs[-1].legend(bbox_to_anchor=(0.2, -0.35), loc='center left')\n",
"\n",
" if scale:\n",
" # Set the y-axis scales to be the same within rows (same stages, different systems)\n",
" for i in range(1):\n",
Expand Down Expand Up @@ -1471,6 +1475,20 @@
"fig, ax = plot_dgs_conv_per_system(dgs_conv_nonequil_combined, errors=True)\n",
"fig.savefig(\"final_analysis/cis_conv_per_system.png\", dpi=600, bbox_inches=\"tight\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 3cbf635

Please sign in to comment.