Hello,
The basic way to modify the plot is to get access to the axes object that the visualizer is drawing on using the `
viz.ax` property; note however that some visualizers have multiple axes objects, for example the ResidualsPlot has an axes for the scatter plot and the histogram. Often, this is sufficient for basic changes or to plot additional data.
Changing the font of the legend is a bit tricker, however. Using the `
viz.ax` property, you'd have to loop through the children of the axes and look for the legend(s), then set the front property as follows:
viz.fit(X_train, y_train)
viz.score(X_test, y_test)
viz.finalize()
legends = [c for c in viz.ax.get_children() if isinstance(c, mpl.legend.Legend)
for legend in legends:
plt.setp(legend.texts, family='monospace')
plt.savefig("peplot.pdf")
A more complex method of modifying the matplotlib output is to use matplotlib rc params:
import yellowbrick
import matplotlib as mpl
mpl.rc('font', family='Times New Roman')
Please note that yellowbrick is imported first, so yellowbrick's default settings are applied, then you can modify the settings to your custom settings.
If you need to reset all styles and start over, you can use `yellowbrick.style.rcmod.reset_orig()` or `yellowbrick.style.rcmod.reset_defaults()`
Hope this helps!