Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Plot in different colours' topicStudent Support Forum > General > "Plot in different colours"

Next Comment >Help | Reply To Topic
Author Comment/Response
12/18/12 12:43pm


Two questions concerning plots of functions with multiple output values:

Plot[{x, x^2}, {x, 0, 1}]
Mathematica creates two curves with different colours.
f[x_] := {x, x^2};
Plot[f[x], {x, 0, 1}]
creates two curves with the same colour.
Is there any way to get the curves in different colours?

Is there any way to create two plots from the output of f[x]? I want the same output the following code produces, but don't want to calculate the function twice:
Plot[f[x][[1]], {x, 0, 1}]
Plot[f[x][[2]], {x, 0, 1}]

Thank you very much,

URL: ,

Subject (listing for 'Plot in different colours')
Author Date Posted
Plot in different colours igor_igel 12/18/12 12:43pm
Re: Plot in different colours Michael 12/19/12 11:15am
Next Comment >Help | Reply To Topic