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


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

Re: difficult for loop synax :-|

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Ethan A Merritt <EAMerritt@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: difficult for loop synax :-|
Date Tue, 19 Aug 2014 18:03:27 -0700
Organization made entirely of Lego
Lines 40
Message-ID <lt0s51$jbh$1@dont-email.me> (permalink)
References <9bc28e9e-f776-4407-8acc-f0bc7a964bcf@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
Injection-Date Wed, 20 Aug 2014 01:03:30 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="7bbfccb08e3cb0f92ebf95516f5f5a81"; logging-data="19825"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JbSD2kDf3fNlMfRIGj/Aj"
User-Agent KNode/4.11.4
Cancel-Lock sha1:a1vmz4/r+n8knldmJ7j6GyaVrnA=
Xref csiph.com comp.graphics.apps.gnuplot:2554

Show key headers only | 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