2
$\begingroup$

I'm sure this is an easy one, but I would like to know how to put multiple lines of text within the same frame in a graphic Inset. I can't seem to find any examples within the documentation and it keeps not quite working for me.

Relevant Code Snippet:

Inset[Framed[
Row[{{"Average Current: ", avgCurrent, 
 " \[Mu]A" }, {"Number of Data Points: ", noPoints}}], 
Background -> White, RoundingRadius -> 5], Scaled[{.85, .9}]]

Though this puts both statements on the same line and indepedently wrapped in braces.

I've tried just inserting ",\n," between the two lines but that was no better.

Thanks for any help!


In case anyone would like the full plot code i'm using (in case I've missed something important:

ListLinePlot[{Ni59s[1], Ni59s[2]}, PlotRange -> {{0, 7000}, {0, 25}}, 
PlotStyle -> {Directive[RGBColor[0., 0.75, 0.85], 
AbsoluteThickness[2.5]]}, PlotTheme -> "Detailed", 
Epilog -> {{Dashed, Line[{{1805, 14.5`}, {1869, 21.6`}}]}, {Red, 
AbsolutePointSize[4], Point[dataNi59s]}, {GrayLevel[.5], 
InfiniteLine[{{0, 1}, {1, 1}}]}, 
Inset[Framed[
 Row[{{"Average Current: ", avgCurrent, 
    " \[Mu]A" }, {"Number of Data Points: ", noPoints}}], 
 Background -> White, RoundingRadius -> 5], Scaled[{.85, .9}]]}, 
PlotLabel -> 
"Comparison of Current Yields from Nickel Cathode 59 (Interpolated) \
(Anomolous Points Removed)", 
PlotLegends -> 
Placed[LineLegend[{"Cathode 59 - Nickel"}, 
LegendFunction -> "Panel"], {0.85, 0.45}], 
LabelStyle -> {Black, Bold}, Frame -> {{True, False}, {True, False}},
FrameLabel -> {"Cathode Runtime (minutes)", "Current (\[Mu]A)"}, 
ImageSize -> {850, 550}, InterpolationOrder -> 2]
$\endgroup$
  • 1
    $\begingroup$ Replacing Row with Grid should do what you want here. $\endgroup$ – b3m2a1 Dec 4 '17 at 4:24
2
$\begingroup$

You can use Column:

ListLinePlot[{Ni59s[1], Ni59s[2]}, PlotRange -> {{0, 7000}, {0, 25}}, 
 PlotStyle -> {Directive[RGBColor[0., 0.75, 0.85], 
AbsoluteThickness[2.5]]}, PlotTheme -> "Detailed", 
Epilog -> {{Dashed, Line[{{1805, 14.5`}, {1869, 21.6`}}]}, {Red, 
AbsolutePointSize[4], Point[dataNi59s]}, {GrayLevel[.5], 
InfiniteLine[{{0, 1}, {1, 1}}]}, 
 Inset[Framed[
 Column[{"Average Current: " <> ToString@avgCurrent <> " \[Mu]A", 
   "Number of Data Points: " <> ToString@noPoints}], 
 Background -> White, RoundingRadius -> 5], Scaled[{.85, .9}]]}, 
 PlotLabel -> 
 "Comparison of Current Yields from Nickel Cathode 59 (Interpolated) \
  (Anomolous Points Removed)", 
  PlotLegends -> 
 Placed[LineLegend[{"Cathode 59 - Nickel"}, 
 LegendFunction -> "Panel"], {0.85, 0.45}], 
 LabelStyle -> {Black, Bold}, Frame -> {{True, False}, {True, False}},
 FrameLabel -> {"Cathode Runtime (minutes)", "Current (\[Mu]A)"}, 
 ImageSize -> {850, 550}, InterpolationOrder -> 2]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.