Re: Pass argument name to plot label
- To: mathgroup at smc.vnet.net
- Subject: [mg107826] [mg107826] Re: Pass argument name to plot label
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Sat, 27 Feb 2010 03:16:39 -0500 (EST)
- References: <hm82um$19l$1@smc.vnet.net>
"Adam" <juneappal at gmail.com> wrote in message news:hm82um$19l$1 at smc.vnet.net... >I have 15 lists with semi-descriptive names. I want to make a > function that builds a plot (histogram, actually) that has the > particular list name as a label. > > Something like this: > > hplot[list_] := > Histogram[list, PlotLabel -> Row[{list, ", mean = ", Mean[list]}]] > > When I run it, like so: > things = {1 , 2, 3}; > hplot[things] > > I want the Plot Label to be displayed as: > "things, mean = 2" > > Is this possible? I have tried SymbolName[things], HoldForm[things], > ut either way, my plot label displays as: > {1, 2, 3} , mean = 2 > You could use Row[list] as in: hplot[list_] := Histogram[list, PlotLabel -> Row[{Row[list], ", mean = ", Mean[list]}]] things = {1 , 2, 3}; hplot[things] --Nasser