Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10800 > unrolled thread

Re: Creating a Scatter Plot with Labeled Points

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-07-05 10:15 +0000
Last post2012-07-05 10:15 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Creating a Scatter Plot with Labeled Points Bob Hanlon <hanlonr357@gmail.com> - 2012-07-05 10:15 +0000

#10800 — Re: Creating a Scatter Plot with Labeled Points

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-07-05 10:15 +0000
SubjectRe: Creating a Scatter Plot with Labeled Points
Message-ID<jt3pgp$13o$1@smc.vnet.net>
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@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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web