Skip to content
Advertisement

How to make just one marker as hollow in matplotlib plot?

I have the following code:

JavaScript

I tried the above and got the following error-

JavaScript

How do I resolve this ? or is there an alternative solution to the problem ( rather than splitting into multiple figures)?

Advertisement

Answer

If you read the documentation associated to plt.plot, if you will see that the only properties affecting markers are:

JavaScript

By looking at them, it appears that there are no way to set custom style to a single or a few selected markers. Note one of your errors, where you used markerfacecolor=markerfacecolors. However, markerfacecolor needs to be a color (either a string, or an tuple (R, G, B)), not multiple colors.

One way to get around this design choice is using multiple plot commands, masking the interested value/s. For example:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement