Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't customise PDP plot colors #53

Closed
lstodd opened this issue Jul 15, 2019 · 1 comment
Closed

Can't customise PDP plot colors #53

lstodd opened this issue Jul 15, 2019 · 1 comment

Comments

@lstodd
Copy link

lstodd commented Jul 15, 2019

It would be great to have the option to customise the PDPbox plot colours. Could this be added as a feature?

@dyerrington
Copy link

You can actually @lstodd. Check out the docs for the plot_params in most of the methods:
https://pdpbox.readthedocs.io/en/latest/target_plot.html

These are sent to matplotlib. Also plotting methods return figure and axes and you can use those matplotlib objects to do whatever you like. The docs have a handy reference here for one of the plot methods that should apply to the other ones that have the same parameter:
https://pdpbox.readthedocs.io/en/latest/pdp_plot.html

plot_params: dict or None, optional, default=None
parameters for the plot, possible parameters as well as default as below:

plot_params = {
    # plot title and subtitle
    'title': 'PDP for feature "%s"' % feature_name,
    'subtitle': "Number of unique grid points: %d" % n_grids,
    'title_fontsize': 15,
    'subtitle_fontsize': 12,
    'font_family': 'Arial',
    # matplotlib color map for ICE lines
    'line_cmap': 'Blues',
    'xticks_rotation': 0,
    # pdp line color, highlight color and line width
    'pdp_color': '#1A4E5D',
    'pdp_hl_color': '#FEDC00',
    'pdp_linewidth': 1.5,
    # horizon zero line color and with
    'zero_color': '#E75438',
    'zero_linewidth': 1,
    # pdp std fill color and alpha
    'fill_color': '#66C2D7',
    'fill_alpha': 0.2,
    # marker size for pdp line
    'markersize': 3.5,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants