Thread Subject: MATLAB skipping lines for Figure Formatting

Subject: MATLAB skipping lines for Figure Formatting

From: Becky J.

Date: 21 Jan, 2010 18:16:05

Message: 1 of 4

Okay, I'm not sure if this is my computer, but I created a file that plot 6 figures, than loops through and applies formatting to the background, axis, title, legend, ect.

It sometimes skips things, such as the title, but when I place a break point and ensure that it "reads" those lines, there is no issue and the formatting occurs. These are moderately large plots - a few thousand data points each. Not sure if that makes a difference.

Any advice? I'd be happy to upload the m-file upon request

thanks,
Becky

Subject: MATLAB skipping lines for Figure Formatting

From: Nathan

Date: 21 Jan, 2010 18:18:33

Message: 2 of 4

On Jan 21, 10:16 am, "Becky J." <rebecca.jai...@gmail.com> wrote:
> Okay, I'm not sure if this is my computer, but I created a file that plot 6 figures, than loops through and applies formatting to the background, axis, title, legend, ect.
>
> It sometimes skips things, such as the title, but when I place a break point and ensure that it "reads" those lines, there is no issue and the formatting occurs. These are moderately large plots - a few thousand data points each. Not sure if that makes a difference.
>
> Any advice? I'd be happy to upload the m-file upon request
>
> thanks,
> Becky

One thing I've done in the past as a workaround is to put a small
pause within the for loop such as pause(.1)
It will slow things down a little bit, but it ensures that it doesn't
skip those lines.

I hope that helps your situation.

-Nathan

Subject: MATLAB skipping lines for Figure Formatting

From: Becky J.

Date: 21 Jan, 2010 18:31:04

Message: 3 of 4

Unfortunately not :(

The line I'm trying to execute is

title(get(get(hAxe(2), 'title'), 'string'),'FontName','Ariel','fontsize',label_size*1.25,'fontweight','b')

When I put a break point and run it, the title formats. When I just let the whole loop run, it hits sometimes.

For example, I have 6 plots (all plots with a hold of 2 things, title,xlabel,ylabel, legend- in that order). It will format the title of slides 1, 5,6. Than I'll run the function again, changing nothing a few minutes later in frustration and it'll hit 2-5. Go figure!

Subject: MATLAB skipping lines for Figure Formatting

From: Becky J.

Date: 21 Jan, 2010 18:40:21

Message: 4 of 4

Problem solved - reset the gcf each time through. Who knows what is was doing...

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com