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:
Formatting and displaying histogram

Subject: Formatting and displaying histogram

From: Tomaz

Date: 16 Apr, 2010 07:35:05

Message: 1 of 3

Hi all!

I want to do some adjustments to histogram plot before saving it to disc (I want to manipulate it with help of commands and not GUI).
When I use following:
hist (column,x);
histogram is nicely displayed and I reach it with help of gcf:
saveas(gcf, sprintf ('Graph%d.jpg', i), 'jpg')

However, if I want to get its handle (to manipulate font used for title later on), the figure is basically empty.
h = hist (column,x);

What am I doing wrong? Why is there no plot when I fetch its handle?

Subject: Formatting and displaying histogram

From: Cris Luengo

Date: 16 Apr, 2010 08:52:05

Message: 2 of 3

"Tomaz " <tomaz.bartolj@gmail.com> wrote in message <hq93v9$7mr$1@fred.mathworks.com>...
> Hi all!
>
> I want to do some adjustments to histogram plot before saving it to disc (I want to manipulate it with help of commands and not GUI).
> When I use following:
> hist (column,x);
> histogram is nicely displayed and I reach it with help of gcf:
> saveas(gcf, sprintf ('Graph%d.jpg', i), 'jpg')
>
> However, if I want to get its handle (to manipulate font used for title later on), the figure is basically empty.
> h = hist (column,x);
>
> What am I doing wrong? Why is there no plot when I fetch its handle?

help hist

Subject: Formatting and displaying histogram

From: ImageAnalyst

Date: 16 Apr, 2010 10:49:13

Message: 3 of 3

h = hist (column,x); does not fetch its handle, it returns the
counts. Then you can plot it (h) with the bar() command, which will
give you much more control over how the chart appears.

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