Matplotlib widget in Qtdesigner - pyqt

I am using Qtdesigner3 to write a python gui that will read data files do some math and then plot the results using matplotlib. I've looked at examples of matplotlib qt, but none of them use the designer.
My question is how do I create a matplotlib widget in the QTdesigner?

There is a better response to almost this exact question over at the pythonxy mailling list
http://groups.google.com/group/pythonxy/browse_thread/thread/c52424bf11328181?pli=1
To quote the salient point from the thread. This is from one of the lead developers of the project.
You may directly use the Matplotlib Qt Designer plugin which is
shipped with Python(x,y).
It is located here: "C:\Python26\Lib\site-packages\PyQt4\plugins
\designer\python".
On your linux machine, create an environment variable called
PYQTDESIGNERPATH, and set it to the directory containing
'matplotlibplugin.py'. That's all!

Python(x,y) has a matplotlib widget that can be used in Qt Designer. If you don't want to install Python(x,y), you can follow the instructions at this tutorial to create your own.

Related

How can Pycharm (with matplotlib) show me my graphs in the same Py charm, next to my code?. Not in additional windows

i am using Matplotlib with Pycharm in a Mac osx. When I am making a graph, and I code plt.show() pycharm opens another window. And if there is 2 graphs, to see the 2nd one I have to close the first one. And I want to see both together.
There is a option to show the two graph in the same window, where my code is?
Thanks very much.
This link may help:
IPython magic commands
Using Jupyter notebooks you can achieve what you want by using %matplotlib inline. It seems from the link above that PyCharm may have some way to enable this same functionality.
See also: Inline plots in the scientific view

Installing pyQt QWebKitWidget

Can someone please clarify what is QWebKit? I told it was just another widget from PyQt that allows to show webpages inside a gui.
Then I understood that with PyQt5 it doesn't come installed with PyQt anymore and I am not sure where to find it or how to install it on MAC.
I want a simple interface that changes the information shown in a page. I struggle to layout those information with the common PyQt widgets, so if I can relate all that to a simple HTML page to be shown inside a PyQt QWebView (with no CSS limitations) that would be great
Apparently QWebKit was deprecated on Qt5.6 or Qt5.7 (can't remember).
The continued version of that tool and API calls is QtWebEngine and I guess what you want is QtWebEngineWidgets.QWebEngineView()

GTK+, GLADE, PYTHON 3.6 Windows

I am an Electrical engineer. I am completely new for programming and coding..
Actually i am working as estimation engineer, where i am doing the same estimation again and again with excel.
As same in design stage also i am doing the same again and again.
I thought i will create a application which will automatically do the estimation based on my input. and the same time at the time of design stage it will input from my estimation sheet it will generate the drawing automatically.
(i am doing estimation in excel, preparing drawing in auto cad)
from google, i found the following..
To write a program I need to know a language. so i selected python version 3.6.1
To create a stand alone or micro soft windows installer i selected cx freeze which is converting my code to .exe filex
To create a user interface i selected glade.
But i dont know how to install gtk builder to link pythin code and glade files.
Hopefully you got the point what i am looking..
I am using windiws 10 with 64 bit version
Advance thanks for all
All the information you need on how to install GTK+ and Glade on Windows is on the GTK+ Website.
However, If you're a total beginner, then I suggest you start small, as the kind of work you're describing seems a lot of work for someone who has never written a single line of code.
As suggested by #liberforce, install GTK+ and Glade on Windows from their GTK+ Website. This way you will have an environment (MINGW64) inside which you can practice.
Install python from their download site.
Check also these instructions for how to use it.
The key points (at least for me) are:
Copy the hello.py script you created to C:\msys64\home\<username>
In the mingw32 terminal execute python3 hello.py - a window should appear.
After that, if you want to make an executable, follow these instructions. Try their example for gedit to get some ideas on how to create and how PKGBUILD works (a.k.a. follow the instructions for gedit to see what's happening).

bad screen distance

I'm trying to obtain an figure object (using matplotlib), inside a wxpython application. I don't need to plot (or see) the figure, because I would want only to save it in a png file.
When I do it using Windows XP, it is all okay, if I do it outside the wxpython application, for example inside sphinx documentation, it's all okay again.
But If I do it inside my wxpython application... something goes wrong and it raises this:
_tkinter.TclError: bad screen distance "320.0"
Has someone any idea about?
Since you're trying to use wxPython and getting tkinter errors, you probably haven't told matplotlib to use wx. This can either be done in the matplotlibrc file, or in the program. Instructions are here.

GTK/Qt On PLT Scheme

When you compile something written in PLT Scheme on Linux that have a GUI the final will be in a grey(default) theme of Linux, but I want to know
If it's possible to integrate PLT Scheme with GTK or Qt?
How to do this?
Example of grey(default) theme:
Grey Theme Frame http://i.imagehost.org/0219/gui.png
Thanks.
The Linux version of PLT is based on an old fork from wxWindows (from before it was renamed to wxWidgets). There is work going on to eventually replace all of the C and C++ code with Scheme code, and also move from a raw X backend to using gtk. Until this is done (which might take a while), the best thing to do is to stick with the usual mred-based code; this way it will continue to work fine when the switch is done -- and you still keep the advantage of portability (since it behaves the same on Windows and on OS X too).

Resources