aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/make_plots.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/make_plots.py b/src/make_plots.py
index daf5ca3..aa77365 100644
--- a/src/make_plots.py
+++ b/src/make_plots.py
@@ -49,21 +49,27 @@ def plot_graph(figure_name):
plot information in a pretty way
"""
plt.clf()
- x = [50, 100, 500, 1000, 2000, 5000]
+ fig = plt.figure(1)
+ labels = [50, 100, 500, 1000, 2000, 5000]
+ x = [np.log(50), np.log(100), np.log(500), np.log(1000), np.log(2000), np.log(5000)]
sparse_recov = [.25, .32, .7, .82, .89, .92]
max_likel = [.21, .29, .67, .8, .87, .9]
- lasso = [.07, .30, .46, .65, 0, 0]
+ lasso = [.07, .30, .46, .65, .86, .89]
greedy = [.09, .15, .4, .63, .82, .92]
- plt.axis((0, 5500, 0, 1))
+ fig, ax = plt.subplots()
+
+ plt.axis((np.log(45), np.log(5500), 0, 1))
plt.xlabel("Number of Cascades")
plt.ylabel("F1 score")
plt.grid(color="lightgrey")
- plt.plot(x, greedy, 'ko-', color="lightseagreen", label='Greedy')
- plt.plot(x, lasso, 'ko-', color="orange", label="Lasso")
- plt.plot(x, max_likel, 'ko-', color="coral", label="MLE")
- plt.plot(x, sparse_recov, 'ko-', color="k", label="Sparse MLE")
+ ax.plot(x, greedy, 'ko-', color="lightseagreen", label='Greedy')
+ ax.plot(x, lasso, 'ko-', color="orange", label="Lasso")
+ ax.plot(x, max_likel, 'ko-', color="coral", label="MLE")
+ ax.plot(x, sparse_recov, 'ko-', color="k", label="Our Method")
plt.legend(loc="lower right")
+ ax.set_xticks(x)
+ ax.set_xticklabels(tuple(labels))
plt.savefig("../paper/figures/"+figure_name)