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


Groups > comp.soft-sys.math.mathematica > #2039 > unrolled thread

Adding computed values to a Contourplot function

Started bysigismond kmiecik <sigismond.kmiecik@wanadoo.fr>
First post2011-05-03 09:43 +0000
Last post2011-05-04 10:31 +0000
Articles 4 — 4 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Adding computed values to a Contourplot function sigismond kmiecik <sigismond.kmiecik@wanadoo.fr> - 2011-05-03 09:43 +0000
    Re: Adding computed values to a Contourplot function Peter Breitfeld <phbrf@t-online.de> - 2011-05-03 12:23 +0000
    Re: Adding computed values to a Contourplot function Dan <dflatin@rcn.com> - 2011-05-04 10:35 +0000
    Re: Adding computed values to a Contourplot function Helen Read <readhpr@gmail.com> - 2011-05-04 10:31 +0000

#2039 — Adding computed values to a Contourplot function

Fromsigismond kmiecik <sigismond.kmiecik@wanadoo.fr>
Date2011-05-03 09:43 +0000
SubjectAdding computed values to a Contourplot function
Message-ID<ipoioe$g1h$1@smc.vnet.net>
Hello to everybody

How can I modify the code below (after Epilog) in order to add after 
"b^2-4ac=" its computed value and have everyhing framed?


a=0.5;b=1;c=6;d=2;e=3;f=-30;
ContourPlot[{a x^2  +b x*y + c  y^2  + d x  + e y - 30 == 0 }, {x, -12, 
10}, {y, -8, 8
}, ContourStyle-> {Red, Thick}, Axes -> True, AxesLabel-> {x,y} ,
Frame-> False,ImageSize-> {550,400}, Epilog->{Text[Style["b^2 - 
4ac=",FontSize-> 20],{5,5}]}]


I haven't found in the Mathematica 8 Documentation center a similar example.

Thanks

Sigismond Kmiecik

[toc] | [next] | [standalone]


#2073

FromPeter Breitfeld <phbrf@t-online.de>
Date2011-05-03 12:23 +0000
Message-ID<ipos40$i43$1@smc.vnet.net>
In reply to#2039
sigismond kmiecik wrote:

> Hello to everybody
>
> How can I modify the code below (after Epilog) in order to add after 
> "b^2-4ac=" its computed value and have everyhing framed?
>
>
> a=0.5;b=1;c=6;d=2;e=3;f=-30;
> ContourPlot[{a x^2  +b x*y + c  y^2  + d x  + e y - 30 == 0 }, {x, -12, 
> 10}, {y, -8, 8
> }, ContourStyle-> {Red, Thick}, Axes -> True, AxesLabel-> {x,y} ,
> Frame-> False,ImageSize-> {550,400}, Epilog->{Text[Style["b^2 - 
> 4ac=",FontSize-> 20],{5,5}]}]
>
>
> I haven't found in the Mathematica 8 Documentation center a similar example.
>
> Thanks
>
> Sigismond Kmiecik
>

You can use Inset and Row like this:

a = 0.5; b = 1; c = 6; d = 2; e = 3; f = -30;
ContourPlot[{a x^2 + b x*y + c y^2 + d x + e y - 30 == 0}, {x, -12, 
  10}, {y, -8, 8}, ContourStyle -> {Red, Thick}, Axes -> True, 
 AxesLabel -> {x, y}, Frame -> False, ImageSize -> {550, 400}, 
 Epilog -> Inset[
     Style[Row[{HoldForm[b^2-4 a c]," = ",b^2-4 a c}],Large],
  {5, 5}]]
-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

[toc] | [prev] | [next] | [standalone]


#2090

FromDan <dflatin@rcn.com>
Date2011-05-04 10:35 +0000
Message-ID<ipra56$vf$1@smc.vnet.net>
In reply to#2039
On May 3, 5:43 am, sigismond kmiecik <sigismond.kmie...@wanadoo.fr>
wrote:
> Hello to everybody
>
> How can I modify the code below (after Epilog) in order to add after
> "b^2-4ac=" its computed value and have everyhing framed?
>
> a=0.5;b=1;c=6;d=2;e=3;f=-30;
> ContourPlot[{a x^2  +b x*y + c  y^2  + d x  + e y - 30 == 0 }, {x, -12,
> 10}, {y, -8, 8}, ContourStyle-> {Red, Thick}, Axes -> True, AxesLabel-> {x,y} ,
>
> Frame-> False,ImageSize-> {550,400}, Epilog->{Text[Style["b^2 -
> 4ac=",FontSize-> 20],{5,5}]}]
>
> I haven't found in the Mathematica 8 Documentation center a similar example.
>
> Thanks
>
> Sigismond Kmiecik

Yet another form is

Epilog -> {
  Text[Style[StringForm["b^2 - 4ac = ``", b^2 - 4 a c], 20], {5, 5}]
  }

or for a 2D formatted look

Epilog -> {
  Text[
    Style[
      StringForm["`1` = `2`", HoldForm[b^2 - 4 a c], b^2 - 4 a c], 20
      ], {5, 5}
    ]
  }

StringForm[<string with x = `` parameter slots>, x] is similar to
sprintf and other standard computing language formatted text output.

[toc] | [prev] | [next] | [standalone]


#2097

FromHelen Read <readhpr@gmail.com>
Date2011-05-04 10:31 +0000
Message-ID<ipr9us$pn$1@smc.vnet.net>
In reply to#2039
On 5/3/2011 5:43 AM, sigismond kmiecik wrote:
> Hello to everybody
>
> How can I modify the code below (after Epilog) in order to add after
> "b^2-4ac=" its computed value and have everyhing framed?
>
>
> a=0.5;b=1;c=6;d=2;e=3;f=-30;
> ContourPlot[{a x^2  +b x*y + c  y^2  + d x  + e y - 30 == 0 }, {x, -12,
> 10}, {y, -8, 8
> }, ContourStyle->  {Red, Thick}, Axes ->  True, AxesLabel->  {x,y} ,
> Frame->  False,ImageSize->  {550,400}, Epilog->{Text[Style["b^2 -
> 4ac=",FontSize->  20],{5,5}]}]

Row is useful for mixing strings and expressions.


a = 0.5; b = 1; c = 6; d = 2; e = 3; f = -30;
ContourPlot[{a x^2 + b x*y + c y^2 + d x + e y - 30 == 0}, {x, -12,
   10}, {y, -8, 8}, ContourStyle -> {Red, Thick}, Axes -> True,
  AxesLabel -> {x, y}, Frame -> False, ImageSize -> {550, 400},
  Epilog -> {Text[
     Style[Framed[Row[{"b^2 - 4ac=", b^2 - 4 a c}]],
      FontSize -> 20], {5, 5}]}]


-- 
Helen Read
University of Vermont

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web