Author Topic: Strange GUI behaviour  (Read 13373 times)

0 Members and 1 Guest are viewing this topic.

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Strange GUI behaviour
« on: December 4, 2009, 16:11 »
When following some of the available tutorials for VNL 2008.10 I came across several strange things that are happening in the VNL GUI:
1. I use a dual-screen setup on my Linux system, and somehow VNL doesn't correctly detect my screen size and makes the fonts huge. This really scrambles the VNL GUI. It doesn't prevent one from working with the program, but it is rather annoying. Is there something that can be done to make VNL detect my display settings correctly? Or is this a nVidia bug.
2. I did part of the graphene tutorial form the website and when I display the results from the transmission spectrum in the result browser the figure is horrible. The transmission axis only runs from 0 to 1, while the actual transmission can be as large as 4 as indicated in the tutorial. Is there a way to rescale the plot? All that the result browser seems to allow is zooming in and out... which is rather limited. Is there a way to expert the plot data so that I can edit it in, say, SigmaPlot?

Some system details:
openSUSE 11.2 x86-64 running KDE 4.3.1
nVidia twinview

See the attached image for a screenshot of the program.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Strange GUI behaviour
« Reply #1 on: December 4, 2009, 16:48 »
Not sure what to do about the font size... can only hope it's solved in VNL 2009.11.

As for zooming, you can always zoom (in) by drawing a rectangle with the mouse. So, zoom out until all the data is visible, then zoom in on the area you want.

You can always export the data by either taking it from the log file, although sometimes it has a bit too few decimals; see this post regarding how to get around that. In 2009.11 we have improved the export capabilities quite a bit, you can export data from a plot directly.
« Last Edit: December 4, 2009, 16:57 by Anders Blom »

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #2 on: December 7, 2009, 11:36 »
Not sure what to do about the font size... can only hope it's solved in VNL 2009.11.
It is :).

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Strange GUI behaviour
« Reply #3 on: December 7, 2009, 14:45 »
If you tell me your system, I might be able to tell you how to set the font size manually.

It will use the global Qt-fontsize, and this is possible to set in most linux systems.

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #4 on: December 7, 2009, 16:23 »
What exactly do you need to know for this?

I'm using the openSUSE 11.2 64 bit distribution, with a 2.6.31.5 kernel and KDE 4.3.1. The system is a 3 GHz Core 2 Duo E8400 with 4 GB memory and nVidia Quadro FX1700 videocard.

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #5 on: December 8, 2009, 17:13 »
I've found a new issue. When I try to use the pylab package to create figures from the graphene tutorial for ATK2009.11 it appears that the default backend (agg) doesn't support the show() command. However, when I try to switch to another backend it seems that only the agg backend is installed in the nlpython distribution. Is there a way to add for instance pyGTK or pyQt to the python distribution used in ATK2009.11 to enable the pylab.show() command? Or is there already a working backend available which does this?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Strange GUI behaviour
« Reply #6 on: December 8, 2009, 17:28 »
Works for me (Ubuntu 9.10). Might depend on precisely what you're trying to do. Try this:
Code
import pylab as P
P.figure()
P.show()
just to see if you get a blank plot window. If you do, all should be ok, actually.

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #7 on: December 9, 2009, 09:52 »
First two command give no errors, the output of the second is <maptplotlin.figure.Figure object as 0x1612510> However after executing the P.show() command I get the following error:
Code
/home/sten/bin/VNL/atk-2009.11/nlpython/lib/python2.6/site-packages/matplotlib/backends/__init__.py:41: UserWarning:
Your currently selected backend, 'agg' does not support show().
Please select a GUI backend in your matplotlibrc file ('/home/sten/bin/VNL/atk-2009.11/nlpython/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc')
or with matplotlib.use()
If I now try another backend, for instance Qt4Agg I get the error that Qt4 libraries should be installed. They are installed for my local Python distribution, but VNL seems to use its own.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Strange GUI behaviour
« Reply #8 on: December 9, 2009, 10:22 »
Yes, ATK uses its own Qt, you cannot (and must not) use some other Qt with ATK. agg is really just for piping the output to a file, so it will not work with show() (although it shouldn't give error messages, just not do anything). The backend to use for show() is TkAgg. On my Ubuntu that seems to work as default, but perhaps you can try
Code
import matplotlib as mpl
mpl.use('TkAgg')
import pylab as P
P.figure()
P.show()
If it doesn't work, please post the exact error message. ATK comes with all backends provided, so it's not a matter that they are missing; check the contents of atk-2009.11/nlpython/lib/python2.6/site-packages/matplotlib/backend. However, most of them require additional packages, so only TkAgg and Agg (and pdf, ps, svg and other file format exports) are enabled out of the box. Make sure you haven't modified any files in the installation tree. Also, there might be some conflict with environment variables...

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Strange GUI behaviour
« Reply #9 on: December 9, 2009, 10:24 »
If you edited the matplotlibrc file, please restore it from the installation package.

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #10 on: December 9, 2009, 11:54 »
It now gives an error after the import pylab command:
Code
>>> import matplotlib as mpl
>>> mpl.use('TkAgg')
>>> import pylab as P
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./build/nlpython/lib/python2.6/site-packages/pylab.py", line 1, in <module>
  File "./build/nlpython/lib/python2.6/site-packages/matplotlib/pylab.py", line 247, in <module>
  File "./build/nlpython/lib/python2.6/site-packages/matplotlib/pyplot.py", line 78, in <module>
  File "./build/nlpython/lib/python2.6/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
  File "./build/nlpython/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 7, in <module>
  File "./build/nlpython/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
ImportError: No module named _tkinter

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Strange GUI behaviour
« Reply #11 on: December 9, 2009, 12:17 »
Let me double-check a few things.

Do you have the 2009.11.1 package (and not 2009.11)?

What does locate _tkinter give, when executed in $HOME?

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #12 on: December 9, 2009, 15:35 »
It is the 11.1 package. The locate command returns this:
Code
/home/sten/bin/VNL/vnl-2008.10.0/atk/lib/python2.4/lib-dynload/_tkinter.so
/windows/C/Program Files/Corel/Corel Paint Shop Pro X/Python Libraries/DLLs/_tkinter.pyd
/windows/C/Program Files/Scribus 1.3.3.13/dlls/_tkinter.pyd
I checked the tarball to check if I didn't delete the file accidentally and couldn't find the file _tkinter.so in it.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5429
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Strange GUI behaviour
« Reply #13 on: December 9, 2009, 15:48 »
There should be a _tkinter.so in atk-2009.11/nlpython/lib/python2.6/lib-dynload (and one in atk-2009.11/vnl/lib/python2.6/lib-dynload too). But I can verify that it's missing from the 64-bit package! Ouch...!

I'll see how quickly we can fix this. For now, you can use the 32-bit package instead; only difference is really performance, and it's not critical for the tutorial examples.

Sorry!

Offline svollebregt

  • Heavy QuantumATK user
  • ***
  • Posts: 28
  • Reputation: 0
    • View Profile
Re: Strange GUI behaviour
« Reply #14 on: December 9, 2009, 17:46 »
Okay, new problem when using the 32 bit version. The file is found, but now ATK searches for the tcl/tk system. I installed this using YAST, however the current release is version 8.5. As the shared libraries ATK uses are hard coded it searches for libtk8.4.so.0... which of course doesn't exist as the current tcl/tk release is at 8.5. So far my attempts to get tcl/tk 8.4 working under openSUSE have not been successful... is there a way to tell ATK that it has to look for version 8.5?