0

I am combining the plot of 1/x with some of the points on that line. Here is the data

sdata = { {-5, -0.2}, {-2, -0.5}, {-1, -1}, {-1/2, -2}, {-0.2, -5}, 
          {0.2, 5}, {0.5, 2}, {1, 1}, {2.0, 0.5}, {5.0, 0.2} }

This graphs all ten points.

ListPlot[{sdata}, Joined -> False]

When I use Show to combine the Plot of 1/x with the Graphics, it works great except the last two points don't appear.

Show[
     Plot[{0 , 1/x}, {x, -7, 7}, PlotRange -> {{-7, 7}, {-7, 7}}], 
     Graphics[{PointSize[Medium], Blue, Point[sdata]}]
     ]

How do I get the last two points to show up?

  • 2
    Welcome to Mathematica StackExchange! Can you please let us know which version of Mathematica you are using? Also, a screenshot would help. For example, I see all ten points in v12.3. – Domen Sep 10 '23 at 20:45
  • 1
    You could also just use Plot with Epilog, e.g., Plot[{0, 1/x}, {x, -7, 7}, PlotRange -> {{-7, 7}, {-7, 7}}, Epilog -> {PointSize[Medium], Blue, Point[sdata]}] – Bob Hanlon Sep 10 '23 at 20:55
  • 2
    Add ,PlotRange -> All after Graphics[..] before the last ]. Show[] uses the settings from the first plot. It does not try to combine the options. – Michael E2 Sep 10 '23 at 21:25
  • I am using 13.3.1.0. Screenshot follows: – Larry Lahm Sep 11 '23 at 13:52
  • When preparing to include a screenshot, I found that all the points are plotting now. I had left the application on all night. I didn't change anything, but now it graphs with all points showing. Thanks for whatever you guys did - or thanks to the Mathematica gremlins. My mind is blown. – Larry Lahm Sep 11 '23 at 14:07

0 Answers0