HOME/Articles/

matplotlib example pyplot (snippet)

Article Outline

Python matplotlib example 'pyplot'

Functions in program:

  • def set_plt_style(n):

python pyplot

Python matplotlib example: pyplot

def set_plt_style(n):
    colors = sns.husl_palette(n)
    markers = ['o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd'] * (int(n / 13) + 1)
    linestyles = ['-', ':', '-.', '--', ':', '-.', '--'] * (int(n / 7) + 1)
    return({'color': colors,
            'marker': markers,
            'linestyle': linestyles})