Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lines.py: fix bugs in marker alpha and edge colors #598

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 1 commit into from
Nov 28, 2011

Conversation

efiring
Copy link
Member

@efiring efiring commented Nov 24, 2011

Two bugs are fixed:

  1. plt.plot(np.arange(3),'ro', mec='none')
    was not plotting anything because 'none' was setting the
    edgecolor alpha to 0, and that alpha was being propagated
    to gc, overriding the face color. The 'none' case needs to
    be trapped, not passed on to the GraphicsContext.

  2. plt.plot(np.arange(3), 'r.')
    was drawing a black edge around the point; same for 'r,';
    the markers.py refactoring turned the point and pixel markers
    into filled markers, with their default black borders. The
    solution here was to special-case them in Line2D. They do
    need to be filled, with edges of the same color; otherwise
    the pixel can end up nearly invisible, and the point could
    end up as a donut.

Two bugs are fixed:

1) plt.plot(np.arange(3),'ro', mec='none')
was not plotting anything because 'none' was setting the
edgecolor alpha to 0, and that alpha was being propagated
to gc, overriding the face color. The 'none' case needs to
be trapped, not passed on to the GraphicsContext.

2) plt.plot(np.arange(3), 'r.')
was drawing a black edge around the point; same for 'r,';
the markers.py refactoring turned the point and pixel markers
into filled markers, with their default black borders.  The
solution here was to special-case them in Line2D.  They do
need to be filled, with edges of the same color; otherwise
the pixel can end up nearly invisible, and the point could
end up as a donut.
mdboom added a commit that referenced this pull request Nov 28, 2011
lines.py: fix bugs in marker alpha and edge colors
@mdboom mdboom merged commit 23cdfaa into matplotlib:v1.1.x Nov 28, 2011
@mdboom
Copy link
Member

mdboom commented Nov 28, 2011

Looks good. Merging.

@azjps
Copy link
Contributor

azjps commented Oct 22, 2014

I'm getting this problem again on current development branch (1.5.x). In Out[2], I see nothing plotted:

~/matplotlib (master)$ ipython
Python 2.7.6 (default, Aug 25 2014, 18:32:19) 
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: %matplotlib
Using matplotlib backend: TkAgg

In [2]: import matplotlib; import matplotlib.pyplot as plt; import numpy as np; plt.plot(np.arange(3),'ro', mec='none')
Out[2]: [<matplotlib.lines.Line2D at 0x4171610>] 

In [3]: import platform; platform.release()
Out[3]: '3.10.36-el5.ia32e.lime.0'

In [4]: matplotlib
Out[4]: <module 'matplotlib' from '/apps/stonefs1/azhu/venv/el5-stonelib/lib/python2.7/site-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/__init__.pyc'>

In [5]: matplotlib.__version__
Out[5]: '1.5.x'

However this plots fine on matplotlib 1.4. Here's most recent commit in source code for 1.5.x build:

~/matplotlib (master)$ git log -n 2
commit 5305f4ace715e0bf17f1892203cc7062a48a285c
Merge: 0a96efb c0995e5
Author: Jens Hedegaard Nielsen <[email protected]>
Date:   Tue Oct 21 13:30:02 2014 +0100

    Merge pull request #3675 from mdboom/doc-build-warnings

    Additional Warnings in docs build on travis after merge of decxx

Can someone confirm? Should I open a new issue?

@tacaswell
Copy link
Member

@azjps Can you please open this as a new issue, just to make keeping track of it easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants