Matplotlib backend for visualization functions
See original GitHub issueThis issue proposes to implement the Matplotlib backend for the visualization functions.
Motivation
While the current visualization backend, Plotly, provides rich and interactive interfaces, the setup is sometimes hard especially when exporting figures as static ones. Specifically, the installation steps of Orca are complicated in some environments (see https://github.com/plotly/orca/issues/150 for example) or may restrict the way of package management as plotly-orca
favors Conda installation.
Providing another backend such as Matpotlib may mitigate this problem, where the library does not require extra setup to output static figures and is pre-installed in some popular platforms such as Anaconda.
Alternatives
Plotly has supported Kaleido backend for static export since Plotly 4.9. Thus, we could guide users to install this backend, although it restricts the Plotly version where Optuna supports >= 4.0.0
currently.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (6 by maintainers)
Top GitHub Comments
If I may make a proposal regarding the public API of the matplotlib plotting functions:
It would be really nice if as a user, I were allowed to pass the
ax
to the plotting function. This allows me to have a greater control about the final plot. E.g., right now I cannot change the plot size or make the plot part of a larger figure with several subplots. Here is an example how I could use this feature:The default argument for
ax
could be None, in which case the functions do exactly the same thing as they do right now. Inside the different functions, you just need to change the code to:I would also suggest not to set
plt.style.use("ggplot")
– why not leave that up to the user?@toshihikoyanase Thank you for your feedback! My idea above is a rough draft, so I appreciate your detailed thoughts. I agree with both points you mentioned. I’ll work on it today and put a PR, then let’s discuss further.