Skip to content

Instantly share code, notes, and snippets.

@cocomoff
Created October 15, 2021 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocomoff/2afbf6561a8fb5bfa3173cf5e5f94c22 to your computer and use it in GitHub Desktop.
Save cocomoff/2afbf6561a8fb5bfa3173cf5e5f94c22 to your computer and use it in GitHub Desktop.
graph example
using Plots
gr()
f1(x) = sin(x)
f2(x) = cos(x)
x = 0.0:0.2:2π
y1 = f1.(x);
y2 = f2.(x);
l = @layout [a{0.8w} b]
p1 = plot(x, y1, label="sin(x)", size=(200, 400))
plot!(p1, x, y1, label="cos(x)")
p2 = plot(y1, y2, xlabel="sin(x)", ylabel="cos(x)", aspect_ratio=1, size=(400, 400))
plot(p1, p2, layout=grid(1, 2, widths = (0.6, 0.4)), size=(1000, 400))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment