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


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

Re: difficult for loop synax :-|

From Ethan A Merritt <EAMerritt@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: difficult for loop synax :-|
Date 2014-08-19 18:03 -0700
Organization made entirely of Lego
Message-ID <lt0s51$jbh$1@dont-email.me> (permalink)
References <9bc28e9e-f776-4407-8acc-f0bc7a964bcf@googlegroups.com>

Show all headers | View raw


Kalin Kozhuharov wrote:

> I have been trying to plot two dependent functions per single for
> loop, but cannot get the syntax right...
> 
> This works but is a lot of typing and if I don't know the number of
> arguments cannot be expressed:
> 
> plot  C=1, sin(C*x) w l, C=2, sin(C*x) w l, C=3, sin(C*x) w l;
> 
> Any ideas?

Please clarify.   I see only a single function there, evaluated 
three times.   Where is the second dependent function?

> 
> This works:
> 
>  plot for [n in "1 2 3"]  n*x, for [n in "1 2 3"] sin(n*x) w l;
> 
> but those are independent functions, so 3 times n*x is plotted, then 3
> times sin(n*x) in that order
> 
> I need something like
> 
> plot for [n in "1 2 3"]  {C=n, sin(C*x) w l};
> i.e. set some parameter by a function, then plot something, then
> evaluate the parameter again, then plot second function...

I still see only a single function.
That command appears to be equivalent to 

    plot for [C=1:3] sin(C*x)

You must have some additional step in mind, I guess?

> Fiddling with multiplot is hard it seems, need to hardcode linestyles,
> etc.
> 
> Kalin.

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


Thread

difficult for loop synax :-| Kalin Kozhuharov <me.kalin@gmail.com> - 2014-08-19 11:57 -0700
  Re: difficult for loop synax :-| Ethan A Merritt <EAMerritt@gmail.com> - 2014-08-19 18:03 -0700
    Re: difficult for loop synax :-| Kalin Kozhuharov <me.kalin@gmail.com> - 2014-08-19 23:15 -0700
      Re: difficult for loop synax :-| Ethan A Merritt <sfeam@users.sourceforge.net> - 2014-08-20 10:15 -0700
        Re: difficult for loop synax :-| Kalin Kozhuharov <me.kalin@gmail.com> - 2014-08-20 11:50 -0700
          Re: difficult for loop synax :-| Ethan A Merritt <EAMerritt@gmail.com> - 2014-08-20 17:50 -0700
            Re: difficult for loop synax :-| Kalin Kozhuharov <me.kalin@gmail.com> - 2014-08-20 23:02 -0700

csiph-web