diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-02-04 11:30:52 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-02-04 11:30:52 -0500 |
| commit | e82b8100d4da0789e7f13e90778f1cc2d2a49df5 (patch) | |
| tree | be829987528670870b205b926b088c26bc308f77 /src | |
| parent | b0afcfd95cc49b05a67a21de5c1ff2771628fc77 (diff) | |
| download | cascades-e82b8100d4da0789e7f13e90778f1cc2d2a49df5.tar.gz | |
adding figure
Diffstat (limited to 'src')
| -rw-r--r-- | src/make_plots.py | 20 |
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) |
