style fixes for message hops plot

This commit is contained in:
Sergei Tikhomirov 2024-03-05 16:32:12 +01:00
parent 0e2eb3aab1
commit 37d788eb77
No known key found for this signature in database
GPG Key ID: 6A1F8ED9D6538027
2 changed files with 1554 additions and 1544 deletions

View File

@ -26,18 +26,25 @@ with plt.style.context(['science', 'ieee']):
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
ax1.plot(ds, delays_1, color='r', label=r"$N_1=$"+str(N1))
ax1.plot(ds, delays_2, color='g', label=r"$N_2=$"+str(N2))
ax1.plot(ds, delays_3, color='b', label=r"$N_3=$"+str(N3))
ax2.plot(ds, ds, color='y', label="Bandwidth ampl.")
ax1.plot(ds, delays_1, color='r', label=str(N1)+" nodes")
ax1.plot(ds, delays_2, color='g', label=str(N2)+" nodes")
ax1.plot(ds, delays_3, color='b', label=str(N3)+" nodes")
ax2.plot(ds, ds, color='y', label="Bandwidth\namplification")
ax1.autoscale(tight=True)
ax2.autoscale(tight=True)
ax1.legend(loc=0)
ax2.legend(loc=0)
ax1.set(title='$h_{max}$ depending on node degree $D$')
ax1.set(**dict(xlabel='Node degree (D)', ylabel='Maximum number of hops ($h_{max}$)'))
ax2.set(**dict(ylabel='Bandwidth amplification'))
fig.savefig('message_hops.svg', dpi=300)
ax1.legend(loc=(0.08, 0.7))
ax2.legend(loc=(0.5, 0.76))
ax1.set(title='$h_{max}$ and bandwidth amplification depending on node degree $D$\n')
ax1.set(**dict(xlabel='Node degree (D)', ylabel='Maximum number of hops ($h_{max}$)\n'))
ax2.set(**dict(ylabel='\nBandwidth amplification'))
# Set the limits of the x-axis and y-axis
ax1.set_xlim(2, 15)
ax1.set_ylim(2, ax1.get_ylim()[1]) # Ensure that the lower limit is 2
# Set the limits of the second y-axis to match the first y-axis
ax2.set_ylim(ax1.get_ylim())
fig.savefig('message_hops.svg', dpi=600)
plt.close()

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 74 KiB