diff options
Diffstat (limited to 'day1/exercise/four_plot.py')
-rw-r--r-- | day1/exercise/four_plot.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/day1/exercise/four_plot.py b/day1/exercise/four_plot.py new file mode 100644 index 0000000..5417ee5 --- /dev/null +++ b/day1/exercise/four_plot.py @@ -0,0 +1,11 @@ +x=linspace(-5*pi, 5*pi, 500) +plot(x, x, 'b') +plot(x, -x, 'b') +plot(x, sin(x), 'g', linewidth=2) +plot(x, x*sin(x), 'r', linewidth=3) +legend(['x', '-x', 'sin(x)', 'xsin(x)']) +annotate('origin', xy = (0, 0)) +title('Four Plot') +xlim(-5*pi, 5*pi) +ylim(-5*pi, 5*pi) +show() |