how to handle a figure #207
-
Could you answer the following questions. Q1. how can I save a figure such as a matrix and dendrogram? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @ryo3ryosuu welcome to FACET discussions and thanks for your questions! As the matrixplots and dendrograms are plotted using matplotlib, figure modifications can be performed as they would for any matplotlib plot. In the case of figure sizes there is a long standing thread on stackexchange here as a good starting place and for saving matplotlib figures you can see the documentation here. One solution applying this to FACET inspection plots is provided below. Thanks! After fitting your LearnerInspector() and for example, extracting the synergy matrix: from pytools.viz.matrix import MatrixDrawer
synergy_matrix = inspector.feature_synergy_matrix() you can set the figure size as shown before plotting in your notebook (assuming you have imported pyplot, i.e., plt.rcParams["figure.figsize"] = (14, 10)
MatrixDrawer(style="matplot%").draw(synergy_matrix, title="Synergy Matrix") You can then save a copy of the plot as follows: plt.savefig("synergy_matrix.png", bbox_inches="tight", pad_inches=0) |
Beta Was this translation helpful? Give feedback.
Hi @ryo3ryosuu welcome to FACET discussions and thanks for your questions!
As the matrixplots and dendrograms are plotted using matplotlib, figure modifications can be performed as they would for any matplotlib plot. In the case of figure sizes there is a long standing thread on stackexchange here as a good starting place and for saving matplotlib figures you can see the documentation here. One solution applying this to FACET inspection plots is provided below.
Thanks!
After fitting your LearnerInspector() and for example, extracting the synergy matrix:
you can set the figure size as shown bef…