3

I want to create a function as follows: g[x_]:=Graphics[Text["mean=" x, {a,b}]]. That is at some coordinate point (a,b) the text, mean = x is printed. I get 3mean= when I use this function, i.e. g[3]

2 Answers2

4

Try this:

g[x_] := Graphics[Text[Row[{Style["mean=", 16], Style[x, 16]}], {0, 0}]]

Have fun!

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96
0

I would do

g[x_]:=Graphics[Text["mean="<>ToString[x], {a,b}]]
corey979
  • 23,947
  • 7
  • 58
  • 101