Comments (8)
If you just want to block, why not do:
print("Hit <enter> to continue")
readline()
But it would be nice to provide a way to load PyPlot in non-interactive mode. (As I said on StackOverflow, if you just want non-interactive mode you could always @pyimport matplotlib.pyplot as plt
directly...most of reason for PyPlot is to provide interactive graphics and IJulia integration. But you lose a few niceties of PyPlot that way.)
from pyplot.jl.
On a similar note.
I have a long running simulation and I would like to periodically update a Figure to show the progress of certain variables. Currently only the last plot will be updated and I also don't want to block.
My code looks like this
while t < largeNumber
do calculation
if t % interval
plot([1:largeNumber], variable)
end
t += 1
end
Adding draw add the end of the call doesn't force an update.
from pyplot.jl.
Have you tried calling yield() occasionally so that the GUI event loop can run?
from pyplot.jl.
Thank you that was exactly what I needed
from pyplot.jl.
Any ideas how one could do that without yield? It seems to have pretty big performance penalty in my case attached to it. According to IProfile a quarter of my program runtime is spent waiting on yield.
It would be great if one could run the pyplot updates async to the main task.
from pyplot.jl.
Don't yield
on every iteration of your inner loop. Just yield every 50ms or so.
from pyplot.jl.
@pyimport matplotlib.pyplot as plt
to get non-interactive mode is quite useful for batch processing of data. would be great to have this documented. what "niceties" of PyPlot are lost by doing this?
from pyplot.jl.
@bjarthur, you lose the more Julian style of just typing plot
(or PyPlot.plot
) rather than having to qualify everything with plt.
, the LaTeXStrings import, the colormap conversions, some improved consistency of array-dimensionality handling, etc.
It should be straightforward to modify PyPlot to check the isinteractive()
function to see if Julia is running in non-interactive mode, and if not then to initialize the pyplot module in non-interactive mode (skipping all of the GUI event-loop stuff), if anyone wants to take a crack at it.
from pyplot.jl.
Related Issues (20)
- Layer-backing can not be explicitly controlled on 10.14
- ticks = {Matrix} scuttles plot drawing HOT 3
- Error in Mac M1 HOT 2
- PyPlot does not display x and y coordinates
- __version__ not found when using PyPlot HOT 3
- twinx() and fgcolor issue HOT 2
- PyPlot Error
- Using PyPlot on CI suddenly fails HOT 1
- No working GUI backend found for matplotlib HOT 5
- unrelated println statement leads to blank plot
- getp not defined? HOT 1
- The show() method doesn't seem to work. HOT 2
- Window requires focus before functions return HOT 4
- Using the backend :qt not working HOT 1
- using PyPlot hangs/kills julia 1.8.5 or 1.9.0 on MacOS HOT 4
- Unable to install PyPlot (ResolvePackageNotFound conda error) HOT 2
- PyPlot.jl as a dependency breaks package registration? HOT 4
- ResolvePackageNotFound error in Ubuntu/Linux HOT 3
- `using PyPlot` crashes package precompilation on Julia v1.10.0-beta1 HOT 4
- Need a new release (Julia 1.10 PkgEval) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyplot.jl.