Message Boards Message Boards

1
|
3701 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Avoid problem with ListPlot/PlotMarkers?

Posted 8 years ago

ListPlot[dattmp, PlotMarkers->Automatic] produces spurious data points, when dattmp contains non-numeric entries. Without PlotMarkers, the out put is correct. Customization of PlotMarkers produces the same error.

Here is the example.

dattmp = {{{0.1, 1}}, {{"unknown", -0.4}, {1, 1}, {"unknown", -0.5}}};

GraphicsRow[{ListPlot[dattmp], 
  ListPlot[dattmp, PlotMarkers -> Automatic, 
   Epilog -> {Circle[{1, 1}, Scaled[0.03]]}]}, ImageSize -> 600]
Attachments:
POSTED BY: fei.fzhou

Something quite strange is going on:

dattmp={{{0.1,1}},{{"unknown",-0.4},{1,1},{"unknown",-0.5}}};
{ListPlot[dattmp],ListPlot[dattmp,PlotMarkers->Automatic,Epilog->{Circle[{1,1},Scaled[0.03]]}]}
Column[DeleteCases[FullForm[#[[1]]]&/@%,{}|_?ColorQ|PointSize[_]|AbsolutePointSize[_]|AbsoluteThickness[_]|Directive[___],\[Infinity]],Frame->All]

Outputs:

{{{{Point[{{0.1, 1.}, {0.1, 1.}}]}, {Point[{{1., 1.}}]}}}, {}}

{{{{GeometricTransformation[Inset[\[FilledCircle],{0.,0.}],{{{1.,1.}},{{0.1,1.}},{{0.1,1.}}}]},{GeometricTransformation[Inset[\[FilledSquare],{0.,0.}],{{{1.,1.}}}]}}},{}}

The first example outputs 3 points. The second example outputs 4 datapoints. So both are actually wrong?

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract