MathGroup Archive 1999

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

Search the Archive

Re: Math expression on figure

  • To: mathgroup at
  • Subject: [mg18329] Re: Math expression on figure
  • From: paulh at (P.J. Hinton)
  • Date: Sun, 27 Jun 1999 15:11:20 -0400
  • Organization: Wolfram Research, Inc.
  • References: <7l3mdv$>
  • Sender: owner-wri-mathgroup at

In article <7l3mdv$gbt at>, riotorto at (Mario Rodriguez-Riotorto) writes:

> I want to superimpose a mathematical expression in a certain position on
> a figure.
> How can I do that in Mathematica?

Use a Text[] primitive in an Epilog option in your Graphics-
generating function.

(* Here is the math formula expressed as a string with embedded 
boxes. *)

In[1]:= frml = "\!\(sin\^2\)(x)"; 

(* The Epilog option specifies what is drawn after the graphic 
is generated.   Text[] is a primitive that is used to put text
within a graphic. *)

In[2]:= Plot[Sin[x^2], {x, 0, 2Pi}, 
    Epilog -> 
      Text[TraditionalForm[frml], {0.9, -0.5}, 
        TextStyle -> {FontSize -> 14}]];

For further information see the following sections of _The 
Mathematica Book_ (Fourth Edition).

2.8.12 -- Discusses how to represent two-dimensional typeset forms
within strings.

2.9.16 -- Provides introduction on how to add text to graphics.

2.9.3 -- Defines Epilog and its relatives.

P.J. Hinton	
Mathematica Programming Group		paulh at
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.

  • Prev by Date: writing mathematica data to a tab delimited file??
  • Next by Date: problems with series of multiple integrals
  • Previous by thread: Math expression on figure
  • Next by thread: Re: "At long last, Sir, have you no shame?"