bugpyFormex - Bugs: bug #38598, problem with matplotlib on...

 
 

bug #38598: problem with matplotlib on pyFormex GIT

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Tue 26 Mar 2013 03:22:45 PM UTC  
 
Category: ExternalSeverity: 2 - Minor
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 27 Mar 2013 03:54:48 PM UTC, comment #3:

- Please do not suggest it is git vs svn related.
- It is also not pyFormex related.
- In pyFormex we use the PyQt4 version 2 API. That means you should NOT USE QString.
- It looks like QString is imported by the pylab backend of matplotlib.
- You should not (have to) use pylab inside pyFormex, certainly not just for using matplotlib.

The proper solutions:
- Saving an image from matplotlib: just use

- Show a matplotlib canvas: use the Qt4 backend instead of the pylab backend:

We could make a wrapper widget in pyFormex to easily use this.
This widget can also be included in the pyFormex main window, or
inside a dialog.

Benedict Verhegghe <bverheg>
Project Administrator
Wed 27 Mar 2013 03:00:19 PM UTC, comment #2:

This problem is (probably)related to different versions of PyQt and other python modules:

from PyQt4.QtCore import QString
-works pyFormex-SVN this works
-works without pyFormex (on a terminal/python)
-it does not work on pyFormex GIT

I found the problem on internet:

http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinG%2ByCwX8gF%3DYszCr6P0XGf%3DCWsK-tX51v03psa%40mail.gmail.com&forum_name=matplotlib-users

So, the problem seems not be pyFormex or pylab related.

gianluca de santis <gianlucadesi>
Project Member
Tue 26 Mar 2013 04:00:07 PM UTC, comment #1:

I get an all white image.

This is not a pyFormex problem though: your script does not use anything pyFormex (except for the exit()). I ran the script from plain Python, with exactly the same result. So it is a pylab/matplotlib problem.

Benedict Verhegghe <bverheg>
Project Administrator
Tue 26 Mar 2013 03:22:45 PM UTC, original submission:

matplotlib is not working on my laptop with pyFormex (GIT version) but it works if I use the latest SVN version of pyFormex.

Could you run this script on your machine and check if the file test.png is correctly saved?

#!/usr/bin/env pyformex --gui
from pylab import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.text as text
chdir(_file_)
x1=range(4)
y1=range(4)
fig = plt.figure()
plt.plot(x1,y1)
show()
savefig('test.png')
exit()

Thanks
Gian

gianluca de santis <gianlucadesi>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by gianlucadesi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Nov 2013 07:03:23 PM UTCbverhegOpen/ClosedOpen=>Closed
    Tue 26 Mar 2013 04:00:07 PM UTCbverhegStatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1