PyQt and matplotlib - qt

I call a matplotlib function plt.show() from an PyQt application. I always have the warning:
QCoreApplication::exec: The event loop is already running
It seems that matplotlib called a new QCoreApplication which is already started
How can I do to remove this warning?
Thanks

If you are not generating multiple plots, the easiest way around is to use plt.ion() before you initialise the figure. Remove plt.show()

I ran into similar problems. The root cause is that your PyQt application uses Qt (which is of course obvious). But the matplotlib figure you're trying to make, also uses Qt. You know, the matplotlib figure has its own window, which originates from Qt. So there is a conflict.
Approach 1
There are several ways to solve it. One approach is explained here:
Matplotlib animation inside your own PyQt4 GUI
The link refers you to a stackoverflow question I've put online some days ago. I was trying to start a matplotlib animation from my own PyQt application.
Approach 2
The second approach is explained here:
Cannot move Matplotlib plot window and exit it using red X button
I hope this helped you out. If you've got any questions, don't hesitate to ask me. I'm happy to help.

Related

Xamarin.mac Draw a graph

I am getting quite desperate with this, having searched the internet for several days no one seems to have ever tried to draw a graph using xamarin.mac, which i find very hard to believe ! I cannot install core plot, oxy plot etc, because of a bug with the installer, trying to install either gives:
"Could not install package 'xamstore-coreplot 1.4.0'. You are trying to install this package into a project that targets 'Xamarin.Mac,Version=v2.0', but the package does not contain any assembly references or content files that are compatible with that framework."
or equivalent.
Can someone please either help me fix the above error, or help me draw a graph in xamarin.mac using core graphics or something ? I really only want to plot a line graph from a set of points, i didn't think it would be that hard !
Thanks in advance !
That error is stating the fact that there is no mobile (Xamarin.Mac, Version=v2.0) build of the library. If there is a "desktop", but you might be able to swap the target framework of your project.

Scilab Making GUI

How to use two functions in Scilab 5.5 GUI Building? For example, If I want to add and substract two numbers choosing a popupmenu option and execute it with a pushbutton option. Please reply, I am new in Scilab.
As a starting point I recommend to read tutorial about GUIs in Scilab.
for example, this

How Can use the Wxwidgets for plotting?

I am working as researcher at University of Genoa in Italy. I am using the C++ during my work at this Univeristy (I am new in using Visual C++). I would like to know "How can use Wxwidgets library to plot two columns from Matrix that includes on 4 columns?"
From another side, If there in any documentions that relate with Wxwidgets library that should help me to understand "How can I make plotting??", please send me the links for these documentions....
Thank you very much
There is no support for plotting in wxWidgets.
There is however number of libraries you can use located here.
One of them is wxFreeChart last updated 2010 (and so no problem with wx 2.8). SVN Version seem to show some life so its your best bet!
See the answers to this question. wxFreeChar is probably the most promising of the libraries mentioned there and should allow you to plot just about anything (I'm really not sure about what do you mean by plotting matrix columns...).

Plot not defined with Julia

I compiled Julia 0.1 from the source code on my Ubuntu 12.04. It is my first time try with Julia actually.
The compilation got through to the end with no problem but some warnings.
When I try to execute the plot command , here comes the problem,
julia> plot(x->sin(x^2)/x, -2pi,2pi)
ERROR: plot not defined
Did the compilation go wrong somewhere or Do I have to install extra package to plot in Julia?
Thanks
The web-based graphics are outdated and unmaintained (though there's work in progress to get the next generation of web graphics working). Plotting alternatives include the Winston or Gadfly packages at https://github.com/nolta/Winston.jl and https://github.com/dcjones/Gadfly.jl which you can install simply using the Pkg.add("Winston") (or Pkg.add("Gadfly") commands). For documentation and usage examples please refer to the linked repositories.
For MATLAB-style plotting under Julia, type once
Pkg.add("PyPlot")
to install the PyPlot package, which gives you access to Python's matplotlib library. Then try e.g.
using PyPlot
x = -2pi:0.1:2pi;
plot(x, sin(x.^2)./x);
OK I found the solution myself,
Julia uses a web REPL to provide some basic graphics capabilities. Just have to follow the steps here:
https://github.com/JuliaLang/julia#web-repl
Julian Schrittwieser also has a library based on MathGL:
http://www.furidamu.org/blog/2012/02/26/plotting-with-julia/
I am not sure whether it is still under maintenance by the author.
As of right now (a few years passed since the question was asked so the ecosystem has matured), the package I would suggest for easy quick plots would be Gadfly, with some use of PyPlot for publication quality graphs that require a lot of control.
To install, just type
Pkg.add("Gadfly")
in a Julia command line, and to use, type:
using Gadfly
plot([sin, cos], 0, 25)
PyPlot is still the preferred plotting option for when you want a lot of control over your graphs, but it is a wrapper for a Python library and is slightly less user-friendly. It also requires a working python install on your system.

Using Protovis with R

As question, I have satisfied with what R and ggplot2 can do for static graph, but what about interactive graphs? How combine R and Protovis to make the graphs?
There is somethings called rwebvis but seems it is no longer active.
Any suggestion? Thanks.
Well, first you need a web server. Ooh, R has one of those now. Then you need some way of generating output on the web from R code - ooh, R has one of those too:
http://jeffreybreen.wordpress.com/2011/04/25/4-lines-of-r-to-get-you-started-using-the-rook-web-server-interface/
So you can then write R server pages that return JSON-encoded data that you can feed to Protovis - or if you want to get right up to date, to D3, which is Protovis++ and made of win.
Iplots is a fairly useful package that allows interactive graphing ( by this I mean selection linking between graphs, color linking, etc). It has some limitations and is not really made for producing plots as much as exploring data trends.
Acinonyx also was recently updated which is supposed to be an updated version of iplots, but from what I can tell it still has some work to do.
Not familiar with protovis or rwebvis.
There is a package from google called googlevis that enables some interactivity. This produces plots that are embeddable online. If you like protovis, the same author has another library called D3.
For running R on a webserver, I have been experimenting with RApache, which enables you to link your R installation to an apache server.
If the interactivity does not to be online, RStudio have a package called manipulate which may also be of interest.

Resources