I am new to Python, though I do have previous programming experience. My current interest is to generate good quality schematics (and maybe later on also data graphs).
I need to draw a circlar arc with an arrowhead at the end point. I have sieved through many posts and tried my hand at a few examples, but it seems I still miss some basic knowledge. So I need something like this:
http://i.stack.imgur.com/Z5V86.png
I was experimenting with the example below, trying to initially plot a circular arc, but even this does not work. I am using matplotlib.patches but I am open to other suggestions for what I need.
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse, Arc
from matplotlib import cm, colors, patches
from math import pi
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ellipse = Arc([2.5,2.5],1,1,0,0,pi,color='green', linewidth='0.5')
ax.add_patch(ellipse)
plt.show()
Well,
pi
, pass 180
. .5
and not '.5'
as linewidth parameterax.set_xlim(1.5,3.1)
and ax.set_ylim(2.4,3.7)
.You may also want to opt for another strategy, something like
ax.plot([.5],[.5],marker=r'$\circlearrowleft$',ms=100)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With