diff --git a/rln-delay-simulations/message_hops.py b/rln-delay-simulations/message_hops.py index 76850da..01175cf 100644 --- a/rln-delay-simulations/message_hops.py +++ b/rln-delay-simulations/message_hops.py @@ -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() - diff --git a/rln-delay-simulations/message_hops.svg b/rln-delay-simulations/message_hops.svg index eb15958..c2c1758 100644 --- a/rln-delay-simulations/message_hops.svg +++ b/rln-delay-simulations/message_hops.svg @@ -1,16 +1,16 @@ - + - 2024-03-04T15:18:25.534506 + 2024-03-05T16:29:27.525199 image/svg+xml - Matplotlib v3.7.2, https://matplotlib.org/ + Matplotlib v3.7.5, https://matplotlib.org/ @@ -21,19 +21,19 @@ - - @@ -41,2280 +41,2283 @@ z - - + - - + - + - - + - + - + - + - - + - + - + - + - - + - + - + - + - - + - + - + - + - - - - + + - + - + - - - + + + - + - + - - - + + + - - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - + - - - + + + - + - + - - - + + + - + - + - - - + + + - + - + - - - - + + + - + - + - - - - + + + + - + - + - - - - + + + + - + - + - - - - + + + + - - - - + - + + + + + + + + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - - - - - - + + + - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - - - - - - - - - - - - - - + + + + + + + + + + + + - - + - - - - - - - - - - - + + + + + + + + + + + + + - - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - + - - - - - + + + + - + - + - - - - - + + + + - + - + - - - - - + + + + - - - - + - + + + + + + + + - + - + + + + + + + + - + - + + + + + + + + - + - + + + + + + + + - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + +