How to plot a function line with Markers:
f[x_, m_] = m Sin[x]
g[x_, m_] = 2 m Cos[x]
Manipulate[
Plot[{f[x,m], g[x,m]}, {x, 0, 10},
PlotLegends -> Automatic], {m, 0, 5}]
Edit 3: please see below
f[x_, m_] := m Sin[x]
g[x_, m_] := 2 m Cos[x]
r0 = Table[{x, f[x, m]}, {x, 0, 10}];
r1 = Table[{x, g[x, m]}, {x, 0, 10}];
Manipulate[
ListPlot[{r0, r1} /. m -> mm,
PlotMarkers -> {"\[FilledSquare]", "\[FilledCircle]"},
Joined -> True, PlotRange -> {Automatic, {-5, 5}},
InterpolationOrder -> 10], {mm, 1, 5}]
Edit: thanks to @Syed
If I understand correctly something like the following:
f[x_, m_] := m Sin[x]
g[x_, m_] := 2 m Cos[x]
Manipulate[
DiscretePlot[Evaluate[{f[x, m], g[x, m]}], {x, 0, 10},
PlotRange -> {-10, 10}, Filling -> None,
PlotMarkers -> {{"\[FilledSquare]", 10}, {"\[FilledCircle]", 10}},
PlotLegends -> "Expressions"], {m, 0, 5}]
Edit 2: connecting the points
Manipulate[
DiscretePlot[Evaluate[{f[x, m], g[x, m]}], {x, 0, 10},
PlotRange -> {-10, 10}, Filling -> None,
PlotMarkers -> {{"\[FilledSquare]", 10}, {"\[FilledCircle]", 10}},
PlotLegends -> "Expressions", Joined -> True], {m, 0, 5}]
, PlotRange -> {-10, 10}
for visual benefit.
$\endgroup$
I am not sure if this is what you meant or not. (I assumed you meant your Manipulate was not working). Will delete if not.
f[x_, m_] := m Sin[x]
g[x_, m_] := 2 m Cos[x]
Manipulate[
Plot[{f[x, m], g[x, m]}, {x, 0, 10}, PlotLegends -> Automatic,
PlotRange -> {Automatic, {-5, 5}}],
{m, 0, 5},
TrackedSymbols :> {m}]
The reason Manipulate did not work, is because m
did not show in the expression. The control variable must show in the expression for it to work.
Manipulate
. You can photoshop what marker you want and at which points perhaps. Thanks. $\endgroup$PlotMarkers
at the same time. Anyway, I like your answer :-) $\endgroup$