Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1335

Re: Changing x-axis plot from right to left to left to right

From sfeam <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Changing x-axis plot from right to left to left to right
Followup-To comp.graphics.apps.gnuplot
Date 2012-08-16 14:01 -0700
Organization gnuplot development team
Message-ID <k0jn2o$4d9$1@dont-email.me> (permalink)
References <4d60f00e-a5d4-4905-98a8-820335c7a6e0@googlegroups.com> <a8vf86FmugU1@mid.dfncis.de> <4dbdcabe-5d79-4085-8afc-127f4dcf0c9b@googlegroups.com>

Followups directed to: comp.graphics.apps.gnuplot

Show all headers | View raw


Jamie Rees wrote:

> On Tuesday, August 14, 2012 6:12:33 PM UTC+1, Hans-Bernhard Bröker wrote:
>> On 14.08.2012 17:52, Jamie Rees wrote:
>>  
>> > For mathematical reasons, I need to change the way that gnuplots my
>> > data along the X axis from right to left to left to right (that is, 
>> > at the minute it plots from 20 down to 1, not from 1 to 20)

gnuplot plots points in the order they arrive in.
left-to-right, right-to-left, or non-monotonic ordering on x is 
totally irrelevant.


>> So since this doesn't make sense, maybe you should tell us what your 
>> actual problem is, so we can find out how that might be solved.
> 
> I need to be able to manipulate the data being plotted on the graph. I
> need to be able to draw a line which steps down from left to right,  when
> the data may include peaks and troughs which would otherwise mean the
> graph would go up and down.

If you meant the each point is only plotted if it is lower than previous
points, then the following command would do the trick:

  cap = SOME_VERY_BIG_NUMBER
  plot foo using 1:( $2 > cap ? cap : cap=$2 ) with lines

or if you want to leave a gap where the limiting cap was triggered

  plot foo using 1:( $2 > cap ? NaN : cap=$2 ) with lines

 
> I've worked out that I can do this is I check to see whether if the
> previous next value along is higher than the previous, and if it is,
> assume the value of the previous and then plot a straight line.
> 
> Make much sense?
> Thanks
> 
> Jamie

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Changing x-axis plot from right to left to left to right Jamie Rees <jamierees@gmail.com> - 2012-08-14 08:52 -0700
  Re: Changing x-axis plot from right to left to left to right Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-08-14 19:12 +0200
    Re: Changing x-axis plot from right to left to left to right Jamie Rees <jamierees@gmail.com> - 2012-08-16 08:33 -0700
      Re: Changing x-axis plot from right to left to left to right Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-08-16 22:17 +0200
      Re: Changing x-axis plot from right to left to left to right sfeam <sfeam@users.sourceforge.net> - 2012-08-16 14:01 -0700
        Re: Changing x-axis plot from right to left to left to right Jamie Rees <jamierees@gmail.com> - 2012-09-07 02:42 -0700

csiph-web