Skip to content

Commit

Permalink
Fix the backend changing code.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed May 13, 2019
1 parent cd8172c commit be7bffe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/matplotlib/mpl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ end

let init_ backend =
maybe_py_init ();
let plt = Py.import "matplotlib.pyplot" in
let mpl = Py.import "matplotlib" in
Option.iter (Backend.to_string_option backend) ~f:(fun backend_str ->
ignore (plt.&("switch_backend")[| Py.String.of_string backend_str |]));
plt
ignore (mpl.&("use")[| Py.String.of_string backend_str |]));
Py.import "matplotlib.pyplot"

let set_backend backend =
let plt = init_ backend in
Expand Down

0 comments on commit be7bffe

Please sign in to comment.