Demo entry 6781281



Submitted by anonymous on Jan 03, 2019 at 00:48
Language: Python 3. Code size: 617 Bytes.

# Tell Jupyter to display the output graph inline
%matplotlib inline
# import numpy for data generation
import numpy as np
# import matplotlib for plotting data
import matplotlib.pyplot as plt

# generate the values for parameter t from 0 to 2pi
# with difference between values equal to 0.1
t = np.arange(0, np.pi*2, 0.01)
# generate values of x corresponding to the values of t
x = np.cos(t*3)
# generate values of y corresponding to the values of t
y = np.sin(t)

# generate the plot
plt.plot(x, y)
# save the plot to .svg
plt.savefig('test.svg', format='svg')
# show the plot inline

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).