Skip to content

Bug in pyplot.plot() with zorder/solid_capstyle kwarg combinations #4262

@megies

Description

@megies

There is a strange bug that changes the color used in the plot, happening to me for certain combinations of zorder and solid_capstyle kwargs. Happens to me on matplotlib 1.4.3 installed through anaconda/conda package (tried it with TKAGG and QT4AGG).

import matplotlib.pyplot as plt

plt.subplot(321)
plt.plot([0, 1], [0, 1], c="black", ls="-", lw=20, zorder=None)
plt.title("zorder=None")
plt.subplot(322)
plt.plot([0, 1], [0, 1], c="black", ls="-", lw=20, zorder=None, solid_capstyle="round")
plt.title('zorder=None, solid_capstyle="round"')
plt.subplot(323)
plt.plot([0, 1], [0, 1], c="black", ls="-", lw=20, zorder=10)
plt.title('zorder=10')
plt.subplot(324)
plt.plot([0, 1], [0, 1], c="black", ls="-", lw=20, zorder=10, solid_capstyle="round")
plt.title('zorder=10, solid_capstyle="round"')
plt.subplot(325)
plt.plot([0, 1], [0, 1], c="black", ls="-", lw=20)
plt.title('')
plt.subplot(326)
plt.plot([0, 1], [0, 1], c="black", ls="-", lw=20, solid_capstyle="round")
plt.title('solid_capstyle="round"')

plt.tight_layout()
plt.show()

figure_1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions