Hi Christian,

Many thanks for your tips. I was finally able to get the expected
results following your indications. I started by plotting my reference
line at y=-100 using mathematical expression and the "samples at"
command. I make this transparent, so that I can stack the real value
(with a +100 offset) onto it. Adjusting the style make it look like a
ycomb with an offset.

Here is the code I used, hoping it might be useful to someone, and
that someone improve it:

 \begin{tikzpicture}
    \begin{axis}[stack plots = y, /tikz/ybar,
        xmin=-101,xmax=101,
        ymin=-90, ymax=5,
        bar width=0pt,
        mark size=1pt
      ]
      \addplot[transparent, domain=-100:100, samples at={-100, -99,
..., 100}] {-100};
      \addplot[blue,mark=*] table [x=eta, y expr=\thisrow{p} + 100] {data.txt};
    \end{axis}
 \end{tikzpicture}

There are 201 points in my data.txt:

eta p
-100 -1200
-99 -553
...

Thanks for your help!

Best regards,

Aurélien

2012/7/8 Christian Feuersaenger <cfeuersaen...@googlemail.com>:
> Hi Aurelien Coillet,
>
> thanks for your request!
>
> The feature that you ask for is unsupported: comb plots are supposed to
> start at 0 for every plot.
>
> The reason why I am writing so late is that I wanted to check how to use
> stack plots and/or the internal zerolevel functionality (which you mentioned
> in your private email) first...
>
> What you could do is to create a stacked plot - and stack your comb plot on
> top of some other plot and ensure that the other plot is actually invisible.
> Note that this internal zerolevel functionality is used by stacked plots -
> and all other plot handlers. If I am not mistaken, the values are explicitly
> reset to 0 by pgfplots (unless you have a stacked plot of course).
>
> A stacked plot would reconfigure your complete axis, that means it would
> probably affect all plots within the same axis. If you feel that what you
> want is a stacked plot, then this will help. If you are in doubt, the tool
> does not what you want - as already said, comb plots have been designed to
> start at 0.
>
> Best regards
>
> Christian
>
>
> Am 18.06.2012 10:27, schrieb aurelien coillet:
>
>> Hi,
>>
>> I'm trying to plot some data using the ycomb feature, but I have to
>> use a decibel unit, and therefore, my values are ranging from -90 to
>> 0. The problem is ycomb draws the line from 0 to the given value,
>> which is not relevant for this unit. So here is my question: Is there
>> a way to modify the starting point of the line in a ycomb plot (or its
>> cousins xcomb, bar, ...)?
>> I searched in the manual and in google, but couldn't find answers...
>>
>> Thanks for your reply. Best regards.
>>
>



-- 
Aurélien Coillet

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pgfplots-features mailing list
Pgfplots-features@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgfplots-features

Reply via email to