Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Matplotlib/Pylab Error

Reply
Thread Tools

Matplotlib/Pylab Error

 
 
subhabangalore@gmail.com
Guest
Posts: n/a
 
      12-10-2012
Dear Group,

I am trying to enumerate few interesting errors on pylab/matplotlib.
If any of the learned members can kindly let me know how should I address them.

I am trying to enumerate them as follows.

i) >>> import numpy
>>> import pylab
>>> t = numpy.arange(0.0, 1.0+0.01, 0.01)
>>> s = numpy.cos(2*2*numpy.pi*t)
>>> pylab.plot(t, s)

[<matplotlib.lines.Line2D object at 0x021122D0>]
>>> pylab.show()

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 236, in resize
self.show()
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 239, in draw
FigureCanvasAgg.draw(self)
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 421, in draw
self.figure.draw(self.renderer)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\figure.py", line 898, in draw
func(*args)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\axes.py", line 1997, in draw
a.draw(renderer)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\axis.py", line 1045, in draw
tick.draw(renderer)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\axis.py", line 239, in draw
self.label1.draw(renderer)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\text.py", line 591, in draw
ismath=ismath)
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 167, in draw_text
font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
TypeError: draw_glyphs_to_bitmap() takes no keyword arguments

ii) Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

************************************************** **************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
************************************************** **************

IDLE 2.6.1
>>> import networkx as nx
>>> G=nx.Graph()
>>> G.add_node(1)
>>> G.add_nodes_from([2,3])
>>> H=nx.path_graph(10)
>>> G.add_nodes_from(H)
>>> G.add_node(H)
>>> G.add_edge(1,2)
>>> G.draw()


Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
G.draw()
AttributeError: 'Graph' object has no attribute 'draw'
>>> import matplotlib.pyplot as plt
>>> plt.show()
>>> nx.draw(G)
>>> plt.show()

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 236, in resize
self.show()
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 239, in draw
FigureCanvasAgg.draw(self)
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 421, in draw
self.figure.draw(self.renderer)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\figure.py", line 898, in draw
func(*args)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\axes.py", line 1997, in draw
a.draw(renderer)
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python26\Lib\site-packages\matplotlib\text.py", line 591, in draw
ismath=ismath)
File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 167, in draw_text
font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
TypeError: draw_glyphs_to_bitmap() takes no keyword arguments

Regards,
Subhabrata.
 
Reply With Quote
 
 
 
 
Oscar Benjamin
Guest
Posts: n/a
 
      12-12-2012
On 10 December 2012 20:40, <(E-Mail Removed)> wrote:
> Dear Group,
>
> I am trying to enumerate few interesting errors on pylab/matplotlib.
> If any of the learned members can kindly let me know how should I address them.
>
> I am trying to enumerate them as follows.
>
> i) >>> import numpy
>>>> import pylab
>>>> t = numpy.arange(0.0, 1.0+0.01, 0.01)
>>>> s = numpy.cos(2*2*numpy.pi*t)
>>>> pylab.plot(t, s)

> [<matplotlib.lines.Line2D object at 0x021122D0>]
>>>> pylab.show()

> Exception in Tkinter callback
> Traceback (most recent call last):
> File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
> return self.func(*args)
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 236, in resize
> self.show()
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 239, in draw
> FigureCanvasAgg.draw(self)
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 421, in draw
> self.figure.draw(self.renderer)
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File "C:\Python26\Lib\site-packages\matplotlib\figure.py", line 898, in draw
> func(*args)
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File "C:\Python26\Lib\site-packages\matplotlib\axes.py", line 1997, in draw
> a.draw(renderer)
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File "C:\Python26\Lib\site-packages\matplotlib\axis.py", line 1045, in draw
> tick.draw(renderer)
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File "C:\Python26\Lib\site-packages\matplotlib\axis.py", line 239, in draw
> self.label1.draw(renderer)
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File "C:\Python26\Lib\site-packages\matplotlib\text.py", line 591, in draw
> ismath=ismath)
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 167, in draw_text
> font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
> TypeError: draw_glyphs_to_bitmap() takes no keyword arguments
>
> ii) Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
>


The example above works for me just fine (in ipython):
In [1]: import pylab

In [2]: import numpy

In [3]: t = numpy.arange(0.0, 1.0+0.01, 0.01)

In [4]: s = numpy.cos(2*2*numpy.pi*t)

In [5]: pylab.plot(t, s)
Out[5]: [<matplotlib.lines.Line2D at 0x3c36310>]

In [6]: pylab.show() # At this point a plot of cos(t) appears as expected


Have you customised your matplotlibrc file? I have no problems with the above,

>
> IDLE 2.6.1
>>>> import networkx as nx


Sorry, I don't have this module installed.


Oscar
 
Reply With Quote
 
 
 
 
subhabangalore@gmail.com
Guest
Posts: n/a
 
      12-12-2012
On Tuesday, December 11, 2012 2:10:07 AM UTC+5:30, (E-Mail Removed) wrote:
> Dear Group,
>
>
>
> I am trying to enumerate few interesting errors on pylab/matplotlib.
>
> If any of the learned members can kindly let me know how should I addressthem.
>
>
>
> I am trying to enumerate them as follows.
>
>
>
> i) >>> import numpy
>
> >>> import pylab

>
> >>> t = numpy.arange(0.0, 1.0+0.01, 0.01)

>
> >>> s = numpy.cos(2*2*numpy.pi*t)

>
> >>> pylab.plot(t, s)

>
> [<matplotlib.lines.Line2D object at 0x021122D0>]
>
> >>> pylab.show()

>
> Exception in Tkinter callback
>
> Traceback (most recent call last):
>
> File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
>
> return self.func(*args)
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 236, in resize
>
> self.show()
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 239, in draw
>
> FigureCanvasAgg.draw(self)
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 421, in draw
>
> self.figure.draw(self.renderer)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\figure.py", line 898, indraw
>
> func(*args)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\axes.py", line 1997, in draw
>
> a.draw(renderer)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\axis.py", line 1045, in draw
>
> tick.draw(renderer)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\axis.py", line 239, in draw
>
> self.label1.draw(renderer)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\text.py", line 591, in draw
>
> ismath=ismath)
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 167, in draw_text
>
> font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
>
> TypeError: draw_glyphs_to_bitmap() takes no keyword arguments
>
>
>
> ii) Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32
>
> Type "copyright", "credits" or "license()" for more information.
>
>
>
> ************************************************** **************
>
> Personal firewall software may warn about the connection IDLE
>
> makes to its subprocess using this computer's internal loopback
>
> interface. This connection is not visible on any external
>
> interface and no data is sent to or received from the Internet.
>
> ************************************************** **************
>
>
>
> IDLE 2.6.1
>
> >>> import networkx as nx

>
> >>> G=nx.Graph()

>
> >>> G.add_node(1)

>
> >>> G.add_nodes_from([2,3])

>
> >>> H=nx.path_graph(10)

>
> >>> G.add_nodes_from(H)

>
> >>> G.add_node(H)

>
> >>> G.add_edge(1,2)

>
> >>> G.draw()

>
>
>
> Traceback (most recent call last):
>
> File "<pyshell#8>", line 1, in <module>
>
> G.draw()
>
> AttributeError: 'Graph' object has no attribute 'draw'
>
> >>> import matplotlib.pyplot as plt

>
> >>> plt.show()

>
> >>> nx.draw(G)

>
> >>> plt.show()

>
> Exception in Tkinter callback
>
> Traceback (most recent call last):
>
> File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
>
> return self.func(*args)
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 236, in resize
>
> self.show()
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 239, in draw
>
> FigureCanvasAgg.draw(self)
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 421, in draw
>
> self.figure.draw(self.renderer)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\figure.py", line 898, indraw
>
> func(*args)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\axes.py", line 1997, in draw
>
> a.draw(renderer)
>
> File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper
>
> draw(artist, renderer, *args, **kwargs)
>
> File "C:\Python26\Lib\site-packages\matplotlib\text.py", line 591, in draw
>
> ismath=ismath)
>
> File "C:\Python26\Lib\site-packages\matplotlib\backends\backend_agg.py", line 167, in draw_text
>
> font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
>
> TypeError: draw_glyphs_to_bitmap() takes no keyword arguments
>
>
>
> Regards,
>
> Subhabrata.


I think the problem is with the OS. In my home machine(with MS-Windows 7) it is running fine, but in the office machine(with MS-Windows XP SP2) it is giving error. I tried to have a word with my System Admin friend he is bit unaware about the Python environment, and I have a pressing need to solve. I restarted the machine but did not help.

Regards,
Subhabrata.
 
Reply With Quote
 
Mark Lawrence
Guest
Posts: n/a
 
      12-12-2012
On 10/12/2012 20:40, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Dear Group,
>
> I am trying to enumerate few interesting errors on pylab/matplotlib.
> If any of the learned members can kindly let me know how should I address them.
>


I think you'd get more responses if you post your questions on the
matplotlib users mailing list.

--
Cheers.

Mark Lawrence.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error JavaQueries Java 1 03-01-2005 06:30 PM



Advertisments