Why do I get an error and instability when I print or copy my MATLAB figure to a metafile?
4 views (last 30 days)
Show older comments
Why do I get an error and instability when I print or copy my MATLAB figure to a metafile?
I have a figure with many data points. I try to use "Copy Figure" to a metafile, but I get an error and sometimes a segmentation violation. Then, my MATLAB command window does not refresh correctly.
I see the same problem if I try to print using the "painters" renderer to a metafile.
The problem persists in MATLAB 6.0 (R12) and later versions.
% Assume that the figure at fault is open at this point
print -painters -dmeta
CreateRectRgn, called from ws_CreateClipRegion(), returned NULL
CreateRectRgn, called from ws_CreateClipRegion(), returned NULL
Warning: Could not create metafile.
> In D:\Applications\MATLAB6p5\toolbox\matlab\graphics\private\render.m at line 93
In D:\Applications\MATLAB6p5\toolbox\matlab\graphics\print.m at line 238
Warning: The handle is invalid.
.
> In D:\Applications\MATLAB6p5\toolbox\matlab\graphics\private\render.m at line 93
In D:\Applications\MATLAB6p5\toolbox\matlab\graphics\print.m at line 238
------------------------------------------------------------------------
Segmentation violation detected at Thu Aug 29 13:59:55 2002
------------------------------------------------------------------------
Configuration:
MATLAB Version: 6.5.0.180913a (R13)
Operating System: Microsoft Windows 2000
Window System: Version 5.0 (Build 2195: Service Pack 2)
Processor ID: x86 Family 6 Model 8 Stepping 6, GenuineIntel
Virtual Machine: Java 1.3.1_01 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
(mixed mode)
Register State:
EAX = 00000000 EBX = 00000000
ECX = 00000000 EDX = 00000000
ESI = 019acb40 EDI = 00000000
EBP = 00dfa278 ESP = 00dfa278
EIP = 7a5964d6 FLG = 00010246
Stack Trace:
[0] gui.dll:_GetBumpData(0, 0, 0x191af010, 0) + 6 bytes
[snip]
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
This is a bug in MATLAB 6.0 (R12) and later that has been reported to our development staff. The problem is rare, and seems to show up only with specific figures.
Currently, the only known workarounds are to print using ZBuffer, or print to a bitmap instead:
print -zbuffer -dmeta
0 Comments
More Answers (0)
See Also
Categories
Find more on Historical Contests in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!