Matlab histogram vertical axis frequency multiply by constant

403 views Asked by At

The vertical axis of a histogram is the frequency. However, I want them to multiply by a constant. How do I do that with Matlab?

For example:

Tickets are sold at 4 gates: North, South, East or West and I want to plot the amount earned at each gate in a histogram to see which gate earned the most.

The price of each ticket is $10. I want the histogram output to show the amount earned instead of just number of tickets sold.

1

There are 1 answers

0
xenoclast On

The hist function called with no output assignment will draw the chart for you but if you call it like this

[contents, bins] = hist(data)

it won't draw the chart and will store the relevant values in the two output variables. Then you can modify the contents variable and plot them with bar to achieve wht you need

bar(bins, 10*contents)