Circular Arrow Closed Path

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Circular Arrow Closed Path

Amit Yaron
Hi,

Does this shape already exist in Matplotlib modules?
I've attached an example prepared with LibreOffice Draw.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

arrowExample.png (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Circular Arrow Closed Path

vincent.adrien@gmail.com
Hi Amit,

You may find usseful ressources about arrow shapes in Matplotlib at
https://matplotlib.org/users/annotations.html, with examples on how to
use the `matplotlib.axes.Axes.annotate` method(, which heavily relies on
the `matplotlib.patches.FancyArrowPatch` if you are actually more
interested in how things are done under the hood).

Here is a quick example of what you can expect more or less
out-of-the-box from `ax.annotate`:
```python
import matplotlib.pyplot as plt

fig, ax = plt.subplots(num='demo_arrow_with_annotate.png',
                        figsize=(3, 3))

ax.annotate("",
             xy=(0.5, 0.8), xycoords='data',
             xytext=(0.5, 0.2), textcoords='data',
             size=40, va="center", ha="center",
             arrowprops=dict(arrowstyle="simple",  # <-- ~ LO style
                             facecolor="DeepPink", edgecolor="none",
                             connectionstyle="arc3,rad=1"),
             )

plt.show()
```

If you really want a specific patch shape that you cannot get by
tweaking the existing arrow shapes, it should still be possible to
define a patch directly with vertices and Bézier curves.

Best regards,
Adrien

On 09/05/2017 11:04 AM, Amit Yaron wrote:

> Hi,
>
> Does this shape already exist in Matplotlib modules?
> I've attached an example prepared with LibreOffice Draw.
>
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

demo_arrow_with_annotate.png (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Circular Arrow Closed Path

Amit Yaron
Thanks, Adrien

I'm going to use the Bézier curves for interactivity.
Class 'FancyArrowPatch' has the method 'get_path()' , which is helpful
in creating the approximation.

Best regards,
   Amit

On 05.09.2017 21:47,
[hidden email] wrote:

> Hi Amit,
>
> You may find usseful ressources about arrow shapes in Matplotlib at
> https://matplotlib.org/users/annotations.html, with examples on how to
> use the `matplotlib.axes.Axes.annotate` method(, which heavily relies on
> the `matplotlib.patches.FancyArrowPatch` if you are actually more
> interested in how things are done under the hood).
>
> Here is a quick example of what you can expect more or less
> out-of-the-box from `ax.annotate`:
> ```python
> import matplotlib.pyplot as plt
>
> fig, ax = plt.subplots(num='demo_arrow_with_annotate.png',
>                         figsize=(3, 3))
>
> ax.annotate("",
>              xy=(0.5, 0.8), xycoords='data',
>              xytext=(0.5, 0.2), textcoords='data',
>              size=40, va="center", ha="center",
>              arrowprops=dict(arrowstyle="simple",  # <-- ~ LO style
>                              facecolor="DeepPink", edgecolor="none",
>                              connectionstyle="arc3,rad=1"),
>              )
>
> plt.show()
> ```
>
> If you really want a specific patch shape that you cannot get by
> tweaking the existing arrow shapes, it should still be possible to
> define a patch directly with vertices and Bézier curves.
>
> Best regards,
> Adrien
>
> On 09/05/2017 11:04 AM, Amit Yaron wrote:
>> Hi,
>>
>> Does this shape already exist in Matplotlib modules?
>> I've attached an example prepared with LibreOffice Draw.
>>
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> [hidden email]
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users