|
From: Tino W. <ti...@wi...> - 2006-07-05 09:21:43
|
Hi, another idea that bugs me, maybe others would find it usefull too: what if it would be possible to map xrange, yrange, .. settings into the environment where the external command via popen is run? This way it would be easy to just fetch and deliver only the amount of data which is really in the display boundaries - for example if you magnify parts of a measure log. Bad idea? Regards Tino |
|
From: Petr M. <mi...@ph...> - 2006-07-05 09:25:51
|
> what if it would be possible to map xrange, yrange, .. > settings into the environment where the external > command via popen is run? This way it would be easy > to just fetch and deliver only the amount of data > which is really in the display boundaries - for example > if you magnify parts of a measure log. Since very recently, you can print GPVAL_X_MIN, GPVAL_X_MAX, GPVAL_Y_MIN, GPVAL_Y_MAX and let your driving application to read it. See also 'help set print' and "bidirectional" examples on gnuplot web page. --- PM |
|
From: Tino W. <ti...@wi...> - 2006-07-05 10:55:48
|
Petr Mikulik schrieb: >> what if it would be possible to map xrange, yrange, .. >> settings into the environment where the external >> command via popen is run? This way it would be easy >> to just fetch and deliver only the amount of data >> which is really in the display boundaries - for example >> if you magnify parts of a measure log. > > > Since very recently, you can > print GPVAL_X_MIN, GPVAL_X_MAX, GPVAL_Y_MIN, GPVAL_Y_MAX > and let your driving application to read it. See also 'help set print' > and "bidirectional" examples on gnuplot web page. But this looks as if my application would have to run gnuplot in popen() and not vice versa? Currently I run a number of scripts in plot where each script delivers data for a part graph. It would be nice to be able to access these values from the script which runs inside plot "<script" or am I misunderstanding? Regards Tino |
|
From: Ethan A M. <merritt@u.washington.edu> - 2006-07-05 14:41:55
|
On Wednesday 05 July 2006 03:54 am, Tino Wildenhain wrote:
> Petr Mikulik schrieb:
> >
> > Since very recently, you can
> > print GPVAL_X_MIN, GPVAL_X_MAX, GPVAL_Y_MIN, GPVAL_Y_MAX
> > and let your driving application to read it. See also 'help set print'
> > and "bidirectional" examples on gnuplot web page.
>
> But this looks as if my application would have to
> run gnuplot in popen() and not vice versa?
No, you have that backwards.
It is only possible to set environmental variables for
your current process, or for a child process. Not for a parent.
> Currently I run a number of scripts in plot
> where each script delivers data for a part graph.
>
> It would be nice to be able to access these values
> from the script which runs inside
>
> plot "<script"
Right. That you can do, for instance by passing the values as
script parameters:
command1 = sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX)
plot command1 with lines
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|
|
From: Tino W. <ti...@wi...> - 2006-07-06 06:54:16
|
Ethan A Merritt schrieb:
> On Wednesday 05 July 2006 03:54 am, Tino Wildenhain wrote:
>
>>Petr Mikulik schrieb:
>>
>>>Since very recently, you can
>>> print GPVAL_X_MIN, GPVAL_X_MAX, GPVAL_Y_MIN, GPVAL_Y_MAX
>>>and let your driving application to read it. See also 'help set print'
>>>and "bidirectional" examples on gnuplot web page.
>>
>>But this looks as if my application would have to
>>run gnuplot in popen() and not vice versa?
>
>
> No, you have that backwards.
> It is only possible to set environmental variables for
> your current process, or for a child process. Not for a parent.
well it wasnt me who got this backwards ;) I know I can
only set vars for current process (and therefore childs)
>
>>Currently I run a number of scripts in plot
>>where each script delivers data for a part graph.
>>
>>It would be nice to be able to access these values
>>from the script which runs inside
>>
>>plot "<script"
>
>
> Right. That you can do, for instance by passing the values as
> script parameters:
>
> command1 = sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX)
> plot command1 with lines
Ah, now thats interesting! I guess I fetch the current
sources and try again.
Regards
Tino
|
|
From: Tino W. <ti...@wi...> - 2006-07-08 22:04:01
|
Ethan A Merritt wrote:
...
> Right. That you can do, for instance by passing the values as
> script parameters:
>
> command1 = sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX)
> plot command1 with lines
Well, this works with the current checkout, but not in a way to
fix the problem ;) After the sprintf of course the values
are fixed in the string and are not recalculated when you
select another area to zoom with the mouse.
So a mapping to the environment would be the most flexible
way to make all this possible I guess...
Regards
Tino
|
|
From: Petr M. <mi...@ph...> - 2006-07-08 22:11:08
|
>> Right. That you can do, for instance by passing the values as
>> script parameters:
>>
>> command1 = sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX)
>> plot command1 with lines
>
> Well, this works with the current checkout, but not in a way to
> fix the problem ;) After the sprintf of course the values
> are fixed in the string and are not recalculated when you
> select another area to zoom with the mouse.
The values GPVAL_X_MIN etc are changed after the zoom! Thus:
plot sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX) with lines
---
PM
|
|
From: Ethan A M. <merritt@u.washington.edu> - 2006-07-08 22:12:02
|
On Saturday 08 July 2006 03:03 pm, Tino Wildenhain wrote:
> Ethan A Merritt wrote:
> ...
> > Right. That you can do, for instance by passing the values as
> > script parameters:
> >
> > command1 = sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX)
> > plot command1 with lines
>
> Well, this works with the current checkout, but not in a way to
> fix the problem ;) After the sprintf of course the values
> are fixed in the string and are not recalculated when you
> select another area to zoom with the mouse.
So put it in the plot command directly.
That way it will get re-evaluated every time:
> So a mapping to the environment would be the most flexible
> way to make all this possible I guess...
That would suffer the same problem. You would have to
re-export the environmental variable prior to doing each
replot.
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|
|
From: Tino W. <ti...@wi...> - 2006-07-08 22:16:18
|
Ethan A Merritt wrote:
> On Saturday 08 July 2006 03:03 pm, Tino Wildenhain wrote:
>> Ethan A Merritt wrote:
>> ...
>>> Right. That you can do, for instance by passing the values as
>>> script parameters:
>>>
>>> command1 = sprintf("< scriptname %g %g",GPVAL_X_MIN,GPVAL_X_MAX)
>>> plot command1 with lines
>> Well, this works with the current checkout, but not in a way to
>> fix the problem ;) After the sprintf of course the values
>> are fixed in the string and are not recalculated when you
>> select another area to zoom with the mouse.
>
> So put it in the plot command directly.
> That way it will get re-evaluated every time:
uh. can I? How?
>> So a mapping to the environment would be the most flexible
>> way to make all this possible I guess...
>
> That would suffer the same problem. You would have to
> re-export the environmental variable prior to doing each
> replot.
Just before popen() would make most sense, right? -
or alternatively with every change to a variable
(a bit more code work, but probably not - since
there seems to be a central mapping and interface
for setting/reading vars)
Regards
Tino
|