8000 Fix line color handling by tacaswell · Pull Request #2761 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix line color handling #2761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 27, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
TST : test plot(.., color='none')
added failing test for issue #2760
  • Loading branch information
tacaswell committed Jan 24, 2014
commit d2a9f6bfc83dacc6f087fc50921bdf8ed99ce0a2
15 changes: 14 additions & 1 deletion lib/matplotlib/tests/test_lines.py
Original file line number D 8000 iff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def test_invisible_Line_rendering():
"""
Github issue #1256 identified a bug in Line.draw method

Despite visibility attribute set to False, the draw method was not
returning early enough and some pre-rendering code was executed
though not necessary.
Expand Down Expand Up @@ -67,6 +67,19 @@ def test_set_line_coll_dash():
assert True


@cleanup
def test_line_colors():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.plot(range(10), color='none')
ax.plot(range(10), color='r')
ax.plot(range(10), color='.3')
ax.plot(range(10), color=(1, 0, 0, 1))
ax.plot(range(10), color=(1, 0, 0))
fig.canvas.draw()
assert True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not the biggest fan of these tests (though I have written one or two myself). What would be super cool is if we could inspect the GraphicsContext for each artist and assert the facecolor is a certain value - but I suspect the current interface makes that a little hard.



@image_comparison(baseline_images=['line_collection_dashes'], remove_text=True)
def test_set_line_coll_dash_image():
fig = plt.figure()
Expand Down
0