0
$\begingroup$

Is there a slot representation of the Key in an Association? For instance, I would like to do same transformation with an Association:

Plot[#2, {x, 0, 10}, PlotLabel -> #1] & @@@ {{"A", Sin[x]}, {"B", Sin[2 x]}, {"C", Sin[3 x]}}

What if I have:

<|"A" -> Sin[x], "B" -> Sin[2 x], "C" -> Sin[3 x]|>

I can of course do this in multiple ways, but prefer the simple and elegant way...

$\endgroup$
3
  • $\begingroup$ KeyValueMap[ Plot[#2, {x, 0, 10}, PlotLabel -> #1] &, <|"A" -> Sin[x], "B" -> Sin[2 x], "C" -> Sin[3 x]|> ] $\endgroup$
    – Kuba
    Dec 9 '15 at 13:40
  • $\begingroup$ Thank you! Maybe its just, but I would like a KeyValueApply... $\endgroup$
    – Simon
    Dec 9 '15 at 14:01
  • $\begingroup$ You mean the name could be misleading? Right, that's probably arguable. $\endgroup$
    – Kuba
    Dec 9 '15 at 14:04

Browse other questions tagged or ask your own question.