2
$\begingroup$

I need to combine these plots of fdk (in blue) and RiemannXi (in orange) into one plot with all 3 pairs of axes in a form that allows labeling. I haven't been able to figure this out.

Edit---something to make this more interesting--- We can put Zeta[s] in as the third plot and legend. We get a crossover at {0,-1/2}. Awesome connections!

So grab one of the plots below and check it out. Edit2---new plot w/o legendsnew plot

Note: we constructed a unit-square within the 3 plots that connects them together.

fdk[s_] := 1/2 - 1/(2 s + 1)
{Plot[{fdk[s], \[Pi]^(-s/2) (-1 + s) Gamma[1 + s/2] Zeta[s]}, {s, -10,
    10}, AspectRatio -> 1, AxesOrigin -> {1/2, 1/2}, Frame -> True], 
 Plot[{fdk[s], \[Pi]^(-s/2) (-1 + s) Gamma[1 + s/2] Zeta[s]}, {s, -10,
    10}, AspectRatio -> 1, AxesOrigin -> {0, 0}, Frame -> True], 
 Plot[{fdk[s], \[Pi]^(-s/2) (-1 + s) Gamma[1 + s/2] Zeta[s]}, {s, -10,
    10}, AspectRatio -> 1, AxesOrigin -> {-1/2, -1/2}, Frame -> True]}

Left Plot Center Plot Right Plot

$\endgroup$
6
  • $\begingroup$ You simply need to write "Show@" in front of your expression: {Plot....} $\endgroup$ – Daniel Huber Nov 9 '20 at 17:02
  • $\begingroup$ In v10.0 and later, RiemannXi is built-in. $\endgroup$ – Bob Hanlon Nov 9 '20 at 17:08
  • $\begingroup$ @DanielHuber, Show doesn't combine the axes, so I need a way to make them lines. $\endgroup$ – Fred Kline Nov 9 '20 at 17:19
  • $\begingroup$ @BobHanlon, the built-in function set the baseline which I didn't want. $\endgroup$ – Fred Kline Nov 9 '20 at 17:20
  • $\begingroup$ I don't know what you mean by baseline. With v12.1.1, RiemannXi[s] evaluates to the expression that you are using and produces identical plots. $\endgroup$ – Bob Hanlon Nov 9 '20 at 17:24
6
$\begingroup$
Clear["Global`*"]

fdk[s_] := 1/2 - 1/(2 s + 1)

To overlay the plots,

Plot[{fdk[s], RiemannXi[s]}, {s, -10, 10},
 AspectRatio -> 1,
 Axes -> False,
 Frame -> True,
 PlotLegends -> {fdk, RiemannXi},
 Epilog -> ({Opacity[0.3, ColorData[97][2 # + 4]],
      Tooltip[Line[{{-10, #}, {10, #}}], #],
      Tooltip[Line[{{#, -1.25}, {#, 3}}], #]} & /@ (Range[-1, 1]/2))]

enter image description here

However, this clutters up the plot. You can use Manipulate to select the origin location.

EDIT: Added Zeta[s] and used independent controls for x and y origins.

Manipulate[
 Plot[{fdk[s], RiemannXi[s], Zeta[s]}, {s, -10, 10},
  AspectRatio -> 1,
  AxesOrigin -> {originx, originy},
  Frame -> True, PlotLegends -> {fdk, RiemannXi, Zeta}],
 Row[{Control@{{originx, 0, Style["x origin", 14, Bold]}, {-1/2, 0, 
      1/2}},
   Spacer[20],
   Control@{{originy, 0, Style["y origin", 14, Bold]}, {-1/2, 0, 
      1/2}}}]]

enter image description here

$\endgroup$
1
  • $\begingroup$ I haven't figured out how to shift the verticals one spot to the right: 0,1/2,1, without changing the horizontals. Also, as mentioned in the edits, I want Zeta inserted as the third plot. If you could change this post so I could grab the new code and the image, I'll throw a bounty your way. $\endgroup$ – Fred Kline Nov 11 '20 at 17:53
7
$\begingroup$

This looks like a job for GridLines:

gridlines = {#, #} & @
 Thread[{{-1/2, 0, 1/2}, Directive[Thin, ColorData[97]@#] & /@ Range[3]}];

Plot[{fdk[s], RiemannXi[s]}, {s, -10, 10}, 
 AspectRatio -> 1, 
 Axes -> False, Frame -> True, 
 PlotLegends -> "Expressions", 
 GridLines -> gridlines]

enter image description here

Interactively position and add/remove (ALT + Click) grid lines using LocatorPane:

plot = Plot[{fdk[s], RiemannXi[s]}, {s, -10, 10}, AspectRatio -> 1, 
   Axes -> False, Frame -> True, PlotLegends -> "Expressions", 
   ImageSize -> Large];

DynamicModule[{pts = {#, #} & /@ {-1/2, 0, 1/2}}, 
 LocatorPane[Dynamic[pts],
  Dynamic @ Show[plot, 
    GridLines -> (Thread[{#, Directive[Thin, #] & /@ 
           ColorData[97] /@ Range[Length @ pts]}] & /@ Transpose[pts]), 
    ImagePadding -> 30, 
    FrameTicks -> {{Automatic, pts[[All, 2]]}, {Automatic, pts[[All, 1]]}}], 
  Appearance -> None, LocatorAutoCreate -> {1, 5}]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.