Matlab exits unexpectedly after simple plot
Mostrar comentarios más antiguos
Edit: I have submitted this as a bug. I got suggestions for workarounds, but the problem remains.
My goal is to make some scatterplots with large numbers of points (10^4 ish) and have two of these plots in one figure side by side.
I had problems with MATLAB quitting when creating this plot, and reduced the problem down to the following example.
% This script quits when attempting to print
% We will create a bunch of points (here on a meshgrid) and either plot a point there or not based on a random function v.
N = 200;
xx = linspace(0,1,N);
yy = xx;
[x,y] = meshgrid(xx,yy);
v = rand([N,N]);
bool = (v<0.01);
bool = bool(:);
fig = figure();
a1 = axes('position',[0,0,1,1]);
scatter(x(bool), y(bool), 10);
print('-dpng', 'testpic')
Some things that FIX the problem:
- Remove the explicit axes creation. However, I want this ability, since I want to place two axes next to one another.
- Don't print. However I need to print.
- Reduce the number of points. However, I can't be limited to 10^2.
- Modify the axes position to [0.1, 0.1, 0.8, 0.8].
I look forward to your collective insight.
John
2 comentarios
Matt Fig
el 18 de Nov. de 2012
Please include the MATLAB version number and the OS of your system (Ex. Windows 7 64-bit).
version % Show what this command returns
John Mahoney
el 22 de En. de 2013
Respuesta aceptada
Más respuestas (1)
Arsalan
el 18 de Nov. de 2012
0 votos
Hi,
I am quite new to Matlab. you are saying that the plotting works by reducing the number of points, thus I can imagine that your PC might not have enough memory to process and store larger set of data points, try freeing up some of the programs which might be running on the background on the RAM as well as process which you are not using, and try again with points quite higher then 10^2 that did not run in the normal case. If it works then you don't have enough memory
Arsalan
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!