Direct link to this answer

The .fig file format is really just a .mat that stores all of the objects in a figure. Most of the time this happens quite seamlessly, so the user never notices or cares how .fig files are saved. But .mat files are not all the same: in particular, the size of arrays that can be saved has increased significantly as MATLAB has developed. You can see these differences summarized here:

What appears to have happened is that whoever wrote the .fig saving code did not consider that someone might want to save a figure with such a huge amount of data, and the size is beyond the specification for the default .mat file version that the .fig saving code uses (here in bytes):

>> 2^31

ans = 2147483648

>> 15000*30000*8

ans = 3600000000

"how to avoid it?"

You might like to try using saveas, to see if it handles this better.

Otherwise I doubt that there is a simple solution, but I think you should definitely report this as a bug.