In [1]:
# import require modules
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
import matplotlib.font_manager as font_manager
In [2]:
fig, ((ax1, ax2),(ax3, ax4)) = plt.subplots(2, 2, sharex=True, figsize=(10,10),height_ratios=[1, 1])
fig.subplots_adjust(hspace=0.2) # adjust space between axes
# defining our function
x = np.array([2,4,6,8,10,12])
y1g = np.array([0.0505498,0.07225657,0.10989793,0.14623785,0.20694185,0.25103744])
y1c = np.array([0.05684322,0.07632171,0.11070624,0.1983243,0.25898617,0.30597117])
y2g = np.array([0.05107214,0.07503005,0.12229158,0.1546573,0.23731661,0.28841765])
y2c = np.array([0.05893816,0.1007674,0.19338229,0.22684351,0.28480608,0.32335647])
y3g = np.array([0.05465102,0.07775937,0.11523779,0.1626817,0.2518993,0.30309855])
y3c = np.array([0.23700975,0.33820038,0.40077453,0.49321109,0.57601173,0.63589566])
y4g = np.array([0.07508719,0.1382508,0.17532599,0.26548427,0.3159314,0.33068727])
y4c = np.array([5.69144137,6.13588745,6.56826999,7.10895093,7.76247525,8.50932085])
# defining our error
y1g_error = np.array([0.001635741,0.001885854,0.007179432,0.003248441,0.010577953,0.023251179])
y1c_error = np.array([0.002935859,0.003569312,0.003224081,0.013349652,0.04219231,0.019986085])
y2g_error = np.array([0.002235621,0.002769425,0.012661933,0.007602335,0.024689569,0.020814836])
y2c_error = np.array([0.002300318,0.008099847,0.011495777,0.013968676,0.018272701,0.018484391])
y3g_error = np.array([0.002348864,0.003837838,0.005499951,0.007827556,0.0155144,0.034273429])
y3c_error = np.array([0.008474834,0.010702491,0.010899045,0.00929727,0.011686555,0.018898851])
y4g_error = np.array([0.007602763,0.009130587,0.013555975,0.018658404,0.019257656,0.020235173])
y4c_error = np.array([0.015973196,0.038710738,0.051484866,0.03997165,0.036587322,0.126108367])
# plotting our function and
# error bar
ax1.plot(x, y1g,label=" Greedy" , marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax1.plot(x, y1c,label=" Combination", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax2.plot(x, y2g,label=" Greedy" , marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax2.plot(x, y2c,label=" Combination", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax3.plot(x, y3g,label=" Greedy" , marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax3.plot(x, y3c,label=" Combination", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax4.plot(x, y4g,label=" Greedy" , marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax4.plot(x, y4c,label=" Combination", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax1.errorbar(x, y1g, yerr = y1g_error, color="b", capsize=2, capthick=1,)
ax1.errorbar(x, y1c, yerr = y1c_error, color="r", capsize=2, capthick=1,)
ax1.legend()
ax2.errorbar(x, y2g, yerr = y2g_error, color="b", capsize=2, capthick=1,)
ax2.errorbar(x, y2c, yerr = y2c_error, color="r", capsize=2, capthick=1,)
ax2.legend()
ax3.errorbar(x, y3g, yerr = y3g_error, color="b", capsize=2, capthick=1,)
ax3.errorbar(x, y3c, yerr = y3c_error, color="r", capsize=2, capthick=1,)
ax3.legend()
ax4.errorbar(x, y4g, yerr = y4g_error, color="b", capsize=2, capthick=1,)
ax4.errorbar(x, y4c, yerr = y4c_error, color="r", capsize=2, capthick=1,)
ax4.legend()
ax1.set_xlabel("Number of Elements")
ax1.set_ylabel("time (seconds)")
ax1.set_title("Policy Provisioning for 5 NSFs")
ax2.set_xlabel("Number of Elements")
ax2.set_ylabel("time (seconds)")
ax2.set_title("Policy Provisioning for 10 NSFs")
ax3.set_xlabel("Number of Elements")
ax3.set_ylabel("time (seconds)")
ax3.set_title("Policy Provisioning for 15 NSFs")
ax4.set_xlabel("Number of Elements")
ax4.set_ylabel("time (seconds)")
ax4.set_title("Policy Provisioning for 20 NSFs")
major_ticks = np.arange(2, 13, 2)
ax1.set_xticks(major_ticks)
ax2.set_xticks(major_ticks)
ax3.set_xticks(major_ticks)
ax4.set_xticks(major_ticks)
ax1.grid()
ax2.grid()
ax3.grid()
ax4.grid()
In [3]:
# defining our function
x = np.array([5,10,15,20])
y1 = np.array([0.0505498,0.05107214,0.05465102,0.07508719])
y2 = np.array([0.07225657,0.07503005,0.07775937,0.1382508])
y3 = np.array([0.10989793,0.12229158,0.11523779,0.17532599])
y4 = np.array([0.14623785,0.1546573,0.1626817,0.26548427])
y5 = np.array([0.20694185,0.23731661,0.2518993,0.3159314])
y6 = np.array([0.25103744,0.28841765,0.30309855,0.33068727])
# defining our error
y1_error = np.array([0.001635741,0.002235621,0.002348864,0.007602763])
y2_error = np.array([0.001885854,0.002769425,0.003837838,0.009130587])
y3_error = np.array([0.007179432,0.012661933,0.005499951,0.013555975])
y4_error = np.array([0.003248441,0.007602335,0.007827556,0.018658404])
y5_error = np.array([0.010577953,0.024689569,0.0155144,0.019257656])
y6_error = np.array([0.023251179,0.020814836,0.034273429,0.020235173])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=12, mew=2)
ax.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=12, mew=2)
ax.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=12, mew=2)
ax.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=12, mew=2)
ax.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=12, mew=2)
ax.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=12, mew=2)
plt.legend()
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
plt.xlabel("NSFs")
plt.ylabel("time (seconds)")
plt.title("Policy Provisioning with Greedy Algorithm")
major_ticks = np.arange(5, 21, 5)
ax.set_xticks(major_ticks)
plt.grid()
plt.show()
In [ ]:
In [4]:
# defining our function
x = np.array([5,10,15,20])
y1 = np.array([0.05684322, 0.05893816, 0.23700975, 5.69144137])
y2 = np.array([0.07632171, 0.1007674 , 0.33820038, 6.13588745])
y3 = np.array([0.11070624, 0.19338229, 0.40077453, 6.56826999])
y4 = np.array([0.1983243 , 0.22684351, 0.49321109, 7.10895093])
y5 = np.array([0.25898617, 0.28480608, 0.57601173, 7.76247525])
y6 = np.array([0.30597117, 0.32335647, 0.63589566, 8.50932085])
# defining our error
y1_error = np.array([0.002935859, 0.002300318, 0.008474834, 0.015973196])
y2_error = np.array([0.003569312, 0.008099847, 0.010702491, 0.038710738])
y3_error = np.array([0.003224081, 0.011495777, 0.010899045, 0.051484866])
y4_error = np.array([0.013349652, 0.013968676, 0.00929727, 0.03997165])
y5_error = np.array([ 0.04219231, 0.018272701, 0.011686555, 0.036587322])
y6_error = np.array([0.019986085, 0.018484391, 0.018898851, 0.126108367])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=5, mew=2)
ax.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=5, mew=2)
ax.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=5, mew=2)
ax.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=5, mew=2)
ax.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=5, mew=2)
ax.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=5, mew=2)
ax.legend()
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
ax.set_xlabel("NSFs")
ax.set_ylabel("time (seconds)")
ax.set_title("Policy Provisioning with Combination Algorithm")
major_ticks = np.arange(5, 21, 5)
ax.set_xticks(major_ticks)
plt.grid()
plt.show()
In [5]:
# defining our function
x = np.array([5,10,15,20])
y1 = np.array([0.05684322, 0.05893816, 0.23700975, 5.69144137])
y2 = np.array([0.07632171, 0.1007674 , 0.33820038, 6.13588745])
y3 = np.array([0.11070624, 0.19338229, 0.40077453, 6.56826999])
y4 = np.array([0.1983243 , 0.22684351, 0.49321109, 7.10895093])
y5 = np.array([0.25898617, 0.28480608, 0.57601173, 7.76247525])
y6 = np.array([0.30597117, 0.32335647, 0.63589566, 8.50932085])
# defining our error
y1_error = np.array([0.002935859, 0.002300318, 0.008474834, 0.015973196])
y2_error = np.array([0.003569312, 0.008099847, 0.010702491, 0.038710738])
y3_error = np.array([0.003224081, 0.011495777, 0.010899045, 0.051484866])
y4_error = np.array([0.013349652, 0.013968676, 0.00929727, 0.03997165])
y5_error = np.array([ 0.04219231, 0.018272701, 0.011686555, 0.036587322])
y6_error = np.array([0.019986085, 0.018484391, 0.018898851, 0.126108367])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=8, mew=2)
axins = inset_axes(ax, 4,5 , loc=2,bbox_to_anchor=(0.1, 0.85),bbox_transform=ax.transAxes)
axins.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=8, mew=2)
axins.set_xlim(4.5,15.5)
axins.set_ylim(0,0.7)
ax.legend(loc="lower right")
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
axins.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
axins.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
axins.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
axins.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
axins.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
axins.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
ax.set_xlabel("NSFs")
ax.set_ylabel("time (seconds)")
ax.set_title("Policy Provisioning with Combination Algorithm")
plt.xticks(visible=True)
plt.yticks(visible=True)
mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
major_ticks = np.arange(5, 21, 5)
minor_ticks = np.arange(5, 16, 5)
ax.set_xticks(major_ticks)
axins.set_xticks(minor_ticks)
ax.grid()
axins.grid()
plt.show()
In [6]:
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True, figsize=(10,10),height_ratios=[1, 1.5])
fig.subplots_adjust(hspace=0.05) # adjust space between axes
# defining our function
x = np.array([5,10,15,20])
y1 = np.array([0.05684322, 0.05893816, 0.23700975, 5.69144137])
y2 = np.array([0.07632171, 0.1007674 , 0.33820038, 6.13588745])
y3 = np.array([0.11070624, 0.19338229, 0.40077453, 6.56826999])
y4 = np.array([0.1983243 , 0.22684351, 0.49321109, 7.10895093])
y5 = np.array([0.25898617, 0.28480608, 0.57601173, 7.76247525])
y6 = np.array([0.30597117, 0.32335647, 0.63589566, 8.50932085])
# defining our error
y1_error = np.array([0.002935859, 0.002300318, 0.008474834, 0.015973196])
y2_error = np.array([0.003569312, 0.008099847, 0.010702491, 0.038710738])
y3_error = np.array([0.003224081, 0.011495777, 0.010899045, 0.051484866])
y4_error = np.array([0.013349652, 0.013968676, 0.00929727, 0.03997165])
y5_error = np.array([ 0.04219231, 0.018272701, 0.011686555, 0.036587322])
y6_error = np.array([0.019986085, 0.018484391, 0.018898851, 0.126108367])
# plotting our function and
ax1.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=10, mew=2)
ax2.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=10, mew=2)
ax1.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=5, mew=2)
ax2.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=5, mew=2)
ax1.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=5, mew=2)
ax2.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=5, mew=2)
ax1.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=5, mew=2)
ax2.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=5, mew=2)
ax1.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=5, mew=2)
ax2.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=5, mew=2)
ax1.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=5, mew=2)
ax2.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=5, mew=2)
# error bar
ax1.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax2.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax1.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax2.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax1.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax2.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax1.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax2.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax1.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax2.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax1.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
ax2.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
ax1.set_ylim(5.5, 9.) # outliers only
ax2.set_ylim(0, .8) # most of the data
ax1.spines.bottom.set_visible(False)
ax2.spines.top.set_visible(False)
ax1.xaxis.tick_top()
ax1.tick_params(labeltop=False) # don't put tick labels at the top
ax2.xaxis.tick_bottom()
d = .5 # proportion of vertical to horizontal extent of the slanted line
kwargs = dict(marker=[(-1, -d), (1, d)], markersize=12,
linestyle="none", color='k', mec='k', mew=1, clip_on=False)
ax1.plot([0, 1], [0, 0], transform=ax1.transAxes, **kwargs)
ax2.plot([0, 1], [1, 1], transform=ax2.transAxes, **kwargs)
plt.xlabel("NSFs")
plt.ylabel("time (seconds)")
ax1.set_title("Policy Provisioning with Combination Algorithm")
ax1.grid()
ax2.grid()
major_ticks = np.arange(5, 21, 5)
ax1.set_xticks(major_ticks)
ax2.set_xticks(major_ticks)
ax1.legend()
plt.show()
In [7]:
# defining our function
x = np.array([5,10,15,20])
y1 = np.array([0.25103744,0.28841765,0.30309855,0.33068727])
y2 = np.array([0.30597117, 0.32335647, 0.63589566, 8.50932085])
# defining our error
y1_error = np.array([0.023251179,0.020814836,0.034273429,0.020235173])
y2_error = np.array([0.019986085, 0.018484391, 0.018898851, 0.126108367])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label="Greedy", marker ='H', color="r", markerfacecolor="None", markersize=12, mew=2)
ax.plot(x, y2,label="Combination", marker ='s', color="b", markerfacecolor="None", markersize=12, mew=2)
ax.legend()
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="b", capsize=2, capthick=1,)
ax.set_xlabel("NSFs")
ax.set_ylabel("time (seconds)")
ax.set_title("Policy Provisioning Comparison")
major_ticks = np.arange(5, 21, 5)
ax.set_xticks(major_ticks)
plt.grid()
plt.show()
In [8]:
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True, figsize=(10,10),height_ratios=[1, 3])
fig.subplots_adjust(hspace=0.05) # adjust space between axes
# defining our function
x = np.array([5,10,15,20])
y1 = np.array([0.25103744,0.28841765,0.30309855,0.33068727])
y2 = np.array([0.30597117, 0.32335647, 0.63589566, 8.50932085])
# defining our error
y1_error = np.array([0.023251179,0.020814836,0.034273429,0.020235173])
y2_error = np.array([0.019986085, 0.018484391, 0.018898851, 0.126108367])
# plotting our function and
ax1.plot(x, y1,label="Greedy", marker ='s', color="r", markerfacecolor="None", markersize=12, mew=2)
ax2.plot(x, y1,label="Greedy", marker ='s', color="r", markerfacecolor="None", markersize=12, mew=2)
ax1.plot(x, y2,label="Combination", marker ='s', color="b", markerfacecolor="None", markersize=12, mew=2)
ax2.plot(x, y2,label="Combination", marker ='s', color="b", markerfacecolor="None", markersize=12, mew=2)
# error bar
ax1.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax2.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax1.errorbar(x, y6, yerr = y6_error, color="b", capsize=2, capthick=1,)
ax2.errorbar(x, y6, yerr = y6_error, color="b", capsize=2, capthick=1,)
ax1.set_ylim(8., 9.) # outliers only
ax2.set_ylim(0.2, .7) # most of the data
ax1.spines.bottom.set_visible(False)
ax2.spines.top.set_visible(False)
ax1.xaxis.tick_top()
ax1.tick_params(labeltop=False) # don't put tick labels at the top
ax2.xaxis.tick_bottom()
d = .5 # proportion of vertical to horizontal extent of the slanted line
kwargs = dict(marker=[(-1, -d), (1, d)], markersize=12,
linestyle="none", color='k', mec='k', mew=1, clip_on=False)
ax1.plot([0, 1], [0, 0], transform=ax1.transAxes, **kwargs)
ax2.plot([0, 1], [1, 1], transform=ax2.transAxes, **kwargs)
plt.xlabel("NSFs")
plt.ylabel("time (seconds)")
ax1.set_title("Policy Provisioning Comparison")
ax1.grid()
ax2.grid()
ax1.legend()
major_ticks = np.arange(5, 21, 5)
ax1.set_xticks(major_ticks)
ax2.set_xticks(major_ticks)
plt.show()
In [9]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.032511,0.034197,0.035114,0.035177,0.033718,0.034727,0.034983,0.033581,0.034546,0.032073,0.033843,0.036634,0.033341,0.032207,0.036008,0.033504])
y2 = np.array([0.053215,0.053143,0.054095,0.050846,0.049319,0.047737,0.051687,0.050909,0.052924,0.052668,0.055164,0.052683,0.053234,0.053698,0.051859,0.055695])
y3 = np.array([0.078062,0.076026,0.075664,0.079944,0.081290,0.084642,0.084685,0.083360,0.083599,0.080270,0.082780,0.088503,0.088184,0.085245,0.087246,0.090465])
y4 = np.array([0.112080,0.110864,0.112815,0.105230,0.103596,0.108791,0.103929,0.105938,0.103964,0.112292,0.102975,0.104376,0.106588,0.103264,0.105678,0.106706])
y5 = np.array([0.137705,0.148565,0.131069,0.140008,0.132853,0.136488,0.122763,0.135194,0.133033,0.131827,0.140205,0.134917,0.136644,0.133670,0.139795,0.146581])
y6 = np.array([0.158390,0.160201,0.157799,0.148984,0.151740,0.155377,0.145958,0.144523,0.151095,0.150803,0.152027,0.155366,0.155814,0.158658,0.152921,0.160221])
# defining our error
y1_error = np.array([0.002749,0.002935,0.002860,0.003078,0.003031,0.003003,0.002960,0.002871,0.003107,0.002898,0.002919,0.003092,0.002798,0.002786,0.003119,0.002914])
y2_error = np.array([0.003610,0.004006,0.003901,0.003915,0.004058,0.003790,0.003500,0.003701,0.004077,0.004182,0.004379,0.003776,0.003522,0.003932,0.004108,0.004686])
y3_error = np.array([0.004553,0.004568,0.004410,0.004966,0.005678,0.005138,0.005149,0.005398,0.005210,0.005339,0.005459,0.005307,0.005330,0.004882,0.005243,0.005721])
y4_error = np.array([0.005951,0.006052,0.005250,0.004493,0.004694,0.005798,0.004770,0.004609,0.004998,0.005012,0.004734,0.005279,0.005228,0.004679,0.004733,0.004228])
y5_error = np.array([0.005997,0.006921,0.005861,0.007015,0.005249,0.004948,0.004992,0.006098,0.005122,0.005372,0.006488,0.004957,0.006048,0.004296,0.005444,0.006743])
y6_error = np.array([0.007503,0.006707,0.006197,0.006697,0.006119,0.006196,0.005142,0.005313,0.005915,0.005778,0.004922,0.005772,0.005588,0.006710,0.006422,0.007367])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=10, mew=2)
plt.legend()
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
plt.xlabel("NSFs")
plt.ylabel("time (seconds)")
plt.title("Policy Provisioning with Greedy Algorithm")
major_ticks = np.arange(5, 21, 5)
ax.set_xticks(major_ticks)
plt.grid()
plt.show()
In [10]:
# defining our function Linear Programming
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.054481,0.050690,0.055441,0.062192,0.056703,0.051159,0.054387,0.055841,0.060958,0.061189,0.059375,0.060433,0.064047,0.060308,0.064607,0.060278])
y2 = np.array([0.073327,0.069347,0.077672,0.077889,0.072677,0.074867,0.072963,0.073666,0.076050,0.079206,0.078547,0.080770,0.085926,0.083563,0.088021,0.077519])
y3 = np.array([0.107088,0.106380,0.107988,0.097677,0.105005,0.105199,0.099603,0.106744,0.110184,0.109660,0.115234,0.116232,0.118817,0.119779,0.118837,0.118090])
y4 = np.array([0.148736,0.136160,0.159535,0.147169,0.146164,0.145177,0.143682,0.148309,0.157338,0.150239,0.149534,0.152124,0.152133,0.158645,0.162838,0.155530])
y5 = np.array([0.182671,0.173986,0.174325,0.180240,0.181500,0.176749,0.171417,0.175506,0.185254,0.179416,0.180277,0.188768,0.186951,0.192586,0.196188,0.192686])
y6 = np.array([0.187444,0.195837,0.188540,0.187001,0.184582,0.194425,0.186941,0.197755,0.200823,0.188799,0.195128,0.215089,0.199198,0.205989,0.204315,0.210345])
# defining our error
y1_error = np.array([0.002983,0.002925,0.002802,0.016840,0.002814,0.002346,0.002814,0.002742,0.003203,0.002821,0.002844,0.002843,0.002752,0.002582,0.002702,0.002495])
y2_error = np.array([0.003804,0.003828,0.003950,0.003913,0.003995,0.002983,0.003761,0.003436,0.004034,0.004058,0.003861,0.004016,0.003706,0.004408,0.004362,0.004032])
y3_error = np.array([0.006144,0.004946,0.005387,0.004897,0.004968,0.004705,0.004713,0.004615,0.004965,0.005343,0.005264,0.006194,0.004890,0.004750,0.005250,0.005010])
y4_error = np.array([0.006685,0.005324,0.014880,0.006598,0.005203,0.006396,0.006103,0.005427,0.006087,0.005725,0.005578,0.006223,0.005756,0.006162,0.006443,0.006678])
y5_error = np.array([0.007900,0.006920,0.006423,0.007808,0.007212,0.007170,0.006701,0.006315,0.006412,0.006528,0.006872,0.006838,0.006814,0.006835,0.006707,0.007659])
y6_error = np.array([0.007784,0.012101,0.006103,0.006372,0.007374,0.007454,0.007658,0.007768,0.006925,0.007195,0.006892,0.007497,0.007186,0.006381,0.007395,0.008329])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=10, mew=2)
ax.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=10, mew=2)
plt.legend()
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
plt.xlabel("NSFs")
plt.ylabel("time (seconds)")
plt.title("Policy Provisioning with Greedy Algorithm")
major_ticks = np.arange(5, 21, 5)
ax.set_xticks(major_ticks)
plt.grid()
plt.show()
In [11]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.029955,0.032115,0.028634,0.029299,0.034870,0.035600,0.045797,0.077026,0.075213,0.151962,0.229636,0.482450,0.915189,1.918630,3.929757,8.244646])
y2 = np.array([0.040986,0.048133,0.048244,0.049408,0.047681,0.057880,0.058122,0.073187,0.094049,0.145866,0.253007,0.488547,0.972466,2.010479,4.148865,8.651941])
y3 = np.array([0.072062,0.081687,0.070603,0.078457,0.077084,0.081657,0.087393,0.113737,0.127997,0.183593,0.293211,0.540051,1.082000,2.115242,4.344464,9.092083])
y4 = np.array([0.108799,0.122529,0.115897,0.111448,0.123926,0.119351,0.132741,0.143901,0.162641,0.221364,0.388901,0.603943,1.160552,2.314177,4.725354,9.601152])
y5 = np.array([0.140620,0.134433,0.146240,0.142562,0.151831,0.140972,0.164452,0.176219,0.205933,0.266534,0.402713,0.676416,1.265690,2.482944,5.025997,10.201597])
y6 = np.array([0.146826,0.151543,0.154954,0.169447,0.159912,0.152975,0.171132,0.189592,0.221198,0.284114,0.426200,0.728413,1.348371,2.652885,5.384190,10.985307])
# defining our error
y1_error = np.array([0.002653,0.002628,0.002657,0.003019,0.002699,0.002881,0.002292,0.039349,0.002600,0.050941,0.002736,0.062675,0.003562,0.027725,0.007157,0.010546])
y2_error = np.array([0.003297,0.004017,0.003827,0.004148,0.003703,0.004166,0.003462,0.004049,0.004324,0.003608,0.003885,0.004522,0.005730,0.009446,0.020718,0.042086])
y3_error = np.array([0.005102,0.004972,0.004573,0.005105,0.005199,0.005415,0.003855,0.041042,0.004983,0.005408,0.005496,0.006492,0.071203,0.012699,0.024842,0.049801])
y4_error = np.array([0.006371,0.005690,0.006416,0.006572,0.005953,0.005851,0.005135,0.005933,0.005324,0.006162,0.060821,0.006593,0.007619,0.010486,0.018834,0.037421])
y5_error = np.array([0.007137,0.006123,0.006917,0.007002,0.006260,0.005801,0.005466,0.006934,0.005958,0.006703,0.007290,0.007780,0.009534,0.011576,0.017663,0.038021])
y6_error = np.array([0.006542,0.006667,0.006633,0.020980,0.007838,0.006575,0.006257,0.007659,0.008105,0.007631,0.007819,0.009422,0.014825,0.027684,0.053073,0.119086])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=8, mew=2)
axins = inset_axes(ax, 4,5 , loc=2,bbox_to_anchor=(0.1, 0.85),bbox_transform=ax.transAxes)
axins.plot(x, y1,label=" 2 Elements", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y2,label=" 4 Elements", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y3,label=" 6 Elements", marker ='d', color="r", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y4,label=" 8 Elements", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y5,label="10 Elements", marker ='H', color="m", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y6,label="12 Elements", marker ='s', color="k", markerfacecolor="None", markersize=8, mew=2)
axins.set_xlim(4.5,15.5)
axins.set_ylim(0,0.75)
ax.legend(loc="lower right")
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
axins.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
axins.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
axins.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
axins.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
axins.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
axins.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
ax.set_xlabel("NSFs")
ax.set_ylabel("time (seconds)")
ax.set_title("Policy Provisioning with Combination Algorithm")
plt.xticks(visible=True)
plt.yticks(visible=True)
mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
major_ticks = np.arange(5, 21, 5)
minor_ticks = np.arange(5, 16, 1)
ax.set_xticks(major_ticks)
axins.set_xticks(minor_ticks)
ax.grid()
axins.grid()
plt.show()
In [ ]:
In [12]:
../results/# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.078062,0.076026,0.075664,0.079944,0.081290,0.084642,0.084685,0.083360,0.083599,0.080270,0.082780,0.088503,0.088184,0.085245,0.087246,0.090465])
y2 = np.array([0.072062,0.072606,.070603,0.076757,0.077084,0.081657,0.087393,0.113737,0.127997,0.183593,0.293211,0.540051,1.082000,2.115242,4.344464,9.092083])
y3 = np.array([0.107088,0.106380,0.107988,0.108667,0.105005,0.105199,0.107815,0.106744,0.110184,0.109660,0.115234,0.116232,0.118817,0.119779,0.118837,0.118090])
# defining our error
y1_error = np.array([0.004553,0.004568,0.004410,0.004966,0.005678,0.005138,0.005149,0.005398,0.005210,0.005339,0.005459,0.005307,0.005330,0.004882,0.005243,0.005721])
y2_error = np.array([0.005102,0.004338,0.004573,0.005105,0.005199,0.005415,0.003855,0.004506,0.004983,0.005408,0.005496,0.006492,0.071203,0.012699,0.024842,0.049801])
y3_error = np.array([0.006144,0.005026,0.005387,0.004856,0.004968,0.004705,0.004777,0.004615,0.004965,0.005343,0.005264,0.006194,0.004890,0.004750,0.005250,0.005010])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y2,label=" EXHAUSTIVE SEARCH", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y1,label=" SET-COVER", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="r", markerfacecolor="None", markersize=8, mew=2)
axins = inset_axes(ax, 3,3 , loc=2,bbox_to_anchor=(0.1, 0.80),bbox_transform=ax.transAxes)
axins.plot(x, y2,label=" EXHAUSTIVE SEARCH", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y1,label=" SET-COVER", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="r", markerfacecolor="None", markersize=8, mew=2)
axins.set_xlim(4.5,14.5)
axins.set_ylim(0.05,0.2)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
axins.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
axins.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
axins.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("NSFs",fontsize=18, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=18, **csfont)
ax.set_title("Policy Provisioning",fontsize=18, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
major_ticks = np.arange(5, 21, 1)
minor_ticks = np.arange(5, 15, 1)
ax.set_xticks(major_ticks)
axins.set_xticks(minor_ticks)
ax.grid()
axins.grid()
plt.savefig('../results/provisioning.eps', format='eps')
Cell In[12], line 1 ../results/# defining our function ^ SyntaxError: invalid syntax
In [13]:
# defining our function
x = np.array([2,4,6,8,10,12])
y1 = np.array([0.03251065,0.05321495,0.07806239,0.11208005,0.13770502,0.1583895])
y2 = np.array([0.02995522,0.04098608,0.07206247,0.10879873,0.13698826,0.146826])
y3 = np.array([0.05448068,0.07332656,0.10708772,0.14873565,0.18267075,0.18744447
])
# defining our error
y1_error = np.array([0.002749481,0.003610007,0.004553322,0.005951441,0.005997416,0.007503124])
y2_error = np.array([0.002653054,0.003297046,0.005101929,0.006371099,0.007198553,0.006542342])
y3_error = np.array([0.002983047,0.003803566,0.006143670,0.006685075,0.007900119,0.007784061])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y2,label=" COMBINATION", marker ='o', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y1,label=" SET-COVER", marker ='^', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="r", markerfacecolor="None", markersize=8, mew=2)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
ax.errorbar(x, y1, yerr = y1_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="r", capsize=2, capthick=1,)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Elements",fontsize=18, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=18, **csfont)
ax.set_title("Policy Provisioning",fontsize=18, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
major_ticks = np.arange(2, 13, 2)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
ax.grid()
plt.savefig('../results/provisioning-5NSF.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[13], line 49 44 plt.yticks(visible=True) 47 major_ticks = np.arange(2, 13, 2) ---> 49 ax.set_xticks(major_ticks,fontname = "Times New Roman") 52 ax.grid() 55 plt.savefig('../results/provisioning-5NSF.eps', format='eps') File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [14]:
# defining our function
x = np.array([2,4,6,8,10,12])
y1 = np.array([0.03251065,0.05321495,0.07806239,0.11208005,0.13770502,0.15838950])
y2 = np.array([0.03472712,0.04773735,0.08464156,0.10879137,0.13648795,0.15537736])
y3 = np.array([0.03384324,0.05516434,0.08278038,0.10297537,0.14020477,0.15202708])
y4 = np.array([0.03350434,0.05569461,0.09046494,0.10670598,0.14658117,0.16022065])
# defining our error
y1_error = np.array([0.002749481,0.003610007,0.004553322,0.005951441,0.005997416,0.007503124])
y2_error = np.array([0.003003195,0.003789892,0.005137836,0.005797866,0.004947529,0.006196099])
y3_error = np.array([0.002918585,0.004379118,0.005458649,0.0047338,0.006488112,0.004921529])
y4_error = np.array([0.002913892,0.004686111,0.00572118,0.004227706,0.006742945,0.007367280])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 5", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 10", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 15", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 20", marker ='v', color="k", markerfacecolor="None", markersize=8, mew=2)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="k", capsize=2, capthick=1,)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Elements",fontsize=18, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=18, **csfont)
ax.set_title("Policy Provisioning with Greedy",fontsize=18, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
major_ticks = np.arange(2, 13, 2)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
ax.grid()
plt.savefig('../results/provisioning-Greedy.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[14], line 53 48 plt.yticks(visible=True) 51 major_ticks = np.arange(2, 13, 2) ---> 53 ax.set_xticks(major_ticks,fontname = "Times New Roman") 56 ax.grid() 59 plt.savefig('../results/provisioning-Greedy.eps', format='eps') File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [15]:
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True, figsize=(10,10),height_ratios=[1, 3])
fig.subplots_adjust(hspace=0.05) # adjust space between axes
# defining our function
x = np.array([2,4,6,8,10,12])
y1 = np.array([0.02995522,0.04098608,0.07206247,0.10879873,0.13698826,0.146826])
y2 = np.array([0.03560032,0.05787994,0.08512951,0.11935132,0.14097195,0.15297493])
y3 = np.array([0.2296363,0.25300712,0.29321136,0.3889013,0.40271314,0.42620046])
y4 = np.array([8.24464568,8.65194107,9.09208281,9.60115246,10.20159737,10.98530697])
# defining our error
y1_error = np.array([0.002749481,0.003610007,0.004553322,0.005951441,0.005997416,0.007503124])
y2_error = np.array([0.003003195,0.003789892,0.005137836,0.005797866,0.004947529,0.006196099])
y3_error = np.array([0.002918585,0.004379118,0.005458649,0.004733800,0.006488112,0.004921529])
y4_error = np.array([0.002913892,0.004686111,0.005721180,0.004227706,0.006742945,0.007367280])
# plotting our function and
ax1.plot(x, y1,label="5", marker ='o', color="r", markerfacecolor="None", markersize=12, mew=2)
ax2.plot(x, y1,label="5", marker ='o', color="r", markerfacecolor="None", markersize=12, mew=2)
ax1.plot(x, y2,label="10", marker ='^', color="g", markerfacecolor="None", markersize=12, mew=2)
ax2.plot(x, y2,label="10", marker ='^', color="g", markerfacecolor="None", markersize=12, mew=2)
ax1.plot(x, y3,label="15", marker ='s', color="b", markerfacecolor="None", markersize=12, mew=2)
ax2.plot(x, y3,label="15", marker ='s', color="b", markerfacecolor="None", markersize=12, mew=2)
ax1.plot(x, y4,label="20", marker ='v', color="k", markerfacecolor="None", markersize=12, mew=2)
ax2.plot(x, y4,label="20", marker ='v', color="k", markerfacecolor="None", markersize=12, mew=2)
# error bar
ax1.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax2.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax1.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax2.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax1.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax2.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax1.errorbar(x, y4, yerr = y4_error, color="k", capsize=2, capthick=1,)
ax2.errorbar(x, y4, yerr = y4_error, color="k", capsize=2, capthick=1,)
ax1.set_ylim(8., 12) # outliers only
ax2.set_ylim(0.02, .45) # most of the data
ax1.spines.bottom.set_visible(False)
ax2.spines.top.set_visible(False)
ax1.xaxis.tick_top()
ax1.tick_params(labeltop=False) # don't put tick labels at the top
ax2.xaxis.tick_bottom()
d = .5 # proportion of vertical to horizontal extent of the slanted line
kwargs = dict(marker=[(-1, -d), (1, d)], markersize=12,
linestyle="none", color='k', mec='k', mew=1, clip_on=False)
ax1.plot([0, 1], [0, 0], transform=ax1.transAxes, **kwargs)
ax2.plot([0, 1], [1, 1], transform=ax2.transAxes, **kwargs)
csfont = {'fontname':'Times New Roman'}
plt.xlabel("Elements",fontsize=18, **csfont)
plt.ylabel("Time (seconds)",fontsize=18, **csfont)
ax1.set_title("Policy Provisioning with Combination",fontsize=18, **csfont)
ax1.grid()
ax2.grid()
ax1.legend()
major_ticks = np.arange(2, 13, 2)
ax1.set_xticks(major_ticks)
ax2.set_xticks(major_ticks)
plt.show()
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [16]:
# defining our function
x = np.array([2,4,6,8,10,12])
y1 = np.array([0.05448068,0.07332656,0.10708772,0.14873565,0.18267075,0.18744447])
y2 = np.array([0.05115940,0.07486675,0.10519853,0.14517673,0.17674904,0.19442491])
y3 = np.array([0.05937503,0.07854658,0.11523374,0.14953356,0.18027724,0.19512764])
y4 = np.array([0.06027760,0.07751880,0.11808975,0.15552973,0.19268580,0.21034504])
# defining our error
y1_error = np.array([0.002983047,0.003803566,0.006143670,0.006685075,0.007900119,0.007784061])
y2_error = np.array([0.002345555,0.002982850,0.004704726,0.006395561,0.007170030,0.007454089])
y3_error = np.array([0.002844089,0.003861210,0.005263536,0.005578409,0.006872044,0.006892366])
y4_error = np.array([0.002495155,0.004032473,0.005010033,0.006677857,0.007659406,0.008329051])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 5", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 10", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 15", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 20", marker ='v', color="k", markerfacecolor="None", markersize=8, mew=2)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="k", capsize=2, capthick=1,)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Elements",fontsize=18, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=18, **csfont)
ax.set_title("Policy Provisioning with Linear Programming",fontsize=18, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
major_ticks = np.arange(2, 13, 2)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
ax.grid()
plt.savefig('../results/provisioning-LP.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[16], line 53 48 plt.yticks(visible=True) 51 major_ticks = np.arange(2, 13, 2) ---> 53 ax.set_xticks(major_ticks,fontname = "Times New Roman") 56 ax.grid() 59 plt.savefig('../results/provisioning-LP.eps', format='eps') File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [17]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.04106113,0.05232061,0.05367787,0.05397350,0.05662672,0.05583195,0.05655156,0.05696937,0.06003512,0.05860986,0.05999851,0.05878935,0.06007643,0.06010166,0.06057489,0.06083752])
y2 = np.array([0.06026320,0.06463592,0.06925883,0.06900586,0.06885652,0.07048275,0.07267510,0.07093372,0.07275897,0.07513442,0.07392940,0.07281201,0.07489511,0.07792582,0.07641573,0.07734811])
y3 = np.array([0.07914927,0.08379999,0.08245698,0.08799441,0.09027753,0.08977469,0.09191261,0.09307596,0.09676648,0.09536056,0.09402096,0.09696631,0.09677982,0.10274728,0.10231514,0.10317451])
y4 = np.array([0.10212738,0.10446370,0.10527714,0.11091555,0.10953609,0.10940968,0.11479294,0.11683013,0.11948543,0.11907625,0.11583337,0.12044097,0.12483526,0.12245083,0.12277447,0.12796579])
y5 = np.array([0.12524724,0.12536717,0.12568352,0.12869853,0.13136455,0.13196480,0.13515529,0.13389161,0.14130161,0.14254137,0.14218486,0.14158025,0.14540260,0.14710743,0.14837831,0.15142105])
y6 = np.array([0.13630093,0.13454609,0.13501588,0.13760697,0.14012251,0.14598704,0.14735643,0.14546434,0.14872968,0.14788392,0.15183431,0.15115497,0.14896576,0.15623427,0.15463637,0.16053437])
# defining our error
y1_error = np.array([0.000558195,0.000622948,0.001311659,0.001248231,0.001517201,0.000997926,0.000440913,0.000684795,0.001697950,0.000566854,0.001338762,0.000535261,0.001317410,0.000482302,0.000511669,0.001080622])
y2_error = np.array([0.002698861,0.000897246,0.002556974,0.001196460,0.001354585,0.001842738,0.002257076,0.001694276,0.000917403,0.002036767,0.001698571,0.000877471,0.001410146,0.001638023,0.001035438,0.001665924])
y3_error = np.array([0.001897988,0.001481013,0.000935654,0.001163309,0.003012482,0.002643828,0.003102948,0.001679025,0.002971114,0.002619440,0.002533085,0.002503358,0.001352574,0.002216819,0.002178457,0.002818324])
y4_error = np.array([0.001399820,0.003364113,0.002076250,0.002257801,0.001525038,0.002096056,0.001474234,0.003139760,0.001945128,0.001810540,0.001517260,0.002184306,0.004157159,0.002282537,0.002261094,0.002155364])
y5_error = np.array([0.002672637,0.001654850,0.001600805,0.002050489,0.001558993,0.002675644,0.002326513,0.001749733,0.003790725,0.003216470,0.003005360,0.001772449,0.002714593,0.002523727,0.003063784,0.002898576])
y6_error = np.array([0.003032270,0.003251695,0.002950939,0.002734089,0.002033111,0.003437213,0.003224125,0.003209420,0.002827468,0.002622438,0.003629636,0.003189913,0.001814759,0.002793945,0.002046139,0.002688466])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 4", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 6", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 8", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y5,label=" 10", marker ='D', color="m", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y6,label=" 12", marker ='*', color="k", markerfacecolor="None", markersize=12, mew=2)
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("NSF",fontsize=18, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=18, **csfont)
ax.set_title("Policy Provisioning with Linear Programming",fontsize=18, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
major_ticks = np.arange(5, 21, 1)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
ax.grid()
plt.savefig('../results/provisioning-LP-NSF.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[17], line 61 56 plt.yticks(visible=True) 59 major_ticks = np.arange(5, 21, 1) ---> 61 ax.set_xticks(major_ticks,fontname = "Times New Roman") 64 ax.grid() 67 plt.savefig('../results/provisioning-LP-NSF.eps', format='eps') File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [18]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.01748822,0.01706467,0.01768797,0.01894280,0.02121278,0.02428759,0.03064793,0.04072938,0.05271577,0.07232841,0.11913613,0.20070077,0.33023476,0.72386629,1.51413406,3.21493902])
y2 = np.array([0.02884496,0.02742703,0.02810419,0.02983371,0.03316806,0.03570738,0.04375051,0.05411138,0.06758392,0.08875583,0.13288854,0.24169453,0.39551777,0.84906169,1.73206662,3.66326275])
y3 = np.array([0.04826057,0.04449080,0.04457962,0.04728111,0.05077020,0.05644564,0.06333827,0.07422719,0.08938448,0.11452397,0.16634460,0.27549877,0.46872213,0.97197122,1.97344956,4.12579496])
y4 = np.array([0.06781450,0.06352017,0.06499298,0.06792582,0.07317694,0.07891524,0.08878325,0.10923064,0.11830587,0.15001454,0.21061901,0.35106692,0.58805630,1.20021928,2.39985370,4.84516871])
y5 = np.array([0.08359368,0.08146577,0.08338998,0.08801338,0.09281381,0.09968459,0.10924344,0.12980982,0.14291779,0.17835925,0.25550622,0.42871428,0.71182667,1.41389343,2.85643241,5.71202992])
y6 = np.array([0.09488602,0.08763078,0.09151907,0.09672590,0.10066280,0.10918354,0.12067820,0.13455898,0.15450089,0.20054505,0.29061319,0.45966688,0.83750310,1.64089691,3.27769389,6.67820130])
# defining our error
y1_error = np.array([0.00023373,0.00016411,0.00017730,0.00035929,0.00030747,0.00023073,0.00076865,0.00117666,0.00076611,0.00156544,0.00301081,0.00301072,0.00162013,0.00378937,0.00798292,0.01513149])
y2_error = np.array([0.00113971,0.00109262,0.00066021,0.00112551,0.00120925,0.00073496,0.00147031,0.00178710,0.00150711,0.00198936,0.00225695,0.00345648,0.00467513,0.01065685,0.01538491,0.03735493])
y3_error = np.array([0.00188549,0.00141978,0.00087581,0.00139628,0.00124449,0.00143038,0.00167537,0.00124391,0.00144291,0.00207881,0.00254182,0.00468361,0.00589551,0.01328868,0.02640792,0.04928107])
y4_error = np.array([0.00144909,0.00082152,0.00084811,0.00085199,0.00121790,0.00102643,0.00127757,0.00683652,0.00147573,0.00302855,0.00287128,0.00438540,0.00612622,0.01172197,0.02279214,0.04527080])
y5_error = np.array([0.00116329,0.00095366,0.00096056,0.00111291,0.00142197,0.00122751,0.00111321,0.00180502,0.00157473,0.00207620,0.00316808,0.00414535,0.00864904,0.01399402,0.02901688,0.04901766])
y6_error = np.array([0.00221309,0.00085072,0.00117982,0.00184920,0.00092258,0.00144485,0.00205552,0.00164693,0.00181608,0.00322914,0.00459572,0.00753768,0.01478101,0.03081701,0.06306016,0.14271066])
# plotting our function and
plt.figure(figsize=(10,10))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 4", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 6", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 8", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y5,label=" 10", marker ='D', color="m", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y6,label=" 12", marker ='*', color="k", markerfacecolor="None", markersize=12, mew=2)
axins = inset_axes(ax, 4,5 , loc=2,bbox_to_anchor=(0.1, 0.8),bbox_transform=ax.transAxes)
axins.plot(x, y1, marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y2, marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y3, marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y4, marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y5, marker ='D', color="m", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y6, marker ='*', color="k", markerfacecolor="None", markersize=8, mew=2)
axins.set_xlim(4.5,15.5)
axins.set_ylim(0,0.3)
ax.legend(loc="upper left")
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
axins.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
axins.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
axins.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
axins.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
axins.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
axins.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
ax.set_xlabel("NSFs")
ax.set_ylabel("time (seconds)")
ax.set_title("Policy Provisioning with Combination Algorithm")
plt.xticks(visible=True)
plt.yticks(visible=True)
mark_inset(ax, axins, loc1=2, loc2=1, fc="none", ec="0.5")
major_ticks = np.arange(5, 21, 5)
minor_ticks = np.arange(5, 16, 1)
ax.set_xticks(major_ticks)
axins.set_xticks(minor_ticks)
ax.grid()
axins.grid()
plt.show()
In [19]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.01879920,0.01772261,0.01730038,0.01812140,0.01825594,0.01959087,0.02141636,0.02100183,0.02268091,0.02300167,0.02285393,0.02095458,0.02233246,0.02321678,0.02276909,0.02353970])
y2 = np.array([0.02821559,0.02840337,0.02882647,0.02866773,0.03147165,0.03091622,0.03219053,0.03373127,0.03407055,0.03404571,0.03562558,0.03339537,0.03575304,0.03777751,0.03637419,0.03698238])
y3 = np.array([0.04524703,0.04460474,0.04640657,0.04873397,0.05070803,0.04904176,0.05099242,0.05744146,0.05714572,0.05519595,0.05553183,0.05571627,0.05800372,0.05977062,0.06297912,0.05990727])
y4 = np.array([0.06569905,0.06458258,0.06583387,0.06792024,0.07253626,0.07823532,0.07835333,0.07732598,0.08202561,0.08165804,0.08370691,0.07782659,0.08458690,0.08740120,0.08768974,0.09200355])
y5 = np.array([0.08371698,0.08479079,0.08499689,0.08774126,0.09123692,0.09711685,0.09981990,0.09704677,0.10213561,0.10286324,0.10092269,0.09877769,0.10497986,0.10334835,0.10878697,0.11040942])
y6 = np.array([0.09087758,0.09068516,0.09186096,0.09623941,0.10141336,0.10594291,0.10548317,0.10855453,0.10767064,0.11253440,0.10924945,0.10643224,0.11467371,0.11482587,0.11913428,0.11880270])
# defining our error
y1_error = np.array([0.00131541,0.00035359,0.00021648,0.00033929,0.00021235,0.00086525,0.00090260,0.00071889,0.00164057,0.00147745,0.00187383,0.00058900,0.00062400,0.00104777,0.00100643,0.00125607])
y2_error = np.array([0.00124475,0.00121307,0.00105928,0.00069707,0.00152796,0.00119607,0.00149649,0.00135219,0.00138659,0.00123806,0.00221079,0.00082153,0.00125270,0.00208414,0.00141617,0.00150229])
y3_error = np.array([0.00124841,0.00087612,0.00130960,0.00244472,0.00159190,0.00106812,0.00129636,0.00288022,0.00211316,0.00177182,0.00160463,0.00163024,0.00208435,0.00292721,0.00279723,0.00159782])
y4_error = np.array([0.00103300,0.00113150,0.00093411,0.00107415,0.00134482,0.00181381,0.00226863,0.00220293,0.00265702,0.00247144,0.00269793,0.00145481,0.00243415,0.00296020,0.00251612,0.00735101])
y5_error = np.array([0.00159263,0.00210221,0.00120071,0.00148257,0.00182248,0.00190446,0.00645202,0.00212299,0.00258498,0.00299191,0.00214991,0.00138833,0.00560450,0.00227477,0.00234790,0.00370723])
y6_error = np.array([0.00111460,0.00143188,0.00142334,0.00197943,0.00279157,0.00236764,0.00372276,0.00417599,0.00265042,0.00434128,0.00201463,0.00157680,0.00331048,0.00254685,0.00284326,0.00194852])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" 2", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" 4", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" 6", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y4,label=" 8", marker ='v', color="c", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y5,label=" 10", marker ='D', color="m", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y6,label=" 12", marker ='*', color="k", markerfacecolor="None", markersize=12, mew=2)
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
ax.errorbar(x, y4, yerr = y4_error, color="c", capsize=2, capthick=1,)
ax.errorbar(x, y5, yerr = y5_error, color="m", capsize=2, capthick=1,)
ax.errorbar(x, y6, yerr = y6_error, color="k", capsize=2, capthick=1,)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("NSF",fontsize=18, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=18, **csfont)
ax.set_title("Policy Provisioning with Linear Programming",fontsize=18, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
major_ticks = np.arange(5, 21, 1)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
ax.grid()
plt.savefig('../results/provisioning-LP-NSF.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[19], line 62 57 plt.yticks(visible=True) 60 major_ticks = np.arange(5, 21, 1) ---> 62 ax.set_xticks(major_ticks,fontname = "Times New Roman") 65 ax.grid() 68 plt.savefig('../results/provisioning-LP-NSF.eps', format='eps') File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [20]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([0.02884496,0.02742703,0.02810419,0.02983371,0.03316806,0.03570738,0.04375051,0.05411138,0.06758392,0.08875583,0.13288854,0.24169453,0.39551777,0.84906169,1.73206662,3.66326275])
y2 = np.array([0.02821559,0.02840337,0.02882647,0.02866773,0.03147165,0.03091622,0.03219053,0.03373127,0.03407055,0.03404571,0.03562558,0.03339537,0.03575304,0.03777751,0.03637419,0.03698238])
y3 = np.array([0.06026320,0.06463592,0.06925883,0.06900586,0.06885652,0.07048275,0.07267510,0.07093372,0.07275897,0.07513442,0.07392940,0.07281201,0.07489511,0.07792582,0.07641573,0.07734811])
# defining our error
y1_error = np.array([0.00113971,0.00109262,0.00066021,0.00112551,0.00120925,0.00073496,0.00147031,0.00178710,0.00150711,0.00198936,0.00225695,0.00345648,0.00467513,0.01065685,0.01538491,0.03735493])
y2_error = np.array([0.002698861,0.000897246,0.002556974,0.001196460,0.001354585,0.001842738,0.002257076,0.001694276,0.000917403,0.002036767,0.001698571,0.000877471,0.001410146,0.001638023,0.001035438,0.001665924])
y3_error = np.array([0.00124475,0.00121307,0.00105928,0.00069707,0.00152796,0.00119607,0.00149649,0.00135219,0.00138659,0.00123806,0.00221079,0.00082153,0.00125270,0.00208414,0.00141617,0.00150229])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" EXHAUSTIVE SEARCH", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" SET-COVER", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
axins = inset_axes(ax, 3,3 , loc=2,bbox_to_anchor=(0.1, 0.80),bbox_transform=ax.transAxes)
axins.plot(x, y1,label=" EXHAUSTIVE SEARCH", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y2,label=" SET-COVER", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
axins.set_xlim(4.5,15.5)
axins.set_ylim(0.02,0.15)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
axins.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
axins.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
axins.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of NSFs",fontsize=20, **csfont)
ax.set_ylabel("Time (seconds)",fontsize=20, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
major_ticks = np.arange(5, 21, 1)
minor_ticks = np.arange(5, 16, 1)
ax.set_xticks(major_ticks)
axins.set_xticks(minor_ticks)
ax.grid()
axins.grid()
plt.savefig('../results/provisioning.eps', format='eps')
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [21]:
# defining our function
x = np.array([i for i in range(5,21)])
y1 = np.array([100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000])
y2 = np.array([94.775132275,94.775132275,96.759259259,96.759259259,96.563390313,92.103193155,85.994954023,85.739335161,84.200327573,86.074801479,86.722949627,86.722949627,86.027762461,88.849657287,88.927519240,84.691199273])
y3 = np.array([100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000,100.000000000])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" COMBINATION", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" GREEDY", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="b",linestyle = (0,(0.1,2)), dash_capstyle = 'round',linewidth = 4, markerfacecolor="None", markersize=8, mew=2)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="center",prop=font)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of NSFs",fontsize=20, **csfont)
ax.set_ylabel("Optimality (%)",fontsize=20, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
major_ticks = np.arange(5, 21, 1)
y_ticks = np.arange(0,101,10)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
ax.set_yticks(y_ticks,fontname = "Times New Roman")
ax.grid()
plt.savefig('../results/provisioning-optimal.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[21], line 41 37 major_ticks = np.arange(5, 21, 1) 38 y_ticks = np.arange(0,101,10) ---> 41 ax.set_xticks(major_ticks,fontname = "Times New Roman") 42 ax.set_yticks(y_ticks,fontname = "Times New Roman") 45 ax.grid() File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [22]:
# defining our function
x = np.array([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])
y1 = np.array([159.97645508,170.29222656,175.70827148,193.30936523,214.00797852,246.58135742,287.28441406,385.15074219,635.50411133,1112.98717773,1577.06225586,2044.02054688,2652.12141602,3042.43119141,3448.40309570,3887.13243164])
y2 = np.array([173.62732422,176.72299805,187.96225586,193.06586914,209.81939453,220.21913086,230.03536133,235.34520508,239.44790039,242.91797852,249.31519531,257.01619141,263.66392578,279.27941406,286.85210938,286.81621094])
y3 = np.array([176.63676758,185.91016602,195.22315430,205.29654297,215.80696289,225.34723633,232.46809570,239.64948242,250.47525391,257.57812500,262.83149414,270.25841797,262.81876953,285.65182617,291.78979492,302.35929688])
# defining our error
y1_error = np.array([0.00462621,0.00190587,0.00162064,0.00389760,0.00114819,0.00463724,0.00200282,0.00175681,0.00320782,0.00157637,0.00439856,0.00226346,0.02876437,0.00232966,0.01225066,0.00219028])
y2_error = np.array([0.00462621,0.00190587,0.00162064,0.00389760,0.00114819,0.00463724,0.00200282,0.00175681,0.00320782,0.00157637,0.00439856,0.00226346,0.02876437,0.00232966,0.01225066,0.00219028])
y3_error = np.array([0.00462621,0.00190587,0.00162064,0.00389760,0.00114819,0.00463724,0.00200282,0.00175681,0.00320782,0.00157637,0.00439856,0.00226346,0.02876437,0.00232966,0.01225066,0.00219028])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.plot(x, y1,label=" COMBINATION", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y2,label=" GREEDY", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
ax.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
axins = inset_axes(ax, 2.5,2.5 , loc=2,bbox_to_anchor=(0.1, 0.80),bbox_transform=ax.transAxes)
axins.plot(x, y1,label=" COMBINATION", marker ='o', color="r", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y2,label=" GREEDY", marker ='^', color="g", markerfacecolor="None", markersize=8, mew=2)
axins.plot(x, y3,label=" LINEAR PROGRAMMING", marker ='s', color="b", markerfacecolor="None", markersize=8, mew=2)
axins.set_xlim(4.5,12.5)
axins.set_ylim(155,280)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
ax.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
ax.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
axins.errorbar(x, y1, yerr = y1_error, color="r", capsize=2, capthick=1,)
axins.errorbar(x, y2, yerr = y2_error, color="g", capsize=2, capthick=1,)
axins.errorbar(x, y3, yerr = y3_error, color="b", capsize=2, capthick=1,)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of NSFs",fontsize=20, **csfont)
ax.set_ylabel("Memory (KiB)",fontsize=20, **csfont)
plt.xticks(visible=True)
plt.yticks(visible=True)
mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
major_ticks = np.arange(5, 21, 1)
minor_ticks = np.arange(5, 13, 1)
ax.set_xticks(major_ticks,fontname = "Times New Roman")
axins.set_xticks(minor_ticks,fontname = "Times New Roman")
ax.grid()
axins.grid()
plt.savefig('../results/provisioning-memory.eps', format='eps')
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[22], line 61 58 major_ticks = np.arange(5, 21, 1) 59 minor_ticks = np.arange(5, 13, 1) ---> 61 ax.set_xticks(major_ticks,fontname = "Times New Roman") 62 axins.set_xticks(minor_ticks,fontname = "Times New Roman") 64 ax.grid() File /opt/conda/lib/python3.10/site-packages/matplotlib/axes/_base.py:73, in _axis_method_wrapper.__set_name__.<locals>.wrapper(self, *args, **kwargs) 72 def wrapper(self, *args, **kwargs): ---> 73 return get_method(self)(*args, **kwargs) File /opt/conda/lib/python3.10/site-packages/matplotlib/axis.py:2134, in Axis.set_ticks(self, ticks, labels, minor, **kwargs) 2132 if labels is None and kwargs: 2133 first_key = next(iter(kwargs)) -> 2134 raise ValueError( 2135 f"Incorrect use of keyword argument {first_key!r}. Keyword arguments " 2136 "other than 'minor' modify the text labels and can only be used if " 2137 "'labels' are passed as well.") 2138 result = self._set_tick_locations(ticks, minor=minor) 2139 if labels is not None: ValueError: Incorrect use of keyword argument 'fontname'. Keyword arguments other than 'minor' modify the text labels and can only be used if 'labels' are passed as well.
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [23]:
# defining our function
x = np.array([4,6,8,10,12,14])
y1 = np.array([0.00020149,0.00021480,0.00025953,0.00031508,0.00038464,0.00043863]) * 1000
y2 = np.array([0.00015232,0.00016220,0.00019786,0.00022296,0.00028351,0.00030767]) * 1000
# defining our error
y1_error = np.array([0.00001153,0.00000953,0.00000981,0.00001135,0.00001189,0.00001322]) * 1000
y2_error = np.array([0.00000716,0.00000508,0.00000782,0.00001007,0.00001525,0.00001428]) * 1000
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
ax.grid(zorder=0,axis='y',color="black", linestyle = (0,(0.1,2)), dash_capstyle = 'projecting')
# error bar
ax.bar(x, y1, yerr=y1_error, label="Extraction with DFA-based YANG data model verification" , color="#7f7fff", align='center', ecolor='black', capsize=5,zorder=3)
ax.bar(x, y2, yerr=y2_error, label="Extraction without YANG data model verification", color="#7fbf7f", align='center', ecolor='black', capsize=5,zorder=3)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
#plt.ticklabel_format(useMathText=True,axis='y', style='sci', scilimits=(0,1))
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of Elements",fontsize=20, **csfont)
ax.set_ylabel("Time (milliseconds)",fontsize=20, **csfont)
y_ticks = np.arange(0, 0.5, 0.05)
plt.xticks(visible=True)
plt.yticks(y_ticks,visible=True)
plt.ylim(0.0,0.46)
plt.savefig('../results/extractor-v2.eps', format='eps')
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [24]:
# defining our function
x = np.array([a for a in range(41,51)])
y1 = np.array([1,
0.986975399,
0.974601401,
0.961480008,
0.950377148,
0.937262379,
0.923632924,
0.912947245,
0.902698418,
0.892857143
])
y2 = np.array([0.925373134,
0.914399586,
0.904004267,
0.892961714,
0.883647397,
0.876064392,
0.867755313,
0.859495929,
0.851607877,
0.845238095
])
y1_error = np.array([0,
0.004281778,
0.006789192,
0.007949848,
0.009302401,
0.008693803,
0.007048322,
0.005591736,
0.003395325,
0.003395325
])
y2_error = np.array([0,
0.002338553,
0.003141094,
0.00339428,
0.002760979,
0.002246777,
0.002830657,
0.002815485,
0.00209472,
0.00209472
])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.grid(zorder=0,axis='both',color="black", linestyle = (0,(0.5,2)))
ax.plot(x, y1, label="Label-based", marker ='o',color="#4ca5ff",zorder=3)
ax.plot(x, y2, label="Semantic-based", marker ='^',color="#ff4d4c",zorder=3)
ax.errorbar(x, y1, yerr = y1_error, color="#4ca5ff", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="#ff4d4c", capsize=2, capthick=1,)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="lower left",prop=font)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of Elements",fontsize=20, **csfont)
ax.set_ylabel("Accuracy",fontsize=20, **csfont)
x_ticks = np.arange(41, 51, 1)
y_ticks = np.arange(0.6,1.1, 0.1)
plt.xticks(x_ticks,visible=True)
plt.yticks(y_ticks,visible=True)
plt.ylim(0.8,1.01)
plt.savefig('../results/mapper-v2.eps', format='eps')
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [25]:
# defining our function
x = np.array([a for a in range(41,51)])
y1 = np.array([3.910362983,
4.826951623,
5.729691529,
6.64875474,
7.662363029,
8.408527803,
9.397049761,
11.25717583,
12.03709865,
13.07107432
])
y2 = np.array([31.824031,
43.57801902,
55.63877158,
68.18024266,
80.44786737,
92.67567444,
105.9118191,
132.2637429,
143.2289096,
156.0652623
])
y1_error = np.array([0.065873203,
0.031205339,
0.091085096,
0.13129789,
0.219426439,
0.119096686,
0.130001355,
0.110648817,
0.176074341,
0.150415171
])
y2_error = np.array([6.333240147,
1.86871551,
2.503610008,
2.716302008,
3.124187132,
2.961852965,
3.858790084,
4.499441478,
4.811335846,
4.369233276])
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.grid(zorder=0,axis='both',color="black", linestyle = (0,(0.5,2)))
ax.plot(x, y1, label="Label-based", marker ='o',color="#4ca5ff",zorder=3)
ax.plot(x, y2, label="Semantic-based", marker ='^',color="#ff4d4c",zorder=3)
ax.errorbar(x, y1, yerr = y1_error, color="#4ca5ff", capsize=2, capthick=1,)
ax.errorbar(x, y2, yerr = y2_error, color="#ff4d4c", capsize=2, capthick=1,)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of Elements",fontsize=20, **csfont)
ax.set_ylabel("Execution Time",fontsize=20, **csfont)
x_ticks = np.arange(41, 51, 1)
y_ticks = np.arange(0,180, 20)
plt.xticks(x_ticks,visible=True)
plt.yticks(y_ticks,visible=True)
plt.savefig('../results/mapper-time-v2.eps', format='eps')
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.
In [26]:
# defining our function
x = np.array([4,5,6,7,8,9,10,11,12,13,14])
y1 = np.array([0.00072714,0.00079292,0.00082097,0.00083589,0.00084099,0.00090492,0.00092427,0.00100097,0.00101886,0.00100972,0.00104852]) * 1000
y2 = np.array([0.00053829,0.00062002,0.00064371,0.00067920,0.00073272,0.00071281,0.00072842,0.00074143,0.00076172,0.00074148,0.00076645]) * 1000
# defining our error
y1_error = np.array([0.00001540,0.00001838,0.00001052,0.00001309,0.00001725,0.00002026,0.00001481,0.00001778,0.00002540,0.00002737,0.00002332]) * 1000
y2_error = np.array([0.00001654,0.00001529,0.00002063,0.00001476,0.00001889,0.00001335,0.00002503,0.00003939,0.00002683,0.00002677,0.00002216]) * 1000
width = 0.3
# plotting our function and
plt.figure(figsize=(8,6))
ax = plt.axes()
# error bar
ax.grid(zorder=0,axis='y',color="black", linestyle = (0,(0.1,2)), dash_capstyle = 'projecting')
ax.bar(x, y1,width, yerr=y1_error, label="Policy Generator in XML format", color="#7f7fff", ecolor='black', capsize=3,zorder=3)
ax.bar(x+width, y2, width,yerr=y2_error, label="Policy Generator in JSON format", color="#7fbf7f", ecolor='black', capsize=3,zorder=3)
font = font_manager.FontProperties(family='Times New Roman', weight='roman',
style='normal', size=13)
ax.legend(loc="upper left",prop=font)
plt.ticklabel_format(useMathText=True,axis='y', style='sci', scilimits=(0,4))
csfont = {'fontname':'Times New Roman'}
#hfont = {'fontname':'Helvetica'}
ax.set_xlabel("Number of Elements",fontsize=20, **csfont)
ax.set_ylabel("Time (milliseconds)",fontsize=20, **csfont)
x_ticks = np.arange(4, 15, 1)
y_ticks = np.arange(0, 1.2, 0.1)
plt.xticks(x+width/2,(4,5,6,7,8,9,10,11,12,13,14))
plt.yticks(y_ticks,visible=True)
plt.savefig('../results/perf-generator-v2.eps', format='eps')
findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found. findfont: Font family 'Times New Roman' not found.