# How can I mark the intersections on the x axis of the following graphs?

Im trying to reproduce the following graph:

I have the parabolas graphed, but I want to indicate the intercepts with the x axis by some point or cross, also I want to eliminate the numbers and the little lines that mark them. I have this:

Thanks in advance. Im new to mathematica so...

• "I have the parabolas graphed" - add the settings Mesh -> {{0}}, MeshFunctions -> {#2 &}, MeshStyle -> AbsolutePointSize[4] as a starting point. Feb 12 at 0:00
• thankssssssssss Feb 12 at 0:25
• Next time, please include code for any pictures you made with Mathematica instead of having people guess what you did. Feb 12 at 0:28

Maybe something like this?

eqs = {(x + 5)^2 - 130, (x - 2)^2 - 130};
intercepts = NumericalSort[x /. Solve[Or @@ Thread[eqs == 0], x]];
Plot[
eqs,
{x, -21, 16},
AxesStyle -> White,
Background -> Black,
Frame -> True,
FrameLabel -> {n, \[Epsilon]},
FrameStyle -> White,
FrameTicks -> None,
Mesh -> {{0}},
MeshFunctions -> {#2 &},
MeshStyle -> Directive[White, AbsolutePointSize[6]],
PlotStyle -> Red,
Ticks -> None,
Epilog -> {
White,
Text[Subscript[n, #2], {#1,
4}, {Sign[#2 - 2.5] 2, -1}] &, {intercepts,
Range[Length[intercepts]]}]
}
]


I've sort of tried to "automate" finding the zeroes and plotting the labels, but it will probably still require a bit of manual tweaking to get the labels right. Thanks to J. M.'s ennui for the Mesh/MeshFunctions/MeshStyle solution. Since I'm already calculating the intercepts, one could also just use those, but I liked the Mesh solution better.

I'm using Epilog to add the text to the plot. The Sign[#2 - 2.5]2 is just there so that the first two zeroes use -2 as their x-offset and +2 for the second two zeroes. What looks good will depend a lot on what equations you're plotting, so the positioning may vary.

• "Since I'm already calculating the intercepts, one could also just use those, but I liked the Mesh solution better." - if you're really determined to avoid redundancy, you could extract the positions of the intersection points from (a preliminary version of) the plot before putting in other stuff, but then you now need to do things in stages. Feb 13 at 4:39
• @J.M.'sennui I guess that would involve generating the plot and spelunking for the mesh points? I really wish I was better with pattern matching and Cases and that sort of thing. Some of my favourite solutions from other users seem to involve those sorts of things. I guess I will need to practice them; start simple and build from there. Feb 13 at 4:48
• Right, I'd be using Cases[] + Normal[] for that extraction (usually): Cases[Normal[g], Point[{x_, y_}] :> x, Infinity] (with the assumption that the only points added come from Mesh/MeshFunctions). A lot of people here have done this too, so if you want practice, you could try finding those answers to study them. ;) (I should also say that one of the upvotes came from me.) Feb 13 at 4:53

We can use a function as the option setting for MeshStyle to add labels to mesh points without having to post-process:

Plot[{(2 x + 2) (2 x - 1), (2 x + 1) (2 x - 2)}, {x, -2, 2},
Mesh -> {{0}}, MeshFunctions -> {#2 &},
MeshStyle -> ({Directive[White, AbsolutePointSize[10]], #, White,
MapIndexed[Text[Style[Subscript[n, {1, 3, 2, 4}[[#2[[1]]]]],
18, White], #,{{-2, 2}[[Mod[#2[[1]], 2, 1]]], -1}] &,  #[[1]]]} &),
FrameLabel -> {{Style[ϵ, 16, White], None}, {Style[n, 16, White], None}},
Background -> Black, FrameStyle -> White, AxesStyle -> White, Frame -> True,
FrameTicks -> False, ImageSize -> Large]


Use Mesh -> {{5}} to get