How to draw a dot with PyPlot?

Hello,
I can write a marker on a plot generated with PyPlot with:

scatter(X, Y, s = 25,  color = "red", marker="x")

However, I don’t like the x as a marker (it looks too much as a treasure map…). I tried to apply the unicode capabilities of Julia with marker = "·" but I get an error. I also tried with:

scatter(X, Y, s = 25,  color = "red", markershape=:circle label="x")

but I get another error:

julia> scatter(X, Y, s = 25,  color = "red", markershape=:circle, label="")
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/gigiux/.julia/packages/PyCall/ygXW2/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'AttributeError'>
AttributeError("'PathCollection' object has no property 'markershape'")
  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 2807, in scatter
    __ret = gca().scatter(
  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 1416, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 4468, in scatter
    collection.update(kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 1064, in update
    raise AttributeError(f"{type(self).__name__!r} object "

What is the correct syntax? Can I simply used unicode to pass the marker to Julia?
Thank you

Try this

scatter([0], [0], s=25, color="red", marker="o")

https://matplotlib.org/stable/api/markers_api.html

1 Like

Thank you!