Gnuplot's internal sequence

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Gnuplot's internal sequence

Alan Corey
My data is data points contained in an input file.  What I'd like to
do is something like:

  set y2range [(1.8*GPVAL_Y_MIN)+32:(1.8*GPVAL_Y_MAX)+32]

But GPVAL_Y_MIN and GPVAL_Y_MAX apparently aren't defined until the
read is complete, and putting things like y2range or y2ticks after the
read seems to have no effect.  I tried refresh and replot after the y2
stuff, even a 2nd plot line.

Is there a way to do a dummy read that just sets up the min/max stuff?

reset
set terminal gif size 1200,800
set output "2labc.gif"
set xdata time
set timefmt x "%s"
set format x "%H:%M\n%D"
set style data lines
set xtics auto
#  GPVAL_Y_MIN etc aren't defined yet
#set y2range [(1.8*GPVAL_Y_MIN)+32:(1.8*GPVAL_Y_MAX)+32]
set y2label "Fahrenheit"
plot "outvals.tab" using ($1-(4*3600)):2 notitle
# These have no effect:
#set y2range [(1.8*GPVAL_Y_MIN)+32:(1.8*GPVAL_Y_MAX)+32]
#set y2tics auto
#refresh


--
Credit is the root of all evil.  - AB1JX

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gnuplot's internal sequence

Ethan A Merritt-2
Use the "stats" command.  If you only need to know the y value range, that
would be

    stats "outvals.tab" using 2

On Fri, Jul 29, 2016 at 12:59 PM, Alan Corey <[hidden email]> wrote:

> My data is data points contained in an input file.  What I'd like to
> do is something like:
>
>   set y2range [(1.8*GPVAL_Y_MIN)+32:(1.8*GPVAL_Y_MAX)+32]
>
> But GPVAL_Y_MIN and GPVAL_Y_MAX apparently aren't defined until the
> read is complete, and putting things like y2range or y2ticks after the
> read seems to have no effect.  I tried refresh and replot after the y2
> stuff, even a 2nd plot line.
>
> Is there a way to do a dummy read that just sets up the min/max stuff?
>
> reset
> set terminal gif size 1200,800
> set output "2labc.gif"
> set xdata time
> set timefmt x "%s"
> set format x "%H:%M\n%D"
> set style data lines
> set xtics auto
> #  GPVAL_Y_MIN etc aren't defined yet
> #set y2range [(1.8*GPVAL_Y_MIN)+32:(1.8*GPVAL_Y_MAX)+32]
> set y2label "Fahrenheit"
> plot "outvals.tab" using ($1-(4*3600)):2 notitle
> # These have no effect:
> #set y2range [(1.8*GPVAL_Y_MIN)+32:(1.8*GPVAL_Y_MAX)+32]
> #set y2tics auto
> #refresh
>
>
> --
> Credit is the root of all evil.  - AB1JX
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> gnuplot-info mailing list
> [hidden email]
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gnuplot's internal sequence

Alan Corey
On 7/29/16, Ethan Merritt <[hidden email]> wrote:
> Use the "stats" command.  If you only need to know the y value range, that
> would be
>
>     stats "outvals.tab" using 2

Thank you, that's close.  What it gets though are the min/max of the
data rather than the limits of the plot.  For example 17.6 - 31.9
rather than 16 - 32.  I imagine there's a relatively simple formula
that sets the plot limits to round numbers?  I think those are what I
should put through the * 1.8 + 32 conversion.  I probably can't access
the plot limits but I can derive them over again from the data limits
if I know the formula.

--
Credit is the root of all evil.  - AB1JX

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gnuplot's internal sequence

Ethan A Merritt-2
On Friday, 29 July 2016 11:07:29 PM Alan Corey wrote:

> On 7/29/16, Ethan Merritt <[hidden email]> wrote:
> > Use the "stats" command.  If you only need to know the y value range, that
> > would be
> >
> >     stats "outvals.tab" using 2
>
> Thank you, that's close.  What it gets though are the min/max of the
> data rather than the limits of the plot.  For example 17.6 - 31.9
> rather than 16 - 32.  I imagine there's a relatively simple formula
> that sets the plot limits to round numbers?  I think those are what I
> should put through the * 1.8 + 32 conversion.  I probably can't access
> the plot limits but I can derive them over again from the data limits
> if I know the formula.

Not a formula.  By default the axis range is extended to the next tic mark.
What that is depends on "set ytics".  If you do not want the axis range
to extend beyond the actual data, you can use the keyword "noextend".
I.e.
   set yrange [*:*] noextend
In that case the axis range will exactly match the min/max of the
data y coordinates,.

See "help noextend"

                Ethan

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gnuplot's internal sequence

Alan Corey
My final outcome of that last summer:
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=175024&p=1130714#p1130714

Oh, noextend must need version 5, I'm using the 4.6 that's in Raspbian
debs, good enough for now.

On 7/29/16, Ethan A Merritt <[hidden email]> wrote:

> On Friday, 29 July 2016 11:07:29 PM Alan Corey wrote:
>> On 7/29/16, Ethan Merritt <[hidden email]> wrote:
>> > Use the "stats" command.  If you only need to know the y value range,
>> > that
>> > would be
>> >
>> >     stats "outvals.tab" using 2
>>
>> Thank you, that's close.  What it gets though are the min/max of the
>> data rather than the limits of the plot.  For example 17.6 - 31.9
>> rather than 16 - 32.  I imagine there's a relatively simple formula
>> that sets the plot limits to round numbers?  I think those are what I
>> should put through the * 1.8 + 32 conversion.  I probably can't access
>> the plot limits but I can derive them over again from the data limits
>> if I know the formula.
>
> Not a formula.  By default the axis range is extended to the next tic mark.
> What that is depends on "set ytics".  If you do not want the axis range
> to extend beyond the actual data, you can use the keyword "noextend".
> I.e.
>    set yrange [*:*] noextend
> In that case the axis range will exactly match the min/max of the
> data y coordinates,.
>
> See "help noextend"
>
> Ethan
>


--
-------------
No, I won't  call it "climate change", do you have a "reality problem"? - AB1JX
Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gnuplot's internal sequence

Ethan A Merritt-2
On Tue, Mar 14, 2017 at 12:56 PM, Alan Corey <[hidden email]> wrote:

> My final outcome of that last summer:
> https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=
> 175024&p=1130714#p1130714
>
> Oh, noextend must need version 5, I'm using the 4.6 that's in Raspbian
> debs, good enough for now.
>
>
In version 4.6 the equivalent command is
    set autoscale fix

(totally non-obvious, which is why it got a less obscure equivalent in
version 5)

      Ethan


> On 7/29/16, Ethan A Merritt <[hidden email]> wrote:
> > On Friday, 29 July 2016 11:07:29 PM Alan Corey wrote:
> >> On 7/29/16, Ethan Merritt <[hidden email]> wrote:
> >> > Use the "stats" command.  If you only need to know the y value range,
> >> > that
> >> > would be
> >> >
> >> >     stats "outvals.tab" using 2
> >>
> >> Thank you, that's close.  What it gets though are the min/max of the
> >> data rather than the limits of the plot.  For example 17.6 - 31.9
> >> rather than 16 - 32.  I imagine there's a relatively simple formula
> >> that sets the plot limits to round numbers?  I think those are what I
> >> should put through the * 1.8 + 32 conversion.  I probably can't access
> >> the plot limits but I can derive them over again from the data limits
> >> if I know the formula.
> >
> > Not a formula.  By default the axis range is extended to the next tic
> mark.
> > What that is depends on "set ytics".  If you do not want the axis range
> > to extend beyond the actual data, you can use the keyword "noextend".
> > I.e.
> >    set yrange [*:*] noextend
> > In that case the axis range will exactly match the min/max of the
> > data y coordinates,.
> >
> > See "help noextend"
> >
> >               Ethan
> >
>
>
> --
> -------------
> No, I won't  call it "climate change", do you have a "reality problem"? -
> AB1JX
> Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Gnuplot's internal sequence

Alan Corey
OK, yes, help autoscale finds that.  I was trying to access the value
in GPVAL_Y_MIN and GPVAL_Y_MAX to convert them for labeling the 2nd Y
scale but couldn't, apparently they get defined by the plotting
process.  I didn't try labeling after plotting.  I was setting my
y2range based on values from stat but then I noticed they were a
little off.  About as I put a bad plot online as the first plot in
that post.  I knew the max temp was about 93 F but it looks more like
83.  The only real change I made was in forcing yrange for the left
axis.

On 3/14/17, Ethan Merritt <[hidden email]> wrote:

> On Tue, Mar 14, 2017 at 12:56 PM, Alan Corey <[hidden email]> wrote:
>
>> My final outcome of that last summer:
>> https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=
>> 175024&p=1130714#p1130714
>>
>> Oh, noextend must need version 5, I'm using the 4.6 that's in Raspbian
>> debs, good enough for now.
>>
>>
> In version 4.6 the equivalent command is
>     set autoscale fix
>
> (totally non-obvious, which is why it got a less obscure equivalent in
> version 5)
>
>       Ethan
>
>
>> On 7/29/16, Ethan A Merritt <[hidden email]> wrote:
>> > On Friday, 29 July 2016 11:07:29 PM Alan Corey wrote:
>> >> On 7/29/16, Ethan Merritt <[hidden email]> wrote:
>> >> > Use the "stats" command.  If you only need to know the y value
>> >> > range,
>> >> > that
>> >> > would be
>> >> >
>> >> >     stats "outvals.tab" using 2
>> >>
>> >> Thank you, that's close.  What it gets though are the min/max of the
>> >> data rather than the limits of the plot.  For example 17.6 - 31.9
>> >> rather than 16 - 32.  I imagine there's a relatively simple formula
>> >> that sets the plot limits to round numbers?  I think those are what I
>> >> should put through the * 1.8 + 32 conversion.  I probably can't access
>> >> the plot limits but I can derive them over again from the data limits
>> >> if I know the formula.
>> >
>> > Not a formula.  By default the axis range is extended to the next tic
>> mark.
>> > What that is depends on "set ytics".  If you do not want the axis range
>> > to extend beyond the actual data, you can use the keyword "noextend".
>> > I.e.
>> >    set yrange [*:*] noextend
>> > In that case the axis range will exactly match the min/max of the
>> > data y coordinates,.
>> >
>> > See "help noextend"
>> >
>> >               Ethan
>> >
>>
>>
>> --
>> -------------
>> No, I won't  call it "climate change", do you have a "reality problem"? -
>> AB1JX
>> Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach
>>
>


--
-------------
No, I won't  call it "climate change", do you have a "reality problem"? - AB1JX
Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...