Search code examples
pythonkeyword-argument

kwargs don't do anything


Could you help me to understand why these keywords arguments do not do anything on the diagram plotting ? My code does not return any error but it does not take into account these arguments.

plot_kwargs = ({'marker': 'o', 'color': 'w', 'mec': 'b', 'linestyle': '-'})

annotate_kwargs = ({'text': 'illuminant'})

plot_planckian_locus_in_chromaticity_diagram(xy, method='CIE 1960 UCS', **plot_kwargs, **annotate_kwargs)

Solution

  • Assuming you are working with Colour, you are not supposed to use dict unpacking to pass plot_kwargs and annotate_kwargs.

    From the documentation:

    plot_planckian_locus_in_chromaticity_diagram(
        ['A', 'B', 'C'],
        annotate_kwargs=annotate_kwargs,
        plot_kwargs=plot_kwargs
    )