Open fig file from an old version (2009) in 2015 version

4 views (last 30 days)
I have some fig files I saved using Matlab 2009. Now I'm trying to open these files in Matlab 2015 but the figures are blanked. The Axis are correct, the labels are correct and also the colorbar are OK, but evething inside is blanked. How can I open these figures?
EDIT: Cassiano Bortolozo's "Answer" moved here:
Certainly Attached are the figures, the .png figure is how the .fig should be.
  2 Comments
Walter Roberson
Walter Roberson on 20 Jun 2018
Would it be possible to attach one of the figures for people to experiment with?
Walter Roberson
Walter Roberson on 22 Jun 2018
I was able to replicate the problem. R2013a (still using HG1) opened the graph without problem, but the recent MATLAB (HG2) showed blank instead of the plots. The colormap is not even correct.
The graph consists of a fair number of individual patch objects.

Sign in to comment.

Answers (2)

Yun Guo
Yun Guo on 22 Jun 2018
MATLAB introduced a new Graphic System in R2014b, most of fig files should continue to work, but some may require code changes. You can find more info in following link and see if your fig files require any changes that are described in "Common Compatibility Considerations" section:
  1 Comment
Walter Roberson
Walter Roberson on 22 Jun 2018
None of the items listed there are applicable to the .fig that was attached.
This is not code to draw something: this is an existing .fig file where the patches do not show up, for unknown reason. There is no uipanel involved.

Sign in to comment.


Walter Roberson
Walter Roberson on 22 Jun 2018
After a bunch of checking (and building a tool to compare graphics objects!) I found that the primary difficulty is that when the old figure is loaded in newish MATLAB, that the axes ZLim becomes [1 10], which is a problem because the data is in the range -1 to +1 .
To fix this:
figh = load('inversao TDEM - final.fig');
figh.Children(2).ZLim = [-1 1];
The colormap is still not right, but when you can at least see the graphics, you have a chance to put your correct colormap into place. In particular it appears you would then
colormap(jet)
  2 Comments
Walter Roberson
Walter Roberson on 22 Jun 2018
Edited: Walter Roberson on 22 Jun 2018
Checking again: it turns out that the .fig itself has ZLim of [1 10] -- but at least with the renderer zbuffer that was set, the figure was showing up anyhow, as the user is looking straight down the axis. In newish MATLAB, the ZLim is being paid attention to for culling, even for zbuffer.
... and it turns out that zbuffer doesn't really exist anymore as of R2014b, and zbuffer gets interpreted as opengl, and opengl does pay attention to zlim.
Walter Roberson
Walter Roberson on 22 Jun 2018
I submitted a technical support case asking that when zbuffer is detected for hg1 that a warning about opengl and z culling be given.

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Tags

Products


Release

R2015a

Community Treasure Hunt

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

Start Hunting!