Skip to content

plt.plot(..., c="...") doesn't always set the color properly #4866

Closed
@anntzer

Description

@anntzer

Specifically it is dependent on PYTHONHASHSEED:

$  PYTHONHASHSEED=1 python -c 'from pylab import *; plot([1, 2], [3, 4], c="g"); show()' # ==> ok
$ PYTHONHASHSEED=2 python -c 'from pylab import *; plot([1, 2], [3, 4], c="g"); show()' # ==> blue line

Pretty sure the issue happens in _process_plot_var_args._makeline which just checks whether the color kwargs is given (but doesn't check for c); if it is not it fetches the next color and uses it as the color kwarg, and whether color or c wins depends on the current hashing seed.

A bit scary...

version: matplotlib 1.4.3 packaged by Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions