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


Groups > comp.soft-sys.math.mathematica > #2275

Re: PlotStyle does not work when Plot is fed Table

From Szabolcs Horvát <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: PlotStyle does not work when Plot is fed Table
Date 2011-05-11 08:25 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iqdh6b$16g$1@smc.vnet.net> (permalink)
References <iqa0ds$d9u$1@smc.vnet.net>

Show all headers | View raw


On 2011.05.10. 2:21, ValeX wrote:
> Hello,
> take for instance this example:
>
> Plot[Table[x^i, {i, 1, 3}], {x, 0, 1.5}, PlotStyle ->  {Red, Green,
> Blue}]
>
> Mathematica gives me all the curves in blue. Any ideas?
> Thanks.
>

In order for Plot to be able to work correctly, you need to give it an 
explicit list of the functions to be plotted.  In this example you can 
achieve this by evaluating the Table before Plot sees it:

Plot[Table[x^i, {i, 1, 3}] // Evaluate, {x, 0, 1.5},
  PlotStyle -> {Red, Green, Blue}]

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

PlotStyle does not work when Plot is fed Table ValeX <rjovale@gmail.com> - 2011-05-10 00:21 +0000
  Re: PlotStyle does not work when Plot is fed Table Szabolcs Horvát <szhorvat@gmail.com> - 2011-05-11 08:25 +0000

csiph-web