I changed the original question, to clarify what I need
I have 2 Lists, e.g.
pData1=Table[{{i, i}}, {i, Range[1, 50, 2]}];
pData2=pData1;
and corresponding markers, e.g.
marker1=Table[Style["a" <> ToString[i], Red], {i, Range[1, 50, 2]}];
marker2=Table[Style["b" <> ToString[i], Blue], {i, Range[1, 50, 2]}];
The problem
consider the following
Show[
ListPlot[pData1,
PlotMarkers -> marker1,
ImageSize -> Large],
ListPlot[pData2,
PlotMarkers -> marker2,
ImageSize -> Large]
]
which clearly makes it impossible the read both marker entries, since they overlap overlapping.
My current solution
What I want to have is both lists in one plot with non-overlapping markers. Consider the following minimal working example. My idea so far, plot both separately using ListPlot
but with slightly changed points, e.g. the red marker of {1,1}
appears at {0,1}
while the blue marker appears at {2,1}
. Finally I combine both using Show
.
Show[
ListPlot[Map[# - {{1, 0}} &, pData1],
PlotMarkers -> marker1,
ImageSize -> Large],
ListPlot[Map[# + {{1, 0}} &, pData2],
PlotMarkers -> marker2,
ImageSize -> Large]
]
I guess, there is a nicer and easier solution, which also represents the markers in a better way then my current idea does.
Note:
pData1
andpData2
can be different. Therefore it is not an option to just use, saypData1
and create a newmarker
list which account formarker1
andmarker2
.there will be a lot of points in the plane, so the solution should use a minimum on space
Bob Hanlon's solution adjusted to my needs
For completeness I also add his solution. Which, unfortunately does not fit my needs completely since it's to space consuming when there are a lot of points. However its a nice way of labeling only certain points.
pData1 = Table[{i, i}, {i, Range[1, 50, 2]}];
pData2 = pData1;
ListPlot[
{Callout[pData1[[#]], marker1[[#]], Above, CalloutStyle -> Red] & /@
Range[Length[pData1]],
Callout[pData2[[#]], marker2[[#]], Below, CalloutStyle -> Blue] & /@
Range[Length[pData2]]},
PlotStyle -> {{AbsolutePointSize[8], Red}, {AbsolutePointSize[4],
Blue}},
PlotLegends -> {"pData1", "pData2"},
ImageSize -> Large]
marker1
are the marker forpData1
and the same for the other lists. $\endgroup$