MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How can I plot with Mathematica two function in the same graphic?


Hi Mario,

Other than Plot[{x,x^2},...] you can use Show[] as well.

plt1=Plot[x,{x,0,1}];
plt2=Plot[x^2,{x,0,1}];
Show[plt1,plt2]

Lawrence


Mario Latens wrote:
> How can I plot with Mathematica two function in the same graphic?
> I explain better:
> I'd like to draw a) y=x and b) y=x^2 in the same axes X-Y (in order to
> compare a and b).
> 
> 
> Thank you in advance, Mario.
> 
> From: "David Park" <djmp at earthlink.net>
To: mathgroup at smc.vnet.net
> Subject: [mg36513] RE:  How can I plot with Mathematica two function in the same graphic?
> Date: Mon, 09 Sep 2002 04:27:04 GMT
> 
> Mario,
> 
> Here is a fancy version of your plot. I used Text statements within an
> Epilog option to label the two curves. The regular plot statement allows you
> to plot a series of functions inclosed in a list.
> 
> Needs["Graphics`Colors`"]
> 
> 
> Plot[{x, x^2}, {x, 0, 1},
>     PlotStyle -> {Black, Blue},
>     Frame -> True,
>     FrameLabel -> {x, y},
>     PlotLabel -> "Comparison of Two Functions",
>     Epilog -> {Text[x, {0.5, 0.55}], Blue, Text[x^2, {0.7, 0.4}]},
>     Background -> Linen,
>     ImageSize -> 500];
> 
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/
> 
> 
> From: Mario Latens [mailto:mario.lat at libero.it]
To: mathgroup at smc.vnet.net
> 
> How can I plot with Mathematica two function in the same graphic?
> I explain better:
> I'd like to draw a) y=x and b) y=x^2 in the same axes X-Y (in order to
> compare a and b).
> 
> 
> Thank you in advance, Mario.
> 
> 
> 


  • Prev by Date: help in Numerical Intergation
  • Next by Date: Re: word processing with mathematica
  • Previous by thread: RE: How can I plot with Mathematica two function in the same graphic?
  • Next by thread: Re: How can I plot with Mathematica two function in the same graphic?