Skip to content

Commit

Permalink
added example for bar plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Gacon committed Sep 9, 2016
1 parent e0cb3e9 commit c776c05
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Examples/7-Bar/bar.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# include <Eigen/Dense>
# include <figure/figure.hpp>

int main () {
const int n = 20;
Eigen::VectorXd v = Eigen::VectorXd::Random(n),
w = Eigen::VectorXd::LinSpaced(n, 1, n),
z = Eigen::VectorXd::LinSpaced(n, 2000, 2000 + n);
mgl::Figure fig;
fig.bar(v, "r+");
fig.save("random");

mgl::Figure fig2;
fig2.bar(z, w);
fig2.save("linear");
return 0;
}

0 comments on commit c776c05

Please sign in to comment.