@esia2019 ff.create_quiver() has no keyword for mirroring the vectors through a point. But theoretically you can get the same plot as with matplotlib, with the following code:
import pandas as pd
import plotly.figure_factory as ff
from numpy import pi
df = pd.read_csv("quiver.csv")
fig=ff.create_quiver(2*df['x'].tolist(), 2*df['y'].tolist(),
df['u'].tolist()+(df["u"].apply(lambda x: -1*x)).tolist(),
df['v'].tolist()+(df["v"].apply(lambda x: -1*x)).tolist(),
arrow_scale=0.001, scale=0.01, angle=pi/18)
I said theoretically, because doubling the length of the dataframe we get a plot with lists x, y, u, v of length
2*len(df)=2*15360=30720
each. I did not succeed to get the fig, because the jupyter kernel stopped, most likely due to the large amount of data.
Thanks mate. The large amount of data causes the jupyter kernel to stall, so I try it in Colab, it takes 18 minutes to complete the task, the result is exactly the same as matplotlib!
@esia2019
I cannot understand why to plotly.py it takes so much to generate this plot.
Out of curiosity I also tested how long it takes, using the Julia version of plotly.py (PlotlyJS.jl).
I couldn’t believe it when I saw that in less than a second the quiver plot was displayed.
Time to get the fig is 8.131 ms: https://nbviewer.org/gist/empet/3bb979f33cdc59b8267d5fe6f9e5faca.
Julia is fast as C & Fortran.
#-----------------------------------------------------#,
are the contents of quiver.jl.
You can save quiver.jl either in the same folder as your current notebook, or in a subfolder, say julians,
and import it as:
include("julians/quiver.jl")
This notebook illustrates a few examples to see how different settings lead to different quiver plots.