Last active
September 11, 2022 09:05
-
-
Save pierrelouisbescond/42e039c1e7c668cf977a0a55d3c1d7c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We normalize x values to match with the 0-2π cycle | |
df["x_norm"] = 2 * math.pi * df["x"] / df["x"].max() | |
df["cos_x"] = np.cos(df["x_norm"]) | |
display(df) | |
import plotly.graph_objects as go | |
fig = go.Figure() | |
fig.add_trace(go.Scatter(x=df.x_norm, y=df.cos_x)) | |
fig.update_layout(yaxis=dict(scaleanchor="x", scaleratio=1)) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment