question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

model.plot() not working

See original GitHub issue

Not sure if this is an actual issue or if I am doing something wrong, but I can’t seem to get model.plot() working.

I have the following code, where the times and years variables contain some olympic data.

kernel = GPy.kern.rbf(1, variance=1, lengthscale=1)
model = GPy.models.GPRegression(times, years, kernel)

model.plot()

A separate window which should contain the plot does open, but closes instantly, without displaying anything.

Any ideas as to why this is happening?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Christian-Bcommented, May 27, 2015

I had the same issue. The fix: matplotlib.pylab.show(block=True) Worked fine and the above explanation is a valid one.

Too bad I had to google to find this issue as the documentation does not work outside of ipython.

1reaction
mzwiesselecommented, Jul 2, 2014

Plotting in matplotlib is a daemon task. Thus, when the plot shows up, it gets drawn, but the main python process is done. This makes the program (python process) stop.

You need to stop the python program to close. The block=True argument does exactly that. ipython does it as well. That is why your code behaved as it did.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with plot_model in keras and pydot - Stack Overflow
I solved it with. sudo apt-get install graphviz.
Read more >
Resolved: Matplotlib figures not showing up or displaying
In this blog post I detailed how to resolve a pesky issue where matplotlib figures are not displayed to your screen. Symptoms of...
Read more >
How to use plot model in keras? - Data Science Stack Exchange
I'm trying to draw the keras model with the plotmodel. ... You must install pydot and graphviz for pydotprint to work.
Read more >
Pyplot tutorial — Matplotlib 3.6.2 documentation
Working with multiple figures and axes#. MATLAB, and pyplot , have the concept of the current figure and the current axes. All plotting...
Read more >
6 Work with models - Data Visualization
The geom_smooth() function can take a range of method arguments to fit LOESS, OLS, ... The result is a single plot containing not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found