Skip to content

GridPlot forces to plot into new figure #101

@jonas-eschle

Description

@jonas-eschle

Hi all,

In the init of rep.plotting.GridPlot (as well as HStackPlot), self.new_plot is set to True. Why exactly is this necessary? If the plot-function is called, there is an option for "new_plot". A new figure is created if either new_plot or self.new_plot is True.

But I would like to plot in an already existing (empty) figure and therefore the self.new_plot in the init is quite bad as it creates a new one when calling "plot".

Couldn't we just remove the "self.new_plot=True" in the init? Is there any possible damage?

Hacking seems to work so far by getting the plotting instance and then setting "new_plot" to False, like:

# report is a classification-report
plt.figure("my_figure")
plotter = report.feature_importance_shuffling()
plotter.new_plot = False
plotter.plot()  # plots into "my_figure"

Best,
Mayou

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions