Skip to content
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

background color of text is forground color on MacOSX #4609

Closed
mbakker7 opened this issue Jul 9, 2015 · 10 comments
Closed

background color of text is forground color on MacOSX #4609

mbakker7 opened this issue Jul 9, 2015 · 10 comments
Milestone

Comments

@mbakker7
Copy link

mbakker7 commented Jul 9, 2015

With MacOSX backend, the following fails:

from pylab import *
plot([1, 2, 3])
text(1, 2, 'Hello', backgroundcolor = 'red')

This plots a nice red box but no text. It looks like the backgroundcolor is set as the foreground.
mpl version 1.4.3
backend: MacOSX
Works correctly with Qt4Agg and, as reported on mailinglist, works correctly with TkAgg

@jenshnielsen
Copy link
Member

Confirming that I see the same with the OSX backend

@jenshnielsen
Copy link
Member

This could be related to #4024, see #4202 too

@efiring
Copy link
Member

efiring commented Jul 9, 2015

#4202 doesn't fix it. This looks like a different problem. Strangely, the text is very faintly visible as a slight lightening of the red. This is easier to see if you use fontsize=30. At least at the Python level, the default text color is not being overwritten by the background. I don't know what is happening inside the extension code.
attn: @mdehoon

In [16]: tt = text(1,2, 'hello', backgroundcolor='red', fontsize=30)

In [17]: tt.get_color()
'k'

@mdehoon
Copy link
Contributor

mdehoon commented Jul 9, 2015

I can't reproduce this bug. It's working fine for me with the MacOSX backend, matplotlib version 1.4.3.

@efiring
Copy link
Member

efiring commented Jul 9, 2015

@mbakker7 and @mdehoon which Python versions are you using? I tested with python 3. We have had several cases where the change between py2 and py3 in the order of iteration through a dictionary (such as kwargs in a function call) caused problems under py3.

@mdehoon
Copy link
Contributor

mdehoon commented Jul 9, 2015

@efiring Thanks! That is indeed the issue. With Python3, I am seeing this bug. Let me look into this.

@tacaswell tacaswell added this to the next point release milestone Jul 10, 2015
@mdehoon
Copy link
Contributor

mdehoon commented Jul 10, 2015

See pull request #4617 for a bug fix.

@jenshnielsen
Copy link
Member

Fixed by #4617

@mbakker7
Copy link
Author

Sorry for the late reply: I have the problem with Python 2.7.9-1. Got the
bug on two separate Macs, one with mpl 1.4.3, one with mpl 1.4.0, so it has
been around for a little while.

Thanks for looking into this,

Mark

On Thu, Jul 9, 2015 at 11:24 PM, Eric Firing notifications@github.com
wrote:

@mbakker7 https://github.com/mbakker7 and @mdehoon
https://github.com/mdehoon which Python versions are you using? I
tested with python 3. We have had several cases where the change between
py2 and py3 in the order of iteration through a dictionary (such as kwargs
in a function call) caused problems under py3.


Reply to this email directly or view it on GitHub
#4609 (comment)
.

@jenshnielsen
Copy link
Member

@mbakker7 Thanks for the confirmation

If you have a chance please test master and report it it fixes it for you

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

No branches or pull requests

5 participants