Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pyplot.plot() doesn't respect the selected color #5197

Copy link
Copy link
Closed
@Gabriel-p

Description

@Gabriel-p
Issue body actions

This comes from a question made here: http://stackoverflow.com/questions/32956419/weird-matplotlib-color-issue-when-plotting-line

I'm running Python v2.7.6 and matplotlib v1.4.3. I have a simple plot:

import matplotlib.pyplot as plt
import numpy as np
x, y = np.random.random(50), np.random.random(50)
plt.plot(x, y, c='red', ls='-', lw=1., label='a', zorder=2)
plt.show()

Notice that the color is supposed to be red as per c='red'. What I get instead is:

enter image description here

If I use the full name of the argument color='red', the line is red as it should. If I remove any of the arguments after c='red', e.g.:

plt.plot(x, y, c='red', ls='-', lw=1., label='a')
plt.plot(x, y, c='red', ls='-', lw=1., zorder=2)
plt.plot(x, y, c='red', ls='-', label='a', zorder=2)
plt.plot(x, y, c='red', lw=1., label='a', zorder=2)

the plotted line is also red. Using:

plt.plot(x, y, c='r', ls='-', lw=1., label='a', zorder=2)

(i.e.: c='r' instead of c='red') has no effect on my system, I still get the blue line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.