I've got two sets of points, plotted with ListPLot
. I would like the second set to have one point of each color specified. I've tried using Directive
but cannot seem to find the correct syntax.
A[q_] := Cos[q/20];
Show[ListPlot[Table[{q, A[q]}, {q, Range[100, 150]}]],
ListPlot[Table[{q, A[q]}, {q, Range[110, 125, 5]}],
PlotStyle -> {{PointSize[Large], Red},
{PointSize[Large], Orange},
{PointSize[Large], Blue},
{PointSize[Large], Purple}}],
Frame -> True, Axes -> False]
ListPlot[List /@ Table[{q, A[q]}, {q, Range[110, 125, 5]}], PlotStyle -> {{PointSize[Large], Red}, {PointSize[Large], Orange}, {PointSize[Large], Blue}, {PointSize[Large], Purple}}]
$\endgroup$List /@
mapsList
to each ordered pair, essentially making each pair of coordinates a list of a list? Why does this work? $\endgroup$ListPlot
accepts multiple sets of data as an argument, in the format of{list1, list2, list3, ...}
. So I just made each point into a list of points (actually a list consisting of a single point) instead. That makes your syntax forPlotStyle
work $\endgroup$PointSize[Large]
?" Probably we can useMap
again, or a similar construct. $\endgroup$p[a_] := {PointSize[Large], a}; p /@ {Red, Orange, Blue, Purple}
$\endgroup$