Message Boards Message Boards

0
|
13111 Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Plot several points as coordinates and colouring.

Posted 12 years ago
Hi,

I'm trying to get a second point , which is a coordinate, onto my plot, but I can't seem to find a way to get past the constant erroring. As for coloring the point/points I seem to have the same problem. 
Plot[y = Sqrt[x], {x, 0, 300},
Epilog -> {PointSize[0.018], Point[{10, 9}]}, PlotStyle -> Brown]

The second point is supposed to be (70,9), and I have tried making a Table, ListPlot and such, but so far no result. 
POSTED BY: Jakob A
5 Replies
Posted 12 years ago
Here is something I was working on a while back, it contains most of the ideas you are looking for and some others you may find useful.
 In[8]:= ContourPlot[{x + 4 x^2 - 8 y + 5 x y + 4 y^2 == 0,
   y == 8 x + 27, y == -x - 1, y == -(8/11) x + 25/11, y == 1/8 x ,
   y == -(11/8) x + 2, y == -x + 7/13}, {x, -4, 2}, {y, -1, 5},
  Epilog -> {Blue, PointSize[Large],
    Point[{{-3, 3}, {-2, 1}, {-1, 3}, {0, 0}, {0, 2}, {4/3, 1/
       6}, {-(8/9), -(1/9)}, {-(8/19), 49/19}, {-(17/6), 13/
       3}, {-(28/9), 19/9}, {-(16/13), 23/
       13}, {-(2/39) (24 + 5 Sqrt[39]),
       23/13 + 10/Sqrt[39]}, {2/39 (-24 + 5 Sqrt[39]),
      23/13 - 10/Sqrt[39]}}], Joined -> True, Mesh -> Full},
GridLines -> {Range[-4, 2], Range[-1, 5]}]
POSTED BY: Paul Cleary


Plot for the last bit of code.  Should have put it in the same post.
POSTED BY: Bruce Miller
To make all the points the same color, include a color directive in the list as you did the size directive.
coords = Table[{x, 9}, {x, 10, 250, 60}];

Plot[y = Sqrt[x], {x, 0, 300},
     Epilog -> {Red, PointSize[0.018], Point[ coords ]},
     PlotStyle -> Brown]

To make the points different colors, it's probably easiest to make the Points in a Table and include
the color directive there.  PlotStyle still applies to the curve. The PointSize directive goes in the
Eplilog list before the Points.
coordsR = Table[{Hue[x/300], Point[{x, 9}]}, {x, 10, 250, 60}];

Plot[y = Sqrt[x], {x, 0, 300},
    Epilog -> {PointSize[0.018], coordsR},
    PlotStyle -> Brown]
POSTED BY: Bruce Miller
Posted 12 years ago
Oh... Thank you!

And as for the colouring then?
POSTED BY: Jakob A
I am not sure what the problem is.

To include more than one point, give a list of the {x,y}  coordinates, like
   Point[ { {x1,y1}, {x2,y2}, ..}

Plot[y = Sqrt[x], {x, 0, 300},
   Epilog -> {PointSize[0.018], Point[{{10, 9}, {70, 9}}]},
   PlotStyle -> Brown]

To make a list of coordinates with Table, include the expressions for x and y in a list,
coords = Table[{x, 9}, {x, 10, 250, 60}];

Plot[y = Sqrt[x], {x, 0, 300},  Epilog -> {PointSize[0.018], Point[ coords ]},
   PlotStyle -> Brown]
POSTED BY: Bruce Miller
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract