1
I posted that same question earlier on stack overflow (in English).
I’m new in python and I’m learning to plot parametric functions using plotpy.
Therefore, I "challenged" myself to write a code that generates the parametric graph of the curve γ:[-2π,2π] R 2, γ(t)= (sin(t),t 2). So I wrote the following code:
import plotly as py
import plotly.graph_objs as go
import numpy as np
py.offline.init_notebook_mode(connected=True)
x = np.linspace(-2*np.pi, 2*np.pi, 3000)
layout = go.Layout(
title='$\gamma(t) = (\sin(t),t^2),\ t\in[-2\pi,2\pi]$',
)
trace1= go.Scatter(
x=np.sin(x),
y=x**2,
mode='lines',
line=dict(
shape='spline'
)
)
fig = go.Figure(data=[trace1],layout=layout)
py.offline.iplot(fig)
Now, I would like to add some arrows in this graph in order to represent the direction of the path that the γ curve is taking. I mean, I’m trying to generate a similar image to this one:
I looked online about how to do this, but so far I found nothing.
Someone knows how to do it?
You can do without problems with Plotly using Multiple-Annotations, but it is not a simple code if you want the arrows to point in the direction of the curve, as it will be necessary to calculate the angle to which they point.
– Gomiero
I’ll try to do, thank you for the comment
– Matheus Manzatto