0

I made some graphs with scikit-plot package, but need to customize the axes colors and sizes as well the lines width.

Here is what I already have plotted and the editable arguments of the function generating the plot:

skplt.metrics.plot_ks_statistic(y_train, 
random_forest.predict_proba(x_train[["out_prncp",
"int_rate","total_rec_prnc","total_pymnt"]]),ax=None, figsize=(15,7), title_fontsize="large",
text_fontsize="medium")
plt.xlim([0,0.7])
plt.title("KS Modelo Random Forest - Treino", size=20)
plt.rc("lines", linewidth=1.5, color='r')
plt.autoscale()

Current image

As show, the param arguments of matplotlib.pyplot to format are disregarded for some reason.

Just need to set the graph lines to 1.5 points of widths and black colors in the axis ticks

Quick excel hack to show the formating: reference

Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34
  • Hi there I reformatted your question slightly. Can you reframe this with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)? Perhaps with an example of what your plots look like and a rough sketch of what you want to happen? (By rough sketch: I mean you might literally edit the figure in paint/photoshop to show us what you want). – Alexander L. Hayes Dec 18 '22 at 21:27
  • Hi friend. Thanks for the hand. I added some details, like the args that the function generating the plots accepts, i think it might help to make the question clearer as well as the plot that i have at the moment and an example of style that i need to recreate. – Cesar Pereira Dec 18 '22 at 21:46
  • 1
    Hmm... That might be tricky. From the docs, it does not look like [`plot_ks_statistic`](https://scikit-plot.readthedocs.io/en/stable/metrics.html#scikitplot.metrics.plot_ks_statistic) provides a way to customize how the plots are made. It does allow passing an `ax` though. Try creating a subplot with `fig, ax = plt.subplots(1, 1)`, passing `ax` as an argument to the method, then applying updates to `ax`. – Alexander L. Hayes Dec 18 '22 at 22:03
  • @AlexanderL.Hayes any suggestion in how to declare the axes in that place? The documentation says "ax (matplotlib.axes.Axes, optional) – The axes upon which to plot the learning curve. If None, the plot is drawn on a new set of axes." Normally i would assign an axis using the ax.set, here i have no idea how to proceeed. – Cesar Pereira Dec 18 '22 at 23:41
  • My previous message showed how: `fig, ax = plt.subplots(1, 1)` – Alexander L. Hayes Dec 19 '22 at 00:34

0 Answers0