• To: mathgroup at smc.vnet.net
• Subject: [mg105057] Question about MeshFunctions (Plot function)
• From: Vicent <vginer at gmail.com>
• Date: Thu, 19 Nov 2009 05:24:27 -0500 (EST)

```Hello.

Thank you for all your answers to my previous question. They were very useful.

I have a question related to the MeshFunctions option in the Plot function.

I've tried this

Plot[  f[x]  ,  {x , 5 , 10}  ,  Frame -> True  ,  PlotRange -> { 2 ,
4 }  ,  AspectRatio -> 1/GoldenRatio  ,  PerformanceGoal -> "Quality"
,
Mesh -> { { 0. } }  ,  MeshFunctions -> { f1[#] & , f2[#] & }  ,
MeshStyle -> { Directive[ PointSize[ Large ] , Red ] , Directive[
PointSize[ Large ] , Blue ] }  ]

and it works OK: it plots the curve for  f[x]  and marks (in my case)
two points on it: one red and one blue, at the points where functions
f1[x]  and  f2[x]  take value  0.

I could do the same with other different functions g[x], g1[x] and g2[x].

But, is it possible to draw both curves in the same frame??  I don't
know which is the proper syntax --I mean, this:

Plot[  { f[x] , g[x] }  ,  {x , 5 , 10}  ,  Frame -> True  ,
PlotRange -> { 2 , 4 }  ,  AspectRatio -> 1/GoldenRatio  ,
PerformanceGoal -> "Quality"  ,
Mesh -> { { 0. } }  ,  MeshFunctions -> {  { f1[#] & , f2[#] & }  , {
g1[#] & , g2[#] & }  },
MeshStyle -> { Directive[ PointSize[ Large ] , Red ] , Directive[
PointSize[ Large ] , Blue ] }  ]

produces an error message. How can I get the kind of graphic I want?

By the way (and this is another question, in fact), as I've just tried
to explain, I decided to use "MeshFunctions" in order to draw a curve
with three parts distinguished in it (the boundaries being the red and
the blue point, I mean). I also was trying to do it with the
"RegionFunction" option of the "Plot" sentence, but I couldn't get the
same result (I don't want the curve to be drawn only within a given
range, but I want the whole curve to be drawn and the different parts
of the curve to be indicated). The different parts of the curve  f[x]
are bounded by the zeros of the functions  f1[x]  and  f2[x],  in my
example.

Are there any other ways to get what I want??

Please, if I didn't manage to explain my questions clearly enough, let
me know. I could attach a picture of what I want to draw.