[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Y value on Bar Graph
From: |
Ben Abbott |
Subject: |
Re: Y value on Bar Graph |
Date: |
Tue, 03 Aug 2010 07:24:33 -0400 |
On Aug 3, 2010, at 12:02 AM, Manoj Deshpande wrote:
>>
>> On Mon, Aug 2, 2010 at 2:41 PM, bpabbott <address@hidden> wrote:
>> On 02 Aug, 2010,at 02:08 PM, Manoj Deshpande <address@hidden> wrote:
>>
>>> Hi All,
>>>
>>> http://stackoverflow.com/questions/2472052/y-value-on-bar-graph-in-gnuplot
>>>
>>> I am trying to get the above functionality on octave, is there a way via
>>> system to call gnuplot directly, and get this going ? or is there an
>>> equivalent in octave itself ?
>>> Any suggestions would be really appreciated.
>>>
>>> Thanks in advance,
>>> Manoj
>>
>> Please take a look at the text() function.
>>
>> help text
>>
>> This function will allow you to place labels above the bars.
>>
>> Ben
>
> Hi Ben,
>
> Thanks for replying, i tried text, but it messes up the graph. Please take a
> look at the images attached to this email.
>
> 141 bar(frequency);
> 142 set(gca,'XTick',[1:7]);
> 143 set(gca,'xticklabel',bins);
>
> AFTER USING TEXT
>
> 141 bar(frequency);
> 142 set(gca,'XTick',[1:7]);
> 143 set(gca,'xticklabel',bins);
> 144 text(50,50,"testing");
>
> Any suggestions ?
>
> Thanks,
> Manoj
Notice in lines 142-143 of your script, the x-axis ticklabels are places at the
positions 1:7 = 1, 2, 3, 4, 5, 6, 7. The labels are "5", "17", "23", "41",
"53", "59", & "65".
Thus, Andy is correct. The position of the text objects you want to add need to
correspond to the bin positions (xtick) not the labels (xticklabels).
Ben
p.s. please respond at the bottom of the so that those arriving late can real
and long.