1

I noticed the following strange behaviour:

Let us first define an array of functions

    g[k_] := {Sin[k], 2*Sin[k]}
    gg = g[k]

When I plot this array of functions with

    DiscretePlot[{Sin[k], 2 Sin[k]}, {k, 1, 50}]

each of the two sets of points have a different colour. But, both

    DiscretePlot[gg, {k, 1, 50}]

and

    DiscretePlot[g[k], {k, 1, 50}]

show the two sets of points in blue.

I am more interested in the second case, because should the array of functions be large, it is more comfortable to use the definitions like g and gg given above. But I want to preserve the different colours. How do I do that?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
altroware
  • 274
  • 3
  • 13
  • 1
    Use DiscretePlot[Evaluate@gg, {k, 1, 50}] and DiscretePlot[Evaluate@g[k], {k, 1, 50}]? – kglr Jun 27 '14 at 18:34
  • 1
    Possible duplicate: http://mathematica.stackexchange.com/q/1731/484 –  Jun 27 '14 at 18:45
  • Thanks, yes you are right my question is a duplicate - sorry for this - and Evaluate solves the problem. – altroware Jun 28 '14 at 00:58

0 Answers0