Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I vary the "zero" point of an impulse line?

265 views
Skip to first unread message

sk...@pobox.com

unread,
May 26, 2005, 3:37:08 PM5/26/05
to
I'm trying to work around the fact that gnuplot only supports
two y axis scales. I have two sets of time-series data that are
displayed on different scales, but I also have a set of
indicator values that only assume the three values -1, 0 and 1.
I'd like to plot the indicator values as impulses, but have the
base of the impulse be the value of one of the other two time
series. Since the ranges of the time series data are much
greater than that of the indicator and they don't include 0,
plotting the indicator using either time series' scale wouldn't
work.

I suspect I'm describing the problem poorly. Let me make it
more concrete. Suppose I have these data:

0 0 0
10 10 0
20 20 1
30 30 0
40 40 -1
50 50 -1
60 60 0
70 70 -1
80 80 1
90 90 1
100 100 0

If I plot '-' 1:2 with lines, I get a nice straight line from
0,0 to 100,100. If I plot '-' 1:3 with impules, I see the
impulses plotted as vertical lines with a starting point 0 and a
height of 1 or -1. I'd like for the impulses to start at the
current y value. For instance, the impulse for the third row of
data above would be a vertical line from 20,20 to 20,21. The
visual effect would be "hair" on one of the time series plots.

Is this possible? If not, are there are other data presentation
techniques that will let me superimpose the indicators on the
other plotted data? I've tried plotting 1:($2+$3) with dots or
points. The dots are essentially invisible. When plotting with
points, the displayed marker for the zero values pretty much
obscures the base time series.

Thanks,

--
Skip Montanaro
sk...@pobox.com

Ethan Merritt

unread,
May 26, 2005, 4:04:53 PM5/26/05
to
In article <1117136228.4...@g44g2000cwa.googlegroups.com>,

<sk...@pobox.com> wrote:
> Suppose I have these data:
>
> 0 0 0
> 10 10 0
> 20 20 1
> 30 30 0
> 40 40 -1
> 50 50 -1
> 60 60 0
> 70 70 -1
> 80 80 1
> 90 90 1
> 100 100 0
>
>If I plot '-' 1:2 with lines, I get a nice straight line from
>0,0 to 100,100. If I plot '-' 1:3 with impules, I see the
>impulses plotted as vertical lines with a starting point 0 and a
>height of 1 or -1. I'd like for the impulses to start at the
>current y value. For instance, the impulse for the third row of
>data above would be a vertical line from 20,20 to 20,21. The
>visual effect would be "hair" on one of the time series plots.

scale = 10.
plot '-' using 1:2:(0):(scale*column(3)) with vectors

--
Ethan A Merritt

sk...@pobox.com

unread,
May 27, 2005, 8:43:23 AM5/27/05
to
Very cool...

Thanks,

Skip

Mike Deskevich

unread,
Jun 2, 2005, 12:41:54 PM6/2/05
to
heh, that's cool. i usually got arond the problem by using finance
bars with a bar width of zero. i like your way better.

0 new messages