Skip to content

Commit

Permalink
figure1 FOV done
Browse files Browse the repository at this point in the history
  • Loading branch information
mezdahun committed Apr 16, 2024
1 parent a5bb05a commit 96db251
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

# data path
exp_name = "VSWRMExp1"
data_path = f"/home/david/Desktop/database/VSWRM_figdata/{exp_name}/summary"
# data_path = f"/home/david/Desktop/database/VSWRM_figdata/{exp_name}/summary"
data_path = os.path.join("G:\\", "VSWRMData", "FigData", f"{exp_name}", "summary")

# included metrics
metrics = ["Phase Diagram", "Polarization\n Order", "Mean Inter-\nIndividual Distance", "Size of \nLargest Cluster", "Area-to-Circle\nRatio [%]", "Time Ratio\n in Overlap [%]"]
Expand Down Expand Up @@ -80,19 +81,19 @@
if mi == len(metrics) - 1:
if fi == 0:
ax[mi, fi].set_xlabel("$\\beta_0$", fontsize=12)
ax[mi, fi].set_xticks(range(len(betas)), ha='left', rotation_mode='anchor')
ax[mi, fi].set_xticks(range(len(betas)), ha='right', rotation_mode='anchor')
ax[mi, fi].set_xticklabels(betas)
# set tick rotation to 45 degrees
ax[mi, fi].tick_params(axis='x', rotation=45, labelsize=10)
ax[mi, fi].tick_params(axis='x', rotation=45, labelsize=7)
else:
# making ticks half as long
ax[mi, fi].set_xlabel("$\\beta_0$", fontsize=12)
rare_betas = [b if i % 3 == 0 else "" for i, b in enumerate(betas)]
rare_betas[-1] = betas[-1]
ax[mi, fi].set_xticks(range(len(rare_betas)), ha='left', rotation_mode='anchor')
ax[mi, fi].set_xticks(range(len(rare_betas)), ha='right', rotation_mode='anchor')
ax[mi, fi].set_xticklabels(rare_betas)
# set tick rotation to 45 degrees
ax[mi, fi].tick_params(axis='x', rotation=45, labelsize=10)
ax[mi, fi].tick_params(axis='x', rotation=45, labelsize=7)

else:
plt.axes(ax[mi, fi])
Expand All @@ -104,13 +105,14 @@
ax[mi, fi].set_ylabel("$\\alpha_0$", fontsize=12)
ax[mi, fi].set_yticks(range(len(alphas)))
ax[mi, fi].set_yticklabels(alphas)
ax[mi, fi].tick_params(axis='y', labelsize=7)
else:
ax[mi, fi].set_ylabel("$\\alpha_0$", fontsize=12)
rare_alphas = [a if i % 3 == 0 else "" for i, a in enumerate(alphas)]
rare_alphas[-1] = alphas[-1]
ax[mi, fi].set_yticks(range(len(rare_alphas)))
ax[mi, fi].set_yticklabels(rare_alphas)
ax[mi, fi].tick_params(axis='y', labelsize=10)
ax[mi, fi].tick_params(axis='y', labelsize=7)
else:
plt.axes(ax[mi, fi])
plt.yticks([], [])
Expand All @@ -129,8 +131,8 @@
plt.xticks([], [])

# setting font on all x and y axis to smaller
for a in ax.flatten():
a.tick_params(axis='both', which='major', labelsize=12)
# for a in ax.flatten():
# a.tick_params(axis='both', which='major', labelsize=10)

# plotting adjustments (5 rows)
left = 0.226
Expand Down Expand Up @@ -179,16 +181,16 @@
# cb.ax.tick_params(axis='y', rotation=45)

# set tick font size to 5
cb.ax.tick_params(labelsize=12)
cb.ax.tick_params(labelsize=10)

# set ylabel font size to 7
cb.ax.set_ylabel(metrics[len(metrics)-imi], fontsize=14, rotation=270, labelpad=30)
cb.ax.set_ylabel(metrics[len(metrics)-imi], fontsize=10, rotation=270, labelpad=30)


# for 5 rows
# plt.subplots_adjust(hspace=0, wspace=0, top=0.976, bottom=0.062, left=0.226, right=0.798)

# for 6 rows
plt.subplots_adjust(hspace=0, wspace=0.026, top=top, bottom=bottom, left=left, right=right)
plt.subplots_adjust(hspace=0, wspace=0.07, top=top, bottom=bottom, left=left, right=right)
plt.show()

0 comments on commit 96db251

Please sign in to comment.