Problems with plotting.
이전 댓글 표시
I cannot get functions such as hold on or grid on to properly work. I'm just trying to do a simple exercise where I type:
plot(1,1.5,'o')
hold on
plot(2,2,'*r')
axis([-1,2,0,3])
grid on
I tested this with the online edition and it works as it should, but I'm running into problems with my installed copy. Whenever I execute a line the plot pops up but nothing is saved. First line works fine, when the line 'plot on' is executed a blank plot pops up. When the third line is executed it only shows that plot, and does not include the first line plot. The axis line will show a blank plot with the correct axis scale. The 'grid on' will result in a blank plot with the grid showing, if I run another plot line afterward, the grid will not be showing anymore. I had 2018a installed, and then tried installing 2019b to see if that would fix the issue but still no luck. Not sure if it would make a difference but using education license.
댓글 수: 12
I suppose you've already tried the expedients of clear all and restarting Matlab...
Have you had a local installation of any earlier release that doesn't show the symptoms on the same machine/OS?
Is the institution education license or personal on a given machine? What OS?
Might see what happens if change the graphics renderer to 'software' and see if perhaps the graphics card is the culprit, maybe. Updating the video drivers to latest release from the vendor is always a thing to try...
dpb
2020년 1월 12일
Reread the text...I'm presuming it's just a typo but you say "...when the line 'plot on' is executed a blank plot pops up." That's what I'd expect with an error on syntax for that command if that's what actually do try to execute. The code snippet includes what I think is intended hold on, but just in case make sure you didn't/aren't mistyping what you really intended.
If it isn't something like that, is this a personal or institutional machine you're running on? It sounds like may need someone from the IT group who handles the institutional license to contact installation support if they can't solve it. If it's your machine, I'm not sure how that works for support...TMW does support installation issues gratis; you can try that route if IT can't/won't help.
EC
2020년 1월 12일
Sindar
2020년 1월 12일
there's a chance you have some weird startup behavior set. try
edit startup
and see if there's anything in there
EC
2020년 1월 14일
That really does sound like something funky going on in the video drivers/chipset arena...
What happens with
clear all
plot(rand(10,1))
followed then by
close all
plot(rand(10,1),'o-b')
hold on
plot(rand(10,1),'x-r')
?
I presume you get no error messages from Matlab, just not the expected plot results?
EC
2020년 1월 14일
dpb
2020년 1월 14일
Oh, sorry for the typo...good catch on missing comma.
You mean simply typing one instruction line at a time in the command window does not result in the same figure?
In that case, if so, never heard of such a thing before, but makes sound as though something is wrong with the keyboard buffer/input...
I gather this is a laptop or other portable device, not a desktop? What is the environment?
EC
2020년 1월 14일
dpb
2020년 1월 15일
Try
close all
plot(rand(10,1),'o-b')
hAx=gca; % retrieve current axes handle
%hold on % let's go lower level...
hAx.NextPlot='add'; % what hold on does; "off'--> 'replace'
plot(rand(10,1),'x-r')
Oh...maybe the hold function has somehow gotten corrupted...what does
which -all hold
return?
Or, before the above, one more check...try
close all
hAx=axes; % create a new axis, save handle
hAx.NextPlot % see initial state of hold
plot(rand(10,1),'o-b')
hold on
hAx.NextPlot % and afterwards
to see what hold actually did. Report on results.
EC
2020년 1월 28일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!