Skip to content

[Bug]: Args for tripcolor #22303

Closed
Closed
@ThibaultGROUEIX

Description

@ThibaultGROUEIX

Bug summary

Thanks for matplotlib!
tripcolor fails if colors are passed with named argument i.e c=values instead of just values. The error is not very informative and it seems a dangerous practice to ignore kwargs and only use args.

  File "/mnt/session_space/conda_envs/latest39/lib/python3.9/site-packages/matplotlib/tri/tripcolor.py", line 57, in tripcolor
    C = np.asarray(args[0])
IndexError: list index out of range

Code for reproduction

plt.tripcolor(vertices[:,0], vertices[:,1], c=values, triangles=triangles)

Actual outcome

  File "/mnt/session_space/conda_envs/latest39/lib/python3.9/site-packages/matplotlib/tri/tripcolor.py", line 57, in tripcolor
    C = np.asarray(args[0])
IndexError: list index out of range

Expected outcome

a successful plot.

Additional information

No response

Operating system

No response

Matplotlib Version

3.5.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions