Closed kolban-google closed 4 years ago
You can do it with decoration of the matplotlib plugin. It contains three functions: after_subplot
, before_plots
, after_plots
- that can be override in the plugin constructor. In that case, you should use after_subplot
.
Example:
import matplotlib.pyplot as plt
from livelossplot import PlotLosses
from livelossplot.outputs import MatplotlibPlot
def custom_after_subplot(self, ax: plt.Axes, group_name: str, x_label: str):
ax.set_title(group_name)
ax.set_xlabel(x_label)
ax.legend(loc='lower right')
outputs = [MatplotlibPlot(after_subplot=custom_after_subplot)]
groups = {'acccuracy': ['acc', 'val_acc'], 'log-loss': ['loss', 'val_loss']}
plotlosses = PlotLosses(groups=groups, outputs=outputs)
Can we choose the position of the legend? The right middle is obscuring data (for me)