Search code examples
pythonmatplotlibplotoffsetmarkers

How to offset a marker in matplotlib?


plt.plot([2,5],[0,0], marker='^', markersize= 15, fillstyle='none')

enter image description here

What is the easiest way to make the markers go down just a little so the line touches the top of the triangle?

I'm trying to plot a beam just like the image below but I can't even place the markers right lol enter image description here


Solution

  • There is one but with filled marker, refer to marker doc:

    plt.plot([2,5],[0.3,0.3], marker=6, markersize= 15, fillstyle='full')
    

    enter image description here

    enter image description here