File:1 over x squared integral.svg

Summary

Description
English: The plot of and the area under the curve (integral).
Date
Source Own work
Author Krishnavedala
SVG development
InfoField
Source code
InfoField

Python code

Source code
from matplotlib import pyplot as plt
from numpy import linspace, arange, logspace
from matplotlib.patches import Polygon

plt.rc('text', usetex=True)
plt.rc('font', family='serif')

limits = [1,4]

x1 = linspace(0.1,8,80)
y1 = 1./(x1 * x1)
x2 = linspace(1,7,8)
y2 = 1./(x2 * x2)
x3 = arange(limits[0], limits[1],0.01)
y3 = 1./(x3 * x3)
verts = [(limits[0],0)] + list(zip(x3,y3)) + [(limits[1],0)]
poly = Polygon(verts, facecolor='orange',edgecolor='k')

fig = plt.figure(figsize=(5,5), dpi=100)
ax = fig.add_subplot(111)
ax.grid(True)
ax.plot(x1,y1)
ax.plot(x2,y2,'ro')
ax.add_patch(poly)
ax.text(1.2,1,r"$\displaystyle f(x)=\frac{1}{x^2}$")
ax.text(1.3,.05,r"$\displaystyle " + "\int_{}^{}".format(limits[0], limits[1]) + "f(x)\mathrm{d}x$")

ax.set_xlim(0,8)
ax.set_ylim(0,1.2)
ax.set_yticks(linspace(0,1,6))
ax.minorticks_on()
ax.set_xlabel("x")
ax.set_ylabel("y")

fig.savefig("1_over_x_squared_integral.svg",bbox_inches="tight",\
	pad_inches=.15)

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#1%20over%20x%20squared%20integral.svg
Category:Self-published work Category:Unidentified curves Category:Integration (mathematics) Category:SVG mathematics Category:Function plots
Category:CC-Zero Category:Function plots Category:Integration (mathematics) Category:SVG mathematics Category:Self-published work Category:Unidentified curves Category:Valid SVG created with Matplotlib code