import functools


def stylize(plot_func):
    """Return function stylizing Plot figure.

    Used as a decorator for functions returning Plot so that all figures are stylized similarly.

    Returns:
        function: function stylizing Plot figure
    """

    @functools.wraps(plot_func)
    def wrapper(self, *args, **kwargs):
        p = plot_func(self, *args, **kwargs)

        text_color = "#8C8C8C"

        p.axis.minor_tick_line_color = None
        p.axis.major_tick_line_color = None
        p.axis.major_label_text_font = "Lato"
        p.axis.major_label_text_color = text_color
        p.axis.axis_line_color = text_color

        p.axis.axis_label_text_font = "Lato"
        p.axis.axis_label_text_color = text_color
        p.axis.axis_label_text_font_style = "normal"

        p.xaxis.axis_label_text_font_size = "16px"
        p.xaxis.major_label_text_font_size = "14px"
        p.yaxis.axis_label_text_font_size = "16px"
        p.yaxis.major_label_text_font_size = "14px"

        p.xgrid.grid_line_color = None
        p.ygrid.grid_line_color = None

        p.title.text_font = "Lato"
        p.title.text_color = text_color
        p.title.text_font_size = "20px"

        return p

    return wrapper