Hello,
I am running a script in my computer where any scatter plot turns up empty. I have run the same script in another computer where it had no problem so there is no error in the cod to cause this.
Does anyone have any idea what might be wrong? I am using Matlab 2017a.
Thank you!

댓글 수: 5

Jan
Jan 2018년 5월 22일
There is no chance to guess the reason. Please provide more details, e.g. a piece of code which reproduces the problem.
You might have redefined a function. If you have e.g. a user-defined file called "scatter.m" in your Matlab path, which does nothing, the different behavior would be explained.
Have you try setting a breakpoint on any of the scatter call and seeing what values it is given?
Does a very basic scatter produces a plot on your machine, e.g.
scatter([1 2], [1 2])
Ioanna Saxoni
Ioanna Saxoni 2018년 5월 22일
I have tried the simplest scatter plot possible in the command line:
aa=[1 2 3]; bb=aa; scatter(aa,bb);
And it still gives me a blank window.
The funny thing is that I have already run the exact same script in another pc and it run perfectly! So I don't believe it is code related. Maybe it is version related?
OCDER
OCDER 2018년 5월 22일
편집: OCDER 2018년 5월 22일
Does this work by any chance?
scatter([1 2 3], [1 2 3]);
set(gcf, 'renderer', 'painters')
Ioanna Saxoni
Ioanna Saxoni 2018년 5월 22일
Yes it does! Thank you very much!
Would you mind explaining what renderer does?Why did it work now?

댓글을 달려면 로그인하십시오.

 채택된 답변

OCDER
OCDER 2018년 5월 22일

0 개 추천

scatter([1 2 3], [1 2 3]);
set(gcf, 'renderer', 'painters')
Sometimes there's a bug that prevents the graphics card from properly drawing the figures generate by Matlab via the OpenGL renderer (default). It's been an on and off bug for a while:
You could use this to set the default renderer for all figures generated:
set(0, 'DefaultFigureRenderer', 'painters')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

질문:

2018년 5월 22일

답변:

2018년 5월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by