This is related to the following thread "Plot curves different way so that one can see them when printing black and white"

But because my curves are close to each other in some regions, so just manipulating the "dotted" and "dashed" cannot clearly distinguish those curves in those regions. Changing thickness works better, but is not aesthetically pleasing.

I've seen the following cross-dotted style, can Mathematica replicate it? Or something similar such as strings of tiny squares or circles etc? enter image description here


1 Answer 1


The way I do this is by using ListPlot witch has an option PlotMarkers. It can be anything:

    Table[Sin[x], {x, 0, Pi, 0.1}],
    PlotMarkers -> "x"

will yield this enter image description here or even this:

   Table[Sin[x], {x, 0, Pi, 0.1}],
   PlotMarkers -> (\!\(\*
      TagBox[PolygonBox[{{0, 0}, {1, 0}, {0, 1}}],
      ImageSize->{13.999999999999815`, Automatic}]\))

with the following result

enter image description here

Have a look at the reference page PlotMarkers


Saw the comment right before posting, but still here's how I would have done it:

SetAttributes[StepData, HoldAll];
StepData[fun_, xMin_, xMax_, dStep_] := Module[
   xCur = xMin;
   res = Reap[
      While[xCur <= xMax,
       Sow[{xCur, fun[xCur]}];
       xCur += dx /. FindRoot[
          EuclideanDistance[{xCur, fun[xCur]}, {xCur + dx, fun[xCur + dx]}] == dStep,
          {dx, 0, 0, dStep}
      ][[2, 1]];

func[x_] := Sin[x];
 StepData[func, 0, Pi, 0.5],
 PlotMarkers -> {Graphics[
    {Black, Thin, Line[{{-0.1, -0.1}, {+0.1, +0.1}}], 
     Line[{{-0.1, +0.1}, {+0.1, -0.1}}]}
    ], 0.05}

With the following result enter image description here

  • $\begingroup$ Thank you so much for your prompt help! But is it possible to allocate the tiny marks evenly? $\endgroup$
    – Wendy
    Feb 20, 2016 at 4:42
  • $\begingroup$ @Wendy that can be done, but it is non-trivial unless your curves are really straight lines or simple functions whose inverse is known. See the answers to this question for the general case: Generating evenly-spaced points on a curve. $\endgroup$
    – MarcoB
    Feb 20, 2016 at 5:30
  • $\begingroup$ Updated my answer. $\endgroup$
    – Andrew S.
    Feb 20, 2016 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.