f

plot 2 graph in one figure with same axis

```Hallo my name is Dalle,

i'm really new to Matlab, and in my semester project i have to really use a load amount of Matlab so i really need to get used to it right now..
can someone tell me how to solve this:
1. i have a histogram in the first figure and response curve in another figure... the y-axis from the histogram is the same with the x-axis from the response curve... how do i plot both of them in one figure, with y-axis from the histogram and the x-axis from the respose curve being the same axis for the new figure?

2. i have plot a histogram from an image, but it only shows in 16-bit (65536 gray value), but i really like to show the histogram in 12-bit (4096 gray value).. is there any re-scale function in matlab for histogram?

cheers!
Dalle
```
 0
Dalle
4/26/2010 1:50:26 PM
comp.soft-sys.matlab 211266 articles. 19 followers. lunamoonmoon (258) is leader.

2 Replies
864 Views

Similar Articles

[PageSpeed] 39

```Dalle
1. plot using bar() and plot() with "hold on" in between them.  Or
maybe you want plotyy() if they're both going to be line plots.

2.  Not exactly sure what you're saying but you can pass in the number
of bins into hist and imhist.  And you can also set the max along the
x axis using xlim().  One of those should do the trick for you.

```
 0
ImageAnalyst
4/26/2010 11:22:31 PM
```ImageAnalyst <imageanalyst@mailinator.com> wrote in message <df3666e2-6678-42cb-aa58-83b7921c288c@s41g2000vba.googlegroups.com>...
> Dalle
> 1. plot using bar() and plot() with "hold on" in between them.  Or
> maybe you want plotyy() if they're both going to be line plots.
>
> 2.  Not exactly sure what you're saying but you can pass in the number
> of bins into hist and imhist.  And you can also set the max along the
> x axis using xlim().  One of those should do the trick for you.
>
>

thank you so much ImageAnalyst, the first problem is solved :D
hmm but i still can't figure out with the second problem... i mean first i read an image with f = imread('....')
and then with imhist(f) i plot it's histogram
but the automatic histogram wiill produced 6x10^4 in this case 65536 value (16-bit) for the x-axis... i know that in Matlab we can store images just in 8-bit and 16-bit... but what i want is just to plot a histogram (from an 16-bit image) with 12-bit (4096 gray value) for the x-axis... i thought about dividing all of the matrix from the images with 16 coz 655536 / 16 = 4096, but when i plot the histogram for the new matrix, it doesn't matched with the previous histogram..
i hope i don't being a completely newbie about image processing :p
```
 0
Dalle
4/27/2010 11:39:05 AM