h = figure(1); % set up a figure
set(h,'Visible', 'off'); % set this figure hide, since I will plot a
lots
....
plot3(x,y,z); % use plot3 to draw my data curve, some other plot
attributes not mentioned here.
....
set(gca,'view',[0, 90]); % view as XY
xlim([x1 x2]); % config X scope
set(h,'Visible','on'); % plotting completed, let it show.
I run this application many times in 2007B, at least 1000, may be
more. And all of them are OK. However, today I run it in 2008A, and a
strange thing occured. That is: The latter part of curve can not be
displayed. For example, I want to plot X-axis from 0 to 5000, it only
shows from 0 to 4010 around. Clicking the 'Pan'(like a hand on figure
toolbar), and then drag the plot to left, then the left part which not
displayed will show.
Someimes, after running my application the first time, and use 'Pan'
to show the unshown part, then I close plot figure and run above
application again, then MATLAB can give me a completed show.
Really very strange and confused, isn't it?
Back to the detailed code, If not config 'Visible' to 'off' when
setting up a figure, then all the thing is OK.
Considering that my application has been OK in MATLAB 2007B, and there
is problem in MATLAB2008A, so I think maybe it is a bug in 2008A. Any
advice will be my pleasure.
Best Regards
mayi
2008-07-06
h = figure(1);
set(h,'Visible', 'off');
x=1:10:5190;
y=sin(x/100);
z=cos(x/100);
plot3(x,y,z)
set(gca,'view',[0, 90]);
xlim([1 5200]);
set(h,'Visible','on');
% Bruno
Best Regards
mayi
2008--7-7
If you have current maintenance, I'd suggest cutting the code down to as
minimum as possible w/ instructions on how to reproduce the symptoms and
submit it to TMW.
However, of course, it could quite possibly be something in your
particular video display/driver, etc., ...
--
I have upload my test code at http://sites.google.com/site/damayi/matlab
There are three files, one file is my code, the other two files are my
figure results.
At the same time, I show my code in the following (the contents is
same as above file). Since that many tab characters in my code, it
seems to be not neat :) I'd like to suggest you get my code at my
personal site mentioned above.
In my computer, when I run 'TestIt.m' the first time, the data curve
does not show completed. And cannot see the full legend. However,
after running it many times, or occasionally, it will show the full
curves and legends.
Best Regards
mayi
2008-7-7
function TestIt()
[Ts yDATA] = LoadData();
FigureHandle = SetupFigure('My Name');
subplot(1,1,1);
AllHandle = DrawZonePlot(Ts, yDATA, 'Time(ms)', 'Y', 'Z', 'Plot my
data', {'A','B','C'});
SetConfigToPlot(AllHandle);
set(FigureHandle,'Visible','on');
return;
function [Ts yDATA] = LoadData()
Ts = [0:5:5000]*0.02/20;
Ts = Ts(:);
WT = 2*pi*Ts;
yDATA = [sin(WT),1.5*sin(WT-2*pi/3),1.8*sin(WT+2*pi/3)];
return;
function SetConfigToPlot(AllHandle)
set(AllHandle.PlotHandle, ...
'LineStyle', '-', ...
'LineWidth', 1, ...
'Marker', '.', ...
'MarkerSize', 6);
LegendStr = struct( 'Interpreter', 'None', ...
'Visible', 'on', ...
'Orientation', 'vertical', ...
'Location', 'NorthEast');
set(AllHandle.LegendHandle, LegendStr);
AxesGridStr = struct('XGrid', 'on', 'YGrid', 'on', 'ZGrid','on');
set(AllHandle.AxesHandle, AxesGridStr, ...
'XAxisLocation', 'bottom', ...
'YAxisLocation', 'left', ...
'View', [0 90]);
return;
function AllHandle = DrawZonePlot(Ts, yDATA, TimeName, yName, zName,
tName, lName)
hp = plot3(Ts, yDATA, zeros(size(Ts)));
set(gca,'XLim', [Ts(1) Ts(end)]);
hx = xlabel(TimeName);
hy = ylabel(yName);
hz = zlabel(zName);
AxesTag = 'TimeX';
ht = title(tName);
hl = legend(lName);
set(gca, 'Box', 'off', 'Tag', AxesTag, 'ButtonDownFcn',
@ClickOnAxes);
set(hp, 'Tag', 'DataLine');
AllHandle = struct( ...
'FigHandle', gcf, ...
'AxesHandle', gca, ...
'PlotHandle', hp, ...
'TitleHandle', ht, ...
'LegendHandle', hl, ...
'XLabelHandle', hx, ...
'YLabelHandle', hy, ...
'ZLabelHandle', hz );
return;
function h = SetupFigure(FigName)
persistent FigNum;
if isempty(FigNum)
FigNum = 1;
else
FigNum = FigNum + 1;
end
h = figure(FigNum);
set(h, 'Visible', 'off', ...
'Tag', 'DataFigure', ...
'ToolBar', 'figure', ...
'MenuBar', 'figure', ...
'DockControls', 'off', ...
'color', 'white', ...
'Name', FigName, ...
'NumberTitle', 'off');
movegui(h, 'center');
return;
I tried your code and everything works fine for me (R2008a, Windows XP). I
would suggest to contact the technical support of The MathWorks who should
be able to help you track down the source of your problem. You will find the
contact information at
http://www.mathworks.com/support/contact_us/index.html
Titus
"damayi" <dam...@gmail.com> schrieb im Newsbeitrag
news:d5f9cff6-6359-47e3...@z66g2000hsc.googlegroups.com...
Thanks for your testing.
My computer is Thinkpad R60(Core2 CPU T5600 1.83G, RAM 3G) and OS is
Windows XP with SP3.
Yesterday, another friend who use MATLAB 2008A, run my code and get
the same result that I mentioned. So I think it is a really bug in
2008A. I hope Mathworks can see this post and resolve it in the next
release version.
Best Regards
mayi
2008-7-12
> Yesterday, another friend who use MATLAB 2008A, run my
code and get
> the same result that I mentioned. So I think it is a
really bug in
> 2008A. I hope Mathworks can see this post and resolve it
in the next
> release version.
>
> Best Regards
> mayi
> 2008-7-12
I downloaded your files and reproduced the "cropped" plot
of your file (1.rar).
With "visible on" throughout the process I get the expected
result.
BTW: Use the end keyword to end functions.
/per
>> ver
MATLAB Version 7.6.0.324 (R2008a)
OS: Microsoft Windows XP Version 5.1 (Build 2600: SP3)
Java VM Version: Java 1.6.0 with Sun Microsystems Inc.
Java HotSpot(TM) Client VM mixed mode
Thanks for your enthusiastic help and your advice.
With your testing result, I am sure that there must be a bug in MATLAB
2008A.
How can I report this bug to Mathworks Team?
My ver infomation is below:
-------------------------------------------------------------------------------------
MATLAB Version 7.6.0.324 (R2008a)
MATLAB License Number: xxxxxxx
Operating System: Microsoft Windows XP Version 5.1 (Build 2600:
Service Pack 3)
Java VM Version: Java 1.6.0 with Sun Microsystems Inc. Java
HotSpot(TM) Client VM mixed mode
-------------------------------------------------------------------------------------
Use
http://www.mathworks.com/support/bugreports/
/ per
> Thanks for your enthusiastic help and your advice.
> With your testing result, I am sure that there must be a
bug in MATLAB
> 2008A.
It seems that the clipping is somehow related to the command
movegui. Instead of calling movegui where it was, I put
movegui right before Visible is set on
movegui(FigureHandle, 'center');
set(FigureHandle,'Visible','on')
(Delete the command movegui in SetupFigure)
Then everything seems fine. Is it a work around?
Bruno
You are so great :) Just now, I modified my code according to your
advice, and I get the correct plot result. Thanks very much.
It also proved that there is really a bug in MATLAB 2008A.
Regards
mayi
2008-07-13
Did you report it?
/ per
I have reported it to Mathworks throught website, but it still a
unsigned status now. I don't know when it will come into Mathworks
developer's eyes. :) God bless.