I'm looking for a Matlab FIGure Viewer, i.e. a small utility
which does nothing else than open and display a FIG file.
Does something like that exist? The reason is, if you export
the figure, you can no longer zoom into it without loosing
details etc.
Thank you for your replies.
sabine
>I'm looking for a Matlab FIGure Viewer, i.e. a small utility
>which does nothing else than open and display a FIG file.
>Does something like that exist?
I would tend to doubt that it exists. When a .fig file is
opened in Matlab, the complete figure is reproduced, which
implies that the .fig file must encode all handle graphics
properties (so that the opened figure has the same properties
as the figure to be saved had). All parent/child relationships
would have to be preserved, along with all properties such as
tags and Visible. I never checked whether User fields are preserved
as well; I would -expect- that callbacks would be preserved, but
I haven't looked at that.
Since fields that must definitely be preserved include cell
arrays, character arrays, double arrays, and uint8 and uint16 arrays
(for CData), effectively a .fig file must have nearly the same
flexibility as a .mat file. I'd be a bit surprised if they aren't
really .mat files "under the covers".
--
Current spam load: 750-800 messages per day (March 4, 2008)
If you have a licence for the Matlab compiler then YES! there is
indeed a way to view matlab .fig files (however it requires the person
using the program to install the Matlab Component Runtime.. arather
hefty 100+MB install).
Example code to follow:
function showFigure(figure_to_open)
if ~isempty(figure_to_open)
fprintf(1, 'Opening Figure: %s\n', figure_to_open)
if strfind(figure_to_open, '.fig')
openfig(figure_to_open, 'new')
set(gcf, 'Toolbar', 'figure')
set(gcf, 'menuBar', 'figure')
else
m = msgbox('Not a valid Matlab Figure');
waitfor(m)
end
end
end
function false_you_bastard = isdeployed()
false_you_bastard = 0;
end
-----------------------------------------------------------------------------
The 'false_you_bastard' bit of code was to override Matlab's inbuilt
function to determine if the code is running from source or compiled
code. There was a bug in something (printing / saving pngs) that
forced me to do that.
This issue may be fixed in newer revisions (I wrote this in 2005 for
R14 SP3).
Enjoy!
Rod
Why speculate? If you test your theory you'll see that you are correct
and you can load a fig file with
load -mat test.fig
To the OP I suggest that you export your figure to a .pdf file since
your complaint was that you lose detail when zooming. Indeed that is
true if you exported to a .jpg or .png, but .pdf doesn't have the same
limitation since it's a vector format. You might want to specify a line
width of less than the default of 0.5 pts if you have a tangled mess of
lines that you need to resolve.
--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
Although if the figure is rendered with opengl or zbuffer the PDF will contain
a raster (bitmap) representation - not a vectorized one.
--
Richard Quist
Software Developer
The MathWorks, Inc.
>> Since fields that must definitely be preserved include cell
>> arrays, character arrays, double arrays, and uint8 and uint16 arrays
>> (for CData), effectively a .fig file must have nearly the same
>> flexibility as a .mat file. I'd be a bit surprised if they aren't
>> really .mat files "under the covers".
>Why speculate? If you test your theory you'll see that you are correct
>and you can load a fig file with
> load -mat test.fig
Why speculate? Because it was 01:30 in the morning and I was at home
and it was too much bother to create a secure network connection to
work and fire up Matlab to create a .fig file to experiment with.
(For one thing, I'm having a lot of trouble with mouse clicks on
the relevant computer.)
--
"Why does he stagger his mind with the mathematics of the sky?
Once the question mark has arisen in the human brain the answer must
be found, if it takes a hundred years. A thousand years."
-- Walter Reisch
> In article <see-3EE3C7.0...@news.motzarella.org>,
> Doug Schwarz <s...@sig.for.address.edu> wrote:
> >In article <g2alfh$smm$1...@canopus.cc.umanitoba.ca>,
> > robe...@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote:
>
> >> Since fields that must definitely be preserved include cell
> >> arrays, character arrays, double arrays, and uint8 and uint16 arrays
> >> (for CData), effectively a .fig file must have nearly the same
> >> flexibility as a .mat file. I'd be a bit surprised if they aren't
> >> really .mat files "under the covers".
>
> >Why speculate? If you test your theory you'll see that you are correct
> >and you can load a fig file with
>
> > load -mat test.fig
>
> Why speculate? Because it was 01:30 in the morning and I was at home
> and it was too much bother to create a secure network connection to
> work and fire up Matlab to create a .fig file to experiment with.
> (For one thing, I'm having a lot of trouble with mouse clicks on
> the relevant computer.)
But you seem to feel that you have to answer, even if you're not sure.
Really, Walter, you could leave a few questions for the rest of us! :-)