# Mathematica:how to plot a maximum point in a graph

by shafieza_garl
Tags: graph, mathematicahow, maximum, plot, point
 P: 20 anyone can help me to plot a point.  r = Plot[Sin[j], {j, 0, Pi}]; what i am doing is i use FindMaximum first to know the point of maximum. FindMaximum[Sin[j], {j, Pi}] then i manually key in the x,y coordinate from the search. onedot = ListPlot[{{1.5707963267948966, 1}}, PlotStyle -> {Hue[0.67], AbsolutePointSize[7]}]; Show[r, onedot] is there any way i can plot the maximum point without key-in manually using the findmaximum point. thanks
P: 4,572
 Quote by shafieza_garl anyone can help me to plot a point.  r = Plot[Sin[j], {j, 0, Pi}]; what i am doing is i use FindMaximum first to know the point of maximum. FindMaximum[Sin[j], {j, Pi}] then i manually key in the x,y coordinate from the search. onedot = ListPlot[{{1.5707963267948966, 1}}, PlotStyle -> {Hue[0.67], AbsolutePointSize[7]}]; Show[r, onedot] is there any way i can plot the maximum point without key-in manually using the findmaximum point. thanks
One suggestion I have is to create a test function with {-1,0} {0,maxpoint} and {+1,0) and then plot that data like any other data. If you need to adjust scaling or if Mathematica produces a very narrow graph then make the non-max points larger in the respective directions.

If you need the point at its original position then just add the x coordinate to every x point in the dataset.
 P: 1,030 r = Plot[Sin[j], {j, 0, Pi}]; onedot = ListPlot[{j, 1} /. Rest[FindMaximum[Sin[j], {j, Pi}]], PlotStyle -> {Hue[0.67], AbsolutePointSize[7]}]; Show[r, onedot]
P: 20
Mathematica:how to plot a maximum point in a graph

 Quote by Bill Simpson r = Plot[Sin[j], {j, 0, Pi}]; onedot = ListPlot[{j, 1} /. Rest[FindMaximum[Sin[j], {j, Pi}]], PlotStyle -> {Hue[0.67], AbsolutePointSize[7]}]; Show[r, onedot]
thanx 4 ur reply.1 more question. if i dont want to put value 1 by myself and i want the same as finding the j-value(using findmaximum).
onedot = ListPlot[{j, k} /. Rest[FindMaximum[Sin[j], {j, Pi}]],  PlotStyle -> {Hue[0.67], AbsolutePointSize[7]}];
is this possible to do?
thanks again.
 P: 1,030 r = Plot[Sin[j], {j, 0, Pi}]; onedot = ListPlot[{j, Sin[j]} /. Rest[FindMaximum[Sin[j], {j, Pi}]], \ PlotStyle -> {Hue[0.67], AbsolutePointSize[7]}]; Show[r, onedot]

 Related Discussions Math & Science Software 8 General Physics 4 Calculus 5 Math & Science Software 0 Math & Science Software 0