Problem between IPython QtConsole within Spyder, and matplotlib pyplot.plot

134 views
Skip to first unread message

Yuxiang Wang

unread,
Mar 29, 2015, 11:03:40 PM3/29/15
to spyd...@googlegroups.com
Dear all,

First of all, sorry that if this is not the right place to post - I have been struggling with this for quite a while and would really appreciate any input.

I know this sounds like a matplotlib problem, but this only happens within spyder, and only within the ipython qtconsole within spyder.

I am using Windows 7 64-bit, Python 3.4 64-bit, Spyder 2.3.4, matplotllib 1.4.3, IPython 3.0.0.

To repeat - run the following code in the ipython qtconsole WITHIN spyder, using either tk or qt backend:

import matplotlib.pyplot as plt
plt.plot(range(5), c='r')

The color red does not show up at all! The weird thing is, if I use color='r', or I run this code in python not ipython, or I run this code in ipython outside of spyder, this works. I can use color='r' for my new code, but I have tens of thousands lines of code with embedded c='r' everywhere. 

Could anyone please help?

Thank you!

Shawn

Adrian Klaver

unread,
Mar 30, 2015, 10:20:28 AM3/30/15
to spyd...@googlegroups.com
On 03/29/2015 08:03 PM, Yuxiang Wang wrote:
> Dear all,
>
> First of all, sorry that if this is not the right place to post - I have
> been struggling with this for quite a while and would really appreciate
> any input.
>
> I know this sounds like a matplotlib problem, but this only happens
> within spyder, and only within the ipython qtconsole within spyder.
>
> I am using Windows 7 64-bit, Python 3.4 64-bit, Spyder 2.3.4,
> matplotllib 1.4.3, IPython 3.0.0.
>
> To repeat - run the following code in the ipython qtconsole WITHIN
> spyder, using either tk or qt backend:
>
> import matplotlib.pyplot as plt
> plt.plot(range(5), c='r')
>
> The color red does not show up at all! The weird thing is, if I use
> color='r', or I run this code in python not ipython, or I run this code
> in ipython outside of spyder, this works. I can use color='r' for my new

So does any color show up?

How did you install Spyder?

It seems the issue is IPython dependent, so is the version of IPython
the same in Spyder as out?


> code, but I have tens of thousands lines of code with embedded c='r'
> everywhere.
>
> Could anyone please help?
>
> Thank you!
>
> Shawn
>



--
Adrian Klaver
adrian...@aklaver.com

Yuxiang Wang

unread,
Mar 30, 2015, 12:06:59 PM3/30/15
to spyd...@googlegroups.com
Hi Adrian,

Thank you for your response!

1) The default blue showed up, as if I did not pass the `c='r'`
keyword. Actually, if I ran the code twice, the new line will show up
in the right color. (weird...)

2) It came with WinPython-64bit-3.4.3.2 (and then I used pip install
jedi and pip install sphinx... but it shouldn't matter for this case
though).

3) The IPython is both 3.0.0 in and out of Spyder, by typing import
IPython; IPython.__version__ in the IPython QtConsole, in Spyder or
standalone.

Shawn
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "spyder" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/spyderlib/Az-dNPPO9p0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> spyderlib+...@googlegroups.com.
> To post to this group, send email to spyd...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.



--
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
yw...@virginia.edu
+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/

Adrian Klaver

unread,
Mar 30, 2015, 5:14:32 PM3/30/15
to spyd...@googlegroups.com
On 03/30/2015 09:06 AM, Yuxiang Wang wrote:
> Hi Adrian,
>
> Thank you for your response!
>
> 1) The default blue showed up, as if I did not pass the `c='r'`
> keyword. Actually, if I ran the code twice, the new line will show up
> in the right color. (weird...)

Makes me think this is some sort of set up glitch in the WinPython
install. You might to give those folks a shout also, to see if they have
any suggestions. Otherwise, at this point I've got nothing.

>
> 2) It came with WinPython-64bit-3.4.3.2 (and then I used pip install
> jedi and pip install sphinx... but it shouldn't matter for this case
> though).
>
> 3) The IPython is both 3.0.0 in and out of Spyder, by typing import
> IPython; IPython.__version__ in the IPython QtConsole, in Spyder or
> standalone.
>
> Shawn
>



--
Adrian Klaver
adrian...@aklaver.com

Yuxiang Wang

unread,
Mar 30, 2015, 5:19:35 PM3/30/15
to spyd...@googlegroups.com
Thanks Adrian! I will give it a try.

Shawn

Yuxiang Wang

unread,
Mar 30, 2015, 11:47:33 PM3/30/15
to spyd...@googlegroups.com
Dear all,

Solved - this is a bug that is now fixed in the matplotlib source. See the following link


Shawn
Reply all
Reply to author
Forward
0 new messages