Skip to content

Commit

Permalink
Use stdio to simplify the example.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed May 12, 2019
1 parent def1f73 commit bd3cb0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(executables
(names plot)
(libraries base matplotlib))
(libraries base stdio matplotlib))
4 changes: 1 addition & 3 deletions examples/plot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ let () =
Matplotlib.plot ~color:Green ~linestyle:Dotted ~linewidth:2. ~xs ys2;
Matplotlib.savefig "test.png";
let data = Matplotlib.plot_data `png in
let out_channel = Caml.open_out "test2.png" in
Caml.output_string out_channel data;
Caml.close_out out_channel;
Stdio.Out_channel.write_all "test2.png" ~data;
Matplotlib.show ()

0 comments on commit bd3cb0a

Please sign in to comment.