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 boxplots

Subject: saving boxplots

From: Steven

Date: 8 Mar, 2011 08:48:20

Message: 1 of 5

Hi all,

Im having problems saving my boxplots. There might be a very obvious solution, but I dont seem to get it right.

basically, I create a bunch of boxplots by means of a loop, so I'd like to save all individual plots.

somewhat like this:

for x = 1:10
  array = data(x,:);
  foo = boxplot(array,'labels',char(label_list(1,x)));

  saveas(foo, char(label_list(1,x)), 'jpg') %here id like to save my boxplot, but that %doesnt work
end

any help would be greatly appreciated,

cheers
Steven

Subject: saving boxplots

From: ImageAnalyst

Date: 8 Mar, 2011 11:50:03

Message: 2 of 5

Steven:
See the FAQ:
http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions.

Subject: saving boxplots

From: sinoTrinity Liu

Date: 4 Oct, 2011 22:32:28

Message: 3 of 5

"Steven " <stevenvandepavert@gmail.com> wrote in message <il4qgk$el6$1@fred.mathworks.com>...
> Hi all,
>
> Im having problems saving my boxplots. There might be a very obvious solution, but I dont seem to get it right.
>
> basically, I create a bunch of boxplots by means of a loop, so I'd like to save all individual plots.
>
> somewhat like this:
>
> for x = 1:10
> array = data(x,:);
> foo = boxplot(array,'labels',char(label_list(1,x)));
>
> saveas(foo, char(label_list(1,x)), 'jpg') %here id like to save my boxplot, but that %doesnt work
> end
>
> any help would be greatly appreciated,
>
> cheers
> Steven

I'm having the same issue. Does the answer solve the issue?

Subject: saving boxplots

From: Pekka Kumpulainen

Date: 5 Oct, 2011 10:11:28

Message: 4 of 5

"sinoTrinity Liu" <whu_lxh@hotmail.com> wrote in message <j6g1hr$gfm$1@newscl01ah.mathworks.com>...
> "Steven " <stevenvandepavert@gmail.com> wrote in message <il4qgk$el6$1@fred.mathworks.com>...
> > Hi all,
> >
> > Im having problems saving my boxplots. There might be a very obvious solution, but I dont seem to get it right.
> >
> > basically, I create a bunch of boxplots by means of a loop, so I'd like to save all individual plots.
> >
> > somewhat like this:
> >
> > for x = 1:10
> > array = data(x,:);
> > foo = boxplot(array,'labels',char(label_list(1,x)));
> >
> > saveas(foo, char(label_list(1,x)), 'jpg') %here id like to save my boxplot, but that %doesnt work
> > end
> >
> > any help would be greatly appreciated,
> >
> > cheers
> > Steven
>
> I'm having the same issue. Does the answer solve the issue?

Don't know. But one reason why the original example fails is that saveas accepts a handle of a figure or Simulink block diagram. foo returned from boxplot contains a matrix of handles of line objects.
Couldn't find anything about the output argument of boxplot in the doc, strange. But at least 2011b does return handles to the lines.

Subject: saving boxplots

From: Tom Lane

Date: 6 Oct, 2011 18:25:25

Message: 5 of 5

Try this:
     load carsmall
     boxplot(MPG,Origin)
     hgsave(gcf,'deleteme')
     close
     openfig('deleteme')

-- Tom

"sinoTrinity Liu" <whu_lxh@hotmail.com> wrote in message
news:j6g1hr$gfm$1@newscl01ah.mathworks.com...
> "Steven " <stevenvandepavert@gmail.com> wrote in message
> <il4qgk$el6$1@fred.mathworks.com>...
>> Hi all, Im having problems saving my boxplots. There might be a very
>> obvious solution, but I dont seem to get it right.
>>
>> basically, I create a bunch of boxplots by means of a loop, so I'd like
>> to save all individual plots.
>>
>> somewhat like this:
>>
>> for x = 1:10
>> array = data(x,:);
>> foo = boxplot(array,'labels',char(label_list(1,x)));
>>
>> saveas(foo, char(label_list(1,x)), 'jpg') %here id like to save my
>> boxplot, but that %doesnt work
>> end
>>
>> any help would be greatly appreciated, cheers
>> Steven
>
> I'm having the same issue. Does the answer solve the issue?

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