MathGroup Archive 2008

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

Search the Archive

Re: Problem for using "Epilog" to plot legend

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89152] Re: Problem for using "Epilog" to plot legend
  • From: nano2giga at gmail.com
  • Date: Tue, 27 May 2008 07:15:00 -0400 (EDT)
  • References: <ftmtuu$4ob$1@smc.vnet.net>

On 11 Apr, 00:46, davis <davis.v.... at gmail.com> wrote:
> Dear Group
>
> i want to use "Epilog" to plot alegend,but i have a problem for the "Line" command.
>
> ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}}, Joined -> True,
>  PlotMarkers -> Automatic,
>  Epilog ->
>   Inset[Framed@
>     Column[{Graphics[{DotDashed, Line[{{1, 0}, {2, 0}}]}] Style["a"],
>       Graphics[{Dotted, Line[{{1, 0}, {2, 0}}]}] Style["b"]},
>      Spacings -> 0, ItemSize -> {15, 0.5}], {1.25, 7}]]
>
> the space between different rows in "legendarea" are really large,
>
> but if i change the Line condition,such like below
>
> ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}}, Joined -> True,
>  PlotMarkers -> Automatic,
>  Epilog ->
>   Inset[Framed@
>     Column[{Graphics[{DotDashed, Line[{{100, 0}, {2, 0}}]}]
>        Style["a"],
>       Graphics[{Dotted, Line[{{100, 0}, {2, 0}}]}] Style["b"]},
>      Spacings -> 0, ItemSize -> {15, 0.5}], {1.25, 7}]]
>
> the rows became close to each other, but the length of the lines became too long
>
> how can i solve this?
>
> thank you
Adjust a little bit, and it works.

ListPlot[{{1, 2, 3, 5, 8}, {2, 3, 6, 9, 10}}, Joined -> True,
 PlotMarkers -> Automatic,
 Epilog ->
  Inset[Framed@
    Graphics[{{DotDashed, Line[{{1, 0}, {2, 0}}]},
      Text[Style["a", Bold, 8], {2.5, 0}], {Dotted,
       Line[{{1, -1}, {2, -1}}]},
      Text[Style["b", Bold, 8], {2.5, -1}]}, ImageSize -> 40,
     AspectRatio -> 0.4], {1.25, 7}]]


  • Prev by Date: Re: Integrate vs NIntegrate
  • Next by Date: Re: Range of Use of Mathematica
  • Previous by thread: Re: NDSolve from negative to positive time
  • Next by thread: Problems when i try to solve a system of equations