File:2 example.svg
Summary
Description |
English: Vectorized plot of several cubic functions. |
||
Date | |||
Source | 2_example.JPG | ||
Author |
|
||
Other versions |
|
Source code
Category:Invalid SVG created with Matplotlib#05002%20example.svgSource Code in python: |
---|
import matplotlib.pyplot as plt
x_s = [ t/10 - 1 for t in range(400) ]
y_1 = [ (x - 1)**3 + 1 for x in x_s ]
y_2 = [ (x - 2)**3 + 2 for x in x_s ]
y_3 = [ (x - 1)**3 for x in x_s ]
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x_s, y_1, label='Equation 1: $y=(x-1)^3+1$')
ax.plot(x_s, y_2, label='Equation 2: $y=(x-2)^3+2$')
ax.plot(x_s, y_3, label='Equation 3: $y=(x-1)^3$')
ax.legend(loc=2)
ax.grid()
plt.ylim(-1, 3)
plt.xlim(-1, 3)
ax.set_aspect(0.67)
plt.show()
|
Licensing
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.