Plot does not pop up?

Hi all,
I am having a weird problem with Matlab that I have never experienced before, and have no idea what the underlying reason could be because it does not generate any error at all.
Basically I try "plot(1,2)" and nothing happens, no figure pops up. However, the command line is kept busy, as if the code enters into an infinite loop. I am using 64 bit Linux and 2014b. I would really appreciate if somebody could direct me towards the solution or give an idea about what the problem could be.
Thanks,

17 Comments

Does this work:
plot(1:10)
Nope. The same. It got stuck.
I'd check to see if there is another function accidentally called plot() that is being used instead of the built-in matlab function. i think the command to do this is:
which plot -all
which will return all instances inside the search path for plot. All instances should be located in the matlab install path + whatever tool boxes are installed. If there is an offending item not from matlab, i'd remove (save a backup because unless someone did it as a joke it was done for a reason).
~J
OK, here is the output. It does not seem to be the case to me.
>> which plot -all
built-in (/usr/local/MATLAB/R2014b/toolbox/matlab/graph2d/plot)
/usr/local/MATLAB/R2014b/toolbox/matlab/timefun/@duration/plot.m % duration method
/usr/local/MATLAB/R2014b/toolbox/matlab/timefun/@datetime/plot.m % datetime method
/usr/local/MATLAB/R2014b/toolbox/matlab/polyfun/@alphaShape/plot.m % alphaShape method
/usr/local/MATLAB/R2014b/toolbox/wavelet/wavedemo/@wvtree/plot.m % wvtree method
/usr/local/MATLAB/R2014b/toolbox/wavelet/wavedemo/@rwvtree/plot.m % rwvtree method
/usr/local/MATLAB/R2014b/toolbox/wavelet/wavedemo/@edwttree/plot.m % edwttree method
/usr/local/MATLAB/R2014b/toolbox/ident/ident/@iddata/plot.m % iddata method
/usr/local/MATLAB/R2014b/toolbox/ident/nlident/@idnlhw/plot.m % idnlhw method
/usr/local/MATLAB/R2014b/toolbox/ident/nlident/@idnlarx/plot.m % idnlarx method
/usr/local/MATLAB/R2014b/toolbox/finance/ftseries/@fints/plot.m % fints method
/usr/local/MATLAB/R2014b/toolbox/robust/rctobsolete/robust/@frd/plot.m % frd method
/usr/local/MATLAB/R2014b/toolbox/comm/comm/@channel/plot.m % channel method
/usr/local/MATLAB/R2014b/toolbox/signal/signal/@dspdata/plot.m % dspdata method
/usr/local/MATLAB/R2014b/toolbox/wavelet/wavelet/@wdectree/plot.m % wdectree method
/usr/local/MATLAB/R2014b/toolbox/wavelet/wavelet/@ntree/plot.m % ntree method
/usr/local/MATLAB/R2014b/toolbox/wavelet/wavelet/@dtree/plot.m % dtree method
/usr/local/MATLAB/R2014b/toolbox/bioinfo/bioinfo/@phytree/plot.m % phytree method
/usr/local/MATLAB/R2014b/toolbox/bioinfo/microarray/@clustergram/plot.m % clustergram method
/usr/local/MATLAB/R2014b/toolbox/bioinfo/microarray/@HeatMap/plot.m % HeatMap method
/usr/local/MATLAB/R2014b/toolbox/stats/classreg/@LinearModel/plot.m % LinearModel method
/usr/local/MATLAB/R2014b/toolbox/curvefit/curvefit/@sfit/plot.m % sfit method
/usr/local/MATLAB/R2014b/toolbox/curvefit/curvefit/@cfit/plot.m % cfit method
/usr/local/MATLAB/R2014b/toolbox/mpc/mpc/@mpc/plot.m % mpc method
/usr/local/MATLAB/R2014b/toolbox/matlab/timeseries/@timeseries/plot.m % timeseries method
Try this line
fh=figure;plot(1,2,'d')
Did not work, either. No figure popped up.
Do you have some strange configuration of multiple screens? What does this return?
>> plot(1,2)
>> fh = findall( 0, 'Type', 'figure' );
>> get( fh, 'Position' )
and this
>> get(fh,'Visible')
ans =
on
Yes, there are two screens. I could not do what you suggested (it got stuck at plot), but this may perhaps help?
>> figure; fh=findall(0, 'Type', 'figure'), get(fh, 'Position')
fh =
Figure (1) with properties:
Number: 1
Name: ''
Color: [0.9400 0.9400 0.9400]
Position: [560 528 560 420]
Units: 'pixels'
Use GET to show all properties
ans =
560 528 560 420
A figure seems to be created, but it not displayed. The position looks okay. What does
get(fh, 'Visible' )
say?
R2014b has a new graphic system. I use R2013b. Show all the properties and try to understand if there is a value, which might explain why the figure is not shown.
To be absolutely sure
delete(gcf) % repeat until you are sure there are no figures
and run again
figure; fh=findall(0, 'Type', 'figure'), get(fh, 'Position')
Joseph Cheng
Joseph Cheng on 3 Mar 2015
Edited: Joseph Cheng on 3 Mar 2015
From what i can piece together is:
  1. when you type in "figure()" an empty figure appears (that you can see).
  2. then if you try to plot(), Matlab hangs up and locks up the interface as if it is trying to process a long process. That is why i thought possibly there is another plot function being used but parsing out what you show it doesn't look like it.
Per isakson if Tunc sees the empty figure i'm not sure it's completely a graphics issue.
Tunc, when you plot and it gets stuck, does the ctrl+ 'c' shortcut to break out of what is running work? it should pop up an error in what routine it stopped inside of. maybe that error should be sent to matlab support.
Just curious, does any other graphic functions work? Like surf(), bar(), mesh(), plot3()....
Isakson, no change, still the same parameters were output.
Joseph, what you understood is correct. ctrl+c does not work, so I cannot get any error report. Invoking any other graphic function results in the same situation.
per isakson
per isakson on 4 Mar 2015
Edited: per isakson on 4 Mar 2015
@Joseph, Tunc writes "and nothing happens, no figure pops up" and "Did not work, either. No figure popped up."
@Tunc, I'm might be barking up the wrong tree and I'm a bit lost. You write "the command line is kept busy, as if the code enters into an infinite loop." and "ctrl+c does not work".
  1. How do you bring Matlab out of this condition? Do you restart Matlab by force?
  2. Does figure; fh=findall(0, 'Type', 'figure'), get(fh, 'Position') create a visible empty figure? I assume it does.
  3. Have you checked the cpu (and memory) usage when Matlab is in this "infinite loop condition"? I assume that Linux has a tool similar to Windows Task Manager.
  4. And you have restarted the system? On Windows we solve most weird problems by restarting Windows:-(
  5. "I have never experienced before" Did plot work as expected on R2014b (Linux)? What has changed in your system between "before" and now?
  6. "Invoking any other graphic function results in the same situation." Contact tech-support, reinstall Matlab
1. Only way out is to kill the process.
2. Yes, no problem in generating empty figure windows.
3. The MATLAB process consumes about 80% CPU power and about 400 MB RAM for about 20 seconds. No significant CPU usage afterwards.
4. I surely tried it. I actually tried wiping the OS and re-installing, in case something with the graphical tools got accidentally messed up.
5. Yes. Everything started all of a sudden. The same computer used to work. Probably because of an update?
6. I have already tried a re-install. I will try contacting them.
Thanks for your effort
Bora Ön
Bora Ön on 10 Oct 2016
Edited: Bora Ön on 11 Oct 2016
I had the same problem. However, I've discovered that xorg driver was not properly installed (you can check it by typing "inxi -Fxz").
I re-installed "xserver-xorg-video-intel" (in my case the graphics card is intel) and reconfigured xserver-xorg, and now matlab works properly without softwareopengl option.( link of the solution )
Hope this helps you,
Bora

Sign in to comment.

Answers (2)

Kai-Uwe Storek
Kai-Uwe Storek on 26 Jul 2016

4 votes

Same problem here after last upgrade to Linux 4.6.0-1-amd64 #1 SMP Debian 4.6.4-1 (2016-07-18) x86_64 GNU/Linux.
In addition: "opengl info" (even with -nosoftwareopengl flag) ended with a timeout exception.
Workaround - start matlab with -softwareopengl option.

1 Comment

Same problem in 2016a on latest Arch Linux. It does works with software OpenGL enabled.

Sign in to comment.

CJ
CJ on 15 Jun 2016
I recently had the very same problem. It started after an automatic update on Fedora 23. I may open empty figures but if I (for example) write
peaks(20)
on the command line MATLAB enters "Busy" mode and it is impossible to stop the operation.

3 Comments

@CJ, unfortunately I can neither confirm nor deny that the problem persists in 2016a. My configuration is quite different now. But I never managed to solve it. Good luck.
CJ
CJ on 1 Jul 2016
The problem is reproducible. I reinstalled Fedora (config-4.2.3-300.fc23.x86_64) and when I upgraded to config-4.5.7-200.fc23.x86_64 MATLAB crashes when I try the most basic plot commands.
I did nothing else (except install Google chrome etc.) before I downloaded MATLAB. I.e. I did not install the supported compilers that the installation wizard was prompting for.
MATLAB works fine in every other way.
Walter Roberson
Walter Roberson on 1 Jul 2016
Edited: Walter Roberson on 1 Jul 2016
CJ, which graphics card do you have installed, and which graphics driver version do you have installed?

Sign in to comment.

Categories

Asked:

on 2 Mar 2015

Edited:

on 11 Oct 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!