pgfplots issue: solid and filled markers with dashed lines


You have

\addplot+[dashed,color=blue,mark=*,mark options=solid,{fill=markercolor}]

so the only thing in mark options is solid, while fill=markercolor is a separate entry in the list of options, and applies to the plotted line, not the markers. You want to move that brace, so you have

\addplot+[dashed,color=blue,mark=*,mark options={solid,fill=markercolor}]

enter image description here


Related videos on Youtube

Jesse Chan
Author by

Jesse Chan

Updated on May 06, 2020


  • Jesse Chan
    Jesse Chan over 3 years

    I'm trying to create a plot with pgfplots which has

    1. a solid marker filled in with a specified color
    2. a dashed line.

    The dashed line makes the marker dashed as well, so I put "solid" as an option to retain the marker outline. However, if I combine this with a filled in marker, pgfplots fills in everything above the line as well.

    enter image description here

    Is there a way to fix this? The code to generate the figure is attached:

    \definecolor{markercolor}{RGB}{124.9, 255, 160.65}
    \addplot+[color=blue,mark=*,mark options={fill=markercolor}]
    \addplot+[dashed,color=blue,mark=*,mark options={fill=markercolor}]
    \addplot+[dashed,color=blue,mark=*,mark options=solid,{fill=markercolor}]
    \legend{Solid line, Dashed line with dashed marker, Dashed line with solid marker}