Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plot window not responding

I'm using Windows 7 64 bit. Each time, I'm using plot function, plot windows will shows and draws successfully, but after that it stops responding and must shut down it.

For example :

x = linspace(0,1,10) y = x.^2 plot(x,y); 

Strangely, when plot windows freeze and I must close octave windows, they will be unresponsive too. This will not happen if I don't use plot function.

I don't know why. Does it because I'm using 64 bit version? Please tell me how to fix this.

like image 461
hqt Avatar asked Aug 20 '12 05:08

hqt


People also ask

What is a plot window?

A plot window is the area used for creating and modifying graphs.

What is TkAgg backend?

With the TkAgg backend, which uses the Tkinter user interface toolkit, you can use matplotlib from an arbitrary non-gui python shell. Just set your backend : TkAgg and interactive : True in your matplotlibrc file (see Customizing matplotlib) and fire up python.

How do you stretch a plot?

To stretch or shrink the graph in the y direction, multiply or divide the output by a constant. 2f (x) is stretched in the y direction by a factor of 2, and f (x) is shrunk in the y direction by a factor of 2 (or stretched by a factor of ). Here are the graphs of y = f (x), y = 2f (x), and y = x.


2 Answers

The problem is likely to be the graphics toolkit which your installation of Octave is using.

To check this, type graphics_toolkit in the Octave command line.

If the response is fltk and your plot window is freezing, then switch the default toolkit to gnuplot: graphics_toolkit('gnuplot')

Test that the problem is fixed: x=1:10; y=x.^2; plot(x,y)

Make the change permanent in your octave.rc file, located in your Octave installation directory:

    On Windows:  \Octave\share\octave\site\m\startup\octaverc     On Linux:     ~/.octaverc 


Still not working?
  • If response is qt, try either fltk or gnuplot (one may be faster than the other).

  • If the above does not work, you may need to install/re-install gnuplot. (thanks to lukas and saurabh for this edge case).

like image 140
Assad Ebrahim Avatar answered Sep 20 '22 20:09

Assad Ebrahim


As Assad Ebrahim wrote, the problem is with the toolkit. I got another problem in version 3.8.2. that the gnuplot didn't work at all. No plot windows showed and a I needed to close Octave. If someone have the same problem, the solution is to download gnuplot and install it to Octave folder. It replaces old gnuplot and the new one is working.

And I thank you for the advice.

like image 42
lukas Avatar answered Sep 19 '22 20:09

lukas