Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Saving large subplot figures

Subject: Saving large subplot figures

From: Sameer

Date: 17 Sep, 2013 16:04:06

Message: 1 of 4

I'm trying to run a script that makes a large subplot, often 22x1, that will eventually be printed out on a very large sheet of paper and saved as an image file.

When I first see the plot, plot window is crowded, and each subplot is reduced to a line where the axis to save space. When viewing the plot in print preview, I actually see data in each subplot. When the figure is saved then opened again, I see the line in the plot window, then in the print preview, I see the line again, instead of the actual data. When I use plot tools to zoom into each subplot, I see the data that I intend to print.

It is possible for me to print the data immediately after originally generating it, however, in my process for generating the specially formatted PNG files, it is necessary that I save the figures and then reopen them. When I use this method, the PNG files contain the compressed line instead of the actual data. How do I avoid seeing the line?

Thank you.

Subject: Saving large subplot figures

From: dpb

Date: 17 Sep, 2013 19:32:34

Message: 2 of 4

On 9/17/2013 11:04 AM, Sameer wrote:
> I'm trying to run a script that makes a large subplot, often 22x1, that
> will eventually be printed out on a very large sheet of paper and saved
> as an image file.
> When I first see the plot, plot window is crowded, and each subplot is
> reduced to a line where the axis to save space. When viewing the plot in
> print preview, I actually see data in each subplot. When the figure is
> saved then opened again, I see the line in the plot window, then in the
> print preview, I see the line again, instead of the actual data. When I
> use plot tools to zoom into each subplot, I see the data that I intend
> to print.
> It is possible for me to print the data immediately after originally
> generating it, however, in my process for generating the specially
> formatted PNG files, it is necessary that I save the figures and then
> reopen them. When I use this method, the PNG files contain the
> compressed line instead of the actual data. How do I avoid seeing the line?

I don't have time to try it at the moment but the thought that comes to
mind is -- is it any better if you make the figure on the screen much
larger than the default size so there's more real estate available and
perhaps that would not cause the apparent precision-related issues
you're seeing?

I'd suggest sending this to "official" support at TMW on the support
link at mathworks.com -- I'd be pretty confident nobody ever thought
anyone might ever consider a subplot() of 22x1. Maybe they can suggest
a workaround knowing the internals of the various functions.

--

Subject: Saving large subplot figures

From: Demis John

Date: 27 Nov, 2013 05:57:07

Message: 3 of 4

FYI, I'm sure Sameer isn't the only person making gigantic figures of subplots - I am also saving figures with variable numbers of subplots, up to 10 or more.

I see the same issue as Sameer - it isn't a "precision" issue.

Instead, what I believe he means is that the Figure window is as tall as the screen will allow by default. Thus, to fit 10 (or more) rows of SubPlots, the SubPlot's plotting area is reduced to a sliver - while the text (axis labels/tick labels etc.) remains legible. The variable-sized objects - the plotting areas - are all reduced to minimum in order to fit into the constricted Figure Window.

I see the same thing - an exported PNG usually displays no plot (well, actually a thin sliver of each subplot), while an exported *.fig or *.pdf will indeed show a slightly larger amount of the plotting area (still usually too small to be useful).


What Sameer (I think) & I want is a way to have Matlab generate a figure that is way longer (or generally larger) than my computer screen, and save that file so that no plots get squished.

I personally just want all that data in one file and will gladly scroll around the giant PDF/PNG after the fact.

I am currently playing with the "PaperSize" and "Position" properties of the Figure object.
Any ideas from you genius matlabbers would be greatly appreciated.

Subject: Saving large subplot figures

From: dpb

Date: 27 Nov, 2013 15:03:45

Message: 4 of 4

On 11/26/2013 11:57 PM, Demis John wrote:
> FYI, I'm sure Sameer isn't the only person making gigantic figures of
> subplots - I am also saving figures with variable numbers of subplots,
> up to 10 or more.
>
> I see the same issue as Sameer - it isn't a "precision" issue.
>
> Instead, what I believe he means is that the Figure window is as tall as
> the screen will allow by default. Thus, to fit 10 (or more) rows of
> SubPlots, the SubPlot's plotting area is reduced to a sliver - while the
> text (axis labels/tick labels etc.) remains legible. The variable-sized
> objects - the plotting areas - are all reduced to minimum in order to
> fit into the constricted Figure Window.
>
> I see the same thing - an exported PNG usually displays no plot (well,
> actually a thin sliver of each subplot), while an exported *.fig or
> *.pdf will indeed show a slightly larger amount of the plotting area
> (still usually too small to be useful).
...

OK, use what term you want other than precision; it's still that there's
too little real estate for the presentation requested. Consider the
number of pixels available and then try to divide them up into enough
resolution to display all the information requested -- you soon run out
-- that's the "precision" to which I was referring.

The same thing is so when you count dots on a given piece of parchment
-- whatever the actual dpi, there are still only so many to give to each
subplot and one soon doesn't have sufficient for these very large
numbers of plots for them to all be apparent.

Part of the problem is that undoubtedly the amount of white space left
by default is larger than necessary, but one will still run into the
physical limits methinks...


> What Sameer (I think) & I want is a way to have Matlab generate a figure
> that is way longer (or generally larger) than my computer screen, and
> save that file so that no plots get squished.
>
> I personally just want all that data in one file and will gladly scroll
> around the giant PDF/PNG after the fact.
>
> I am currently playing with the "PaperSize" and "Position" properties of
> the Figure object.
> Any ideas from you genius matlabbers would be greatly appreciated.

Don't know whether it's generalized enough to allow for the creation of
what would look, roughly, like the old lineprinter plots or the
banner-creation addons that allow for overlaying multiple printer pages
but sounds like such is what might need.

I suppose one could try C or D drawings and see what happens or create own.

Again, I suggest this is worth a request to official Tech Support at
<mathworks.com>

Oh, and, do a search on File Exchange to see if anybody has submitted
anything to address it...

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us