Group Abstract Group Abstract

Message Boards Message Boards

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

Add a line (y=a*x+b) to a ListPlot graph?

Anonymous User
Anonymous User
Posted 5 years ago

I am studying the Riemann zeta function, and I've created this cool graph which for a given Re(s) in the critical strip, it generates a graph of values given by a certain function, y=f(x).

When the graph crosses a certain line (y=2 x), that point represents a zero of the zeta function. Anyway, I'm not gonna give many details because this is a preliminary paper, a work in progress, and I don't want to say things that are not proven yet.

But anyway, how do I add a line (y=2 x) to this plot? Thanks so much.

Here's my code (redacted):

 $MaxExtraPrecision = 500; Clear[t]; r = 3/4; x0 = -3/2; m = 3; l = 
  Round[x0 + m, 1]; k = 80; 
 f[t_] :=redacted; s = 
  Table[{n = x0 + m (q - 1)/(k - 1), f[n]}, {q, 1, k}]; g2 = 
  ListPlot[s, Joined -> True, ImageSize -> Large, 
   PlotStyle -> {Thickness[Tiny]}, 
   GridLines -> {Table[i, {i, -l, l}], Table[f[i], {i, -l, l}]}]

Please let me know where in this code I need to add the line, and more importantly how. Thanks so much!

enter image description here

POSTED BY: Anonymous User
5 Replies

And what about this?

f[t_] := t^2;
Clear[t]; r = 3/4; x0 = -3/2; m = 3; l = Round[x0 + m, 1]; k = 80;
s = Table[{n = x0 + m (q - 1)/(k - 1), f[n]}, {q, 1, k}]; g2 = 
 ListPlot[s, Joined -> True, ImageSize -> Large, 
  PlotStyle -> {Thickness[Tiny]},
  Epilog -> Line[{{-2, -4}, {2, 4}}]]
POSTED BY: Hans Dolhaine
Anonymous User
Anonymous User
Posted 5 years ago

I think it's even better. Another idea is to add more than one table to the plots, this extra table will have the points along a line. I think I can do that, right? Because my idea is to add more than one curve to the same graph actually. If I can't do that I will be disappointed. No need to reply, I already found the perfect solution. Yippie, this will do the trick I want.

f[t_] := t^2;
Clear[t]; r = 3/4; x0 = -3/2; m = 3; l = Round[x0 + m, 1]; k = 80;
s = Table[{n = x0 + m (q - 1)/(k - 1), f[n]}, {q, 1, k}]; s2 = 
 Table[{n = x0 + m (q - 1)/(k - 1), 2 n}, {q, 1, k}]; g2 = 
 ListPlot[{s, s2}, Joined -> True, ImageSize -> Large, 
  PlotStyle -> {Thickness[Tiny]}]

Thanks Mathematica, for giving us the chance to easily do such cool stuff!

Attachment

Attachments:
POSTED BY: Anonymous User

For example

f[t_] := t^2;
Clear[t]; r = 3/4; x0 = -3/2; m = 3; l = Round[x0 + m, 1]; k = 80;
s = Table[{n = x0 + m (q - 1)/(k - 1), f[n]}, {q, 1, k}]; g2 = 
 ListPlot[s, Joined -> True, ImageSize -> Large, 
  PlotStyle -> {Thickness[Tiny]},
  Epilog -> {Line[{{-2, -4}, {2, 4}}],
    Line[{{-2, -4}, {3, 4}}],
    Line[{{-2, -4}, {2, 5}}],
    Line[{{-2, -4}, {3, 5}}
     ]}]
POSTED BY: Hans Dolhaine
Posted 5 years ago

Is this enough to show you how to add that line?

Show[
  ListPlot[s,Joined->True,ImageSize->Large,etc...],
  Plot[2x,{x,-1,1}]
]
POSTED BY: Bill Nelson
Anonymous User
Anonymous User
Posted 5 years ago

Ok, I will try that tomorrow and report if it suits me. Thanks so much.

POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard