Hallo everybody,
maybe something can help me with this:
I generate a plot with matplotlib. I save it as an .png image called
plot.png.
now i want to get that image into excel. (so i do this I'm using
xlwt) .
plt.savefig('plot.png')
ws.insert_bitmap('plot.png', 35, 7)
if i run i get this message:
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\ginput[2].py", line 753, in Homogeen_SNR_CNR
ws.insert_bitmap('plot.png', 35, 7)
File "C:\Python26\lib\site-packages\xlwt\Worksheet.py", line 1034,
in insert_bitmap
bmp = Bitmap.ImDataBmpRecord(filename)
File "C:\Python26\lib\site-packages\xlwt\Bitmap.py", line 255, in
__init__
self.width, self.height, self.size, data =
_process_bitmap(filename)
File "C:\Python26\lib\site-packages\xlwt\Bitmap.py", line 206, in
_process_bitmap
raise Exception("bitmap doesn't appear to to be a valid bitmap
image.")
Exception: bitmap doesn't appear to to be a valid bitmap image.
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\ginput[2].py", line 753, in Homogeen_SNR_CNR
ws.insert_bitmap('plot.png', 35, 7)
File "C:\Python26\lib\site-packages\xlwt\Worksheet.py", line 1034,
in insert_bitmap
bmp = Bitmap.ImDataBmpRecord(filename)
File "C:\Python26\lib\site-packages\xlwt\Bitmap.py", line 255, in
__init__
self.width, self.height, self.size, data =
_process_bitmap(filename)
File "C:\Python26\lib\site-packages\xlwt\Bitmap.py", line 206, in
_process_bitmap
raise Exception("bitmap doesn't appear to to be a valid bitmap
image.")
Exception: bitmap doesn't appear to to be a valid bitmap image.
if i go to the map where i saved the image i CAN open it.
thanks in advance
--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To post to this group, send an email to
python...@googlegroups.com.
To unsubscribe from this group, send email to
python-excel...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/python-excel?hl=en-GB.