import matplotlib.pyplot as plt
def plot_graph():
- plt.rcParams["font.size"] = 24
- #plt.rcParams["font.family"] = "TeX Gyre Pagella"
+ plt.rcParams["font.size"] = 22
+ plt.rcParams["font.family"] = "sans-serif"
+ plt.rcParams["figure.figsize"] = [6, 4]
f, ax = plt.subplots()
ax.set_title(TITLE)
#ax.grid(which="minor", linestyle=":", linewidth="0.1", color="gray")
if YLOG:
ax.set_yscale("log")
+ if YLIM:
+ ax.set_ylim(YLIM)
ax.set_xlabel(XLABEL)
ax.set_ylabel(YLABEL)
# cusp
TITLE = "Number of direction changes"
-XLABEL = "Slot length minus car length [m]"
+XLABEL = "Free space [m]"
YLABEL = "Number of changes [-]"
LEGEND = [
- "Reversed approach",
- "Breadth-first search",
+ "Reversed",
+ "BFS",
]
-FILE = "/home/jiri/phd/pub/figs/psp_cusp.eps"
+FILE = "/home/jiri/phd/j1/figs/psp_cusp.eps"
GRID = True
YLOG = False
+YLIM = False
PLOT = []
PLOT.append([
- [0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7],
- [18, 8, 6, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 0],
+ [0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7],
+# use ``for i in `cat stats | cut -d, -f2`; do echo $i,; done`` to generate
+[
+16,
+8,
+6,
+4,
+4,
+2,
+2,
+2,
+2,
+2,
+2,
+2,
+2,
+0,
+],
])
PLOT.append([
- [0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7],
- [20, 8, 5, 4, 3, 2, 2, 2, 1, 1, 1, 0, 0, 0],
+ [0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7],
+[
+16,
+8,
+5,
+3,
+3,
+2,
+2,
+1,
+1,
+1,
+1,
+0,
+0,
+0,
+],
])
plot_graph()
# time
TITLE = "Elapsed time of search"
-XLABEL = "Slot length minus car length [m]"
+XLABEL = "Free space [m]"
YLABEL = "Elapsed time [s]"
LEGEND = [
- "Reversed approach",
- "Breadth-first search",
+ "Reversed",
+ "BFS",
]
-FILE = "/home/jiri/phd/pub/figs/psp_log_time.eps"
+FILE = "/home/jiri/phd/j1/figs/psp_time.eps"
GRID = False
-YLOG = True
+YLOG = False
+YLIM = [0, 0.008]
PLOT = []
PLOT.append([
- [0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7],
- [0.000188779, 0.000169099, 0.000171329, 0.000163953, 0.000164034,
- 0.00015062, 0.000156396, 0.000162544, 0.000169836, 0.000178857,
- 0.000189283, 0.000167157, 0.00014392, 0.000127497],
+ [0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7],
+[
+0.000265486,
+0.000227139,
+0.000185683,
+0.000164569,
+0.000159377,
+0.000150449,
+0.000156013,
+0.000162367,
+0.000170662,
+0.000180358,
+0.000190428,
+0.000164781,
+0.000143604,
+0.000126686,
+],
])
PLOT.append([
- [0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7],
- [0.0536272, 0.0362204, 0.0328787, 0.0316327, 0.0300563, 0.0278359,
- 0.0278474, 0.0278955, 0.0248918, 0.0247431, 0.0245795, 0.0201776,
- 0.0176046, 0.0176267],
+ [0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7],
+[
+0.00744224,
+0.00442855,
+0.00324742,
+0.00195541,
+0.00177623,
+0.0016829,
+0.0016006,
+0.0011417,
+0.00106993,
+0.00103785,
+0.000948079,
+0.00072849,
+0.000691348,
+0.000705111,
+],
])