5
$\begingroup$

I have to plot several curves in logarithmic scale. I used ListLogLinearPlot and customized the Mesh option. Then the markers mixed up.

x = Range[0, 5, 0.1];
ListLogLinearPlot[{Transpose[{x, Sin[x]}], Transpose[{x, Cos[x]}]}, 
    PlotMarkers -> Automatic, Joined -> True, 
    Mesh -> {x[[{2, 3, 4, 6, 11, 21, 31}]]}]

The markers mixed up
And I try not to use the logarithmic plot but ListPlot. It's OK.

ListPlot[{Transpose[{x, Sin[x]}], Transpose[{x, Cos[x]}]}, 
    PlotMarkers -> Automatic, Joined -> True, 
    Mesh -> {x[[{2, 3, 4, 6, 11, 21, 31}]]}]

The markers are correct

I have learned the Mesh bug in PlotMarkers don't change colour for different lines. However, the logarithmic plot has a more sophisticated problem. I am using Mathematica 9. Thanks!

$\endgroup$
8
  • 1
    $\begingroup$ This probably is a bug but by convention we do not start with that tag applied. Also I removed Graphics as this appear to be only an issue with a plotting function an not the underlying Graphics system. $\endgroup$
    – Mr.Wizard
    Jun 18, 2015 at 8:26
  • $\begingroup$ Similar appearing but apparently different bug: (41706) $\endgroup$
    – Mr.Wizard
    Jun 18, 2015 at 8:29
  • $\begingroup$ The answer given in your linked question by Mr.Wizard seems to be a proper workaround for this case too, isn't it? $\endgroup$
    – Karsten7
    Jun 18, 2015 at 8:33
  • 1
    $\begingroup$ @Karsten7 That is a fairly general way to approach such problems but it is also good to have Q&A's to report/track these bugs, IMO. This one affects version 7 as well so it appears to be another longstanding PlotMarkers bug like (7201) and 41706. $\endgroup$
    – Mr.Wizard
    Jun 18, 2015 at 8:43
  • $\begingroup$ Does not happen on v10 $\endgroup$
    – yohbs
    Jun 18, 2015 at 9:13

1 Answer 1

1
$\begingroup$

As I said in the comments, this does not happen on my computer (v10.0 on Ubuntu). But you can easily circumvent this problem by a number of ways. here's one:

x = Range[0, 5, 0.1];
ptsToPlot = {2, 3, 4, 6, 11, 21, 31};
g1 = ListLogLinearPlot[{
    Transpose[{x, Sin[x]}],
    Transpose[{x, Cos[x]}]
    }, Joined -> True];
g2 = ListLogLinearPlot[{
    Transpose[{x, Sin[x]}][[ptsToPlot]],
    Transpose[{x, Cos[x]}][[ptsToPlot]]
    }, PlotMarkers -> Automatic];
Show[g1, g2]

enter image description here

$\endgroup$
2
  • $\begingroup$ I have to use this method now, though i hope Mathematica fix that bug. Thank you! $\endgroup$
    – robit
    Jun 23, 2015 at 2:26
  • $\begingroup$ But there's something more sophisticated with the log scale plotting. Such as the ticks' problem. So I now turn to matplotlib as an front end. : ( @yohbs $\endgroup$
    – robit
    Jun 23, 2015 at 9:11

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.