Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Creating a Scatter Plot with Labeled Points

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127184] Re: Creating a Scatter Plot with Labeled Points
  • From: Mike McCraith <sandwaterhand at gmail.com>
  • Date: Thu, 5 Jul 2012 06:15:43 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201207040729.DAA01346@smc.vnet.net> <CAEtRDSc5TsW7CjhG6YLgRsCzTXkA=WOaQfYaJw7hF+dy=arn2g@mail.gmail.com>

Thanks much!

My remaining question is then is it possible to have the ordered pair read
as (0, 120) instead of {0, 120}?

On Wed, Jul 4, 2012 at 6:55 AM, Bob Hanlon <hanlonr357 at gmail.com> wrote:

> If you put the axes origin at {0, 0} it is difficult to read the labels.
>
> S11Exercise64b = {{0, 120}, {10, 119}, {20, 118}, {30, 117}, {40, 116},
> {50,
>     115}, {60, 114}, {70, 113}, {80, 112}};
>
> ListPlot[S11Exercise64b,
>  PlotStyle -> {Blue, AbsolutePointSize[6]},
>  FrameLabel -> {x, y},
>  Frame -> True,
>  Axes -> False,
>  PlotRange -> {{-4, 98}, {111, 121}},
>  Epilog -> {
>    Text[Style[#, 12], #, {-1.25, 0}] & /@
>     S11Exercise64b}]
>
> Graphics[{
>   Text[Style[#, 12], #, {-1.25, 0}] & /@
>    S11Exercise64b,
>   Blue, AbsolutePointSize[6],
>   Point[S11Exercise64b]},
>  FrameLabel -> {x, y},
>  Frame -> True,
>  PlotRange -> {{-4, 98}, {111, 121}},
>  AspectRatio -> 1/GoldenRatio]
>
>
> Bob Hanlon
>
>
> On Wed, Jul 4, 2012 at 3:29 AM, Mike McCraith <sandwaterhand at gmail.com>
> wrote:
> >
> > Hello there.  I'm trying to graph a Scatter Plot based on a given list of
> > data and have the coordinates appear near the point.
> >
> > I'm trying to save time and, instead of manually typing the text for the
> > coordinates, I'd like to be able to pull the coordinates from the list to
> > plot them point and list the text.  Here's what I have so far:
> >
> > S11Exercise64b = {{0, 120}, {10, 119}, {20, 118}, {30, 117}, {40, 116},
> > {50, 115}, {60, 114}, {70, 113}, {80, 112}};
> > ListPlot[S11Exercise64b, AxesLabel -> {x, y}, AxesOrigin -> {0, 0},
> >  Epilog -> {Blue, PointSize[.02], Point[S11Exercise64b],
> >    Text[Style[
> >      "(" && S11Exercise64b[[1, 1]] && "," && S11Exercise64b[[1, 2]] &&
> ")",
> > FontSize -> 18], {.9*S11Exercise64b[[1, 1]] + 30, .9*S11Exercise64b[[1,
> 2]]
> > + .2}],
> >    }
> >  ]
> >
> >
> > Please note, for this example, I am the first point (0, 120).
> >
> > The line that begins with the "(" && S11Exercise64b...is my attempt to
> > extract the coordinates from the given list.  Thus, next to the point, it
> > should read (0,120).  However, I am getting ( ^ 0^, ^ 120 ^).  Basically,
> > my lack of knowledge concerning strings is one of my issues.
> >
> > But, as you can see, once fixed, I'd have to create a Text[Style[ line
> for
> > every ordered pair that I have in the list.  Is there a way to automate
> > this process?  Again, a lack of know-how leads to now knowing how to do
> For
> > loops.
> >
> > Any help is always greatly appreciated.
> >
> > Thanks in advance!
> >
> > Mike
>

--20cf303ea694116ab604c4038151
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Sun-Content-Length: 3608

Thanks much!<div><br></div><div>My remaining question is then is it possibl=
e to have the ordered pair read as (0, 120) instead of {0, 120}?<br><br><di=
v class="gmail_quote">On Wed, Jul 4, 2012 at 6:55 AM, Bob Hanlon <span di=
r="ltr">&lt;<a href="mailto:hanlonr357 at gmail.com" target="_blank">han=
lonr357 at gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">If you put the axes origin at {0, 0} it is d=
ifficult to read the labels.<br>
<div class="im"><br>
S11Exercise64b = {{0, 120}, {10, 119}, {20, 118}, {30, 117}, {40, 116}, {=
50,<br>
    115}, {60, 114}, {70, 113}, {80, 112}};<br>
<br>
ListPlot[S11Exercise64b,<br>
</div> PlotStyle -&gt; {Blue, AbsolutePointSize[6]},<br>
<div class="im"> FrameLabel -&gt; {x, y},<br>
</div> Frame -&gt; True,<br>
 Axes -&gt; False,<br>
 PlotRange -&gt; {{-4, 98}, {111, 121}},<br>
 Epilog -&gt; {<br>
   Text[Style[#, 12], #, {-1.25, 0}] &amp; /@<br>
    S11Exercise64b}]<br>
<br>
Graphics[{<br>
  Text[Style[#, 12], #, {-1.25, 0}] &amp; /@<br>
   S11Exercise64b,<br>
  Blue, AbsolutePointSize[6],<br>
  Point[S11Exercise64b]},<br>
<div class="im"> FrameLabel -&gt; {x, y},<br>
</div> Frame -&gt; True,<br>
 PlotRange -&gt; {{-4, 98}, {111, 121}},<br>
 AspectRatio -&gt; 1/GoldenRatio]<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Bob Hanlon<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Jul 4, 2012 at 3:29 AM, Mike McCraith &lt;<a href="mailto:sandwat=
erhand at gmail.com">sandwaterhand at gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hello there.  I&#39;m trying to graph a Scatter Plot based on a give=
n list of<br>
&gt; data and have the coordinates appear near the point.<br>
&gt;<br>
&gt; I&#39;m trying to save time and, instead of manually typing the text f=
or the<br>
&gt; coordinates, I&#39;d like to be able to pull the coordinates from the =
list to<br>
&gt; plot them point and list the text.  Here&#39;s what I have so far:<b=
r>
&gt;<br>
&gt; S11Exercise64b = {{0, 120}, {10, 119}, {20, 118}, {30, 117}, {40, 11=
6},<br>
&gt; {50, 115}, {60, 114}, {70, 113}, {80, 112}};<br>
&gt; ListPlot[S11Exercise64b, AxesLabel -&gt; {x, y}, AxesOrigin -&gt; {0, =
0},<br>
&gt;  Epilog -&gt; {Blue, PointSize[.02], Point[S11Exercise64b],<br>
&gt;    Text[Style[<br>
&gt;      &quot;(&quot; &amp;&amp; S11Exercise64b[[1, 1]] &amp;&amp; =
&quot;,&quot; &amp;&amp; S11Exercise64b[[1, 2]] &amp;&amp; &quot;)&quot;,<b=
r>
&gt; FontSize -&gt; 18], {.9*S11Exercise64b[[1, 1]] + 30, .9*S11Exercise64b=
[[1, 2]]<br>
&gt; + .2}],<br>
&gt;    }<br>
&gt;  ]<br>
&gt;<br>
&gt;<br>
&gt; Please note, for this example, I am the first point (0, 120).<br>
&gt;<br>
&gt; The line that begins with the &quot;(&quot; &amp;&amp; S11Exercise64b.=
..is my attempt to<br>
&gt; extract the coordinates from the given list.  Thus, next to the poin=
t, it<br>
&gt; should read (0,120).  However, I am getting ( ^ 0^, ^ 120 ^).  Bas=
ically,<br>
&gt; my lack of knowledge concerning strings is one of my issues.<br>
&gt;<br>
&gt; But, as you can see, once fixed, I&#39;d have to create a Text[Style[ =
line for<br>
&gt; every ordered pair that I have in the list.  Is there a way to autom=
ate<br>
&gt; this process?  Again, a lack of know-how leads to now knowing how to=
 do For<br>
&gt; loops.<br>
&gt;<br>
&gt; Any help is always greatly appreciated.<br>
&gt;<br>
&gt; Thanks in advance!<br>
&gt;<br>
&gt; Mike<br>
</div></div></blockquote></div><br></div>

--20cf303ea694116ab604c4038151--



  • Prev by Date: Re: Creating a Scatter Plot with Labeled Points
  • Next by Date: Re: Creating a Scatter Plot with Labeled Points
  • Previous by thread: Re: Creating a Scatter Plot with Labeled Points
  • Next by thread: Re: Creating a Scatter Plot with Labeled Points