I have posted about this several times. This link and context is the closest thing that I can find that might help me achieve this result. What I need to do is this:
I would like to be able to calculate the integral or ‘area under the curve’ for a given tags history on a chart or easy chart.
This is the clearest that I can state “what I need to achieve”
Below is the closest solution I could find. I need the example to work in ignition or to be able to accomplish the same result in ignition.
matplotlib.org/examples/showcase … _demo.html
“”"
Plot demonstrating the integral as the area under a curve.
Although this is a simple example, it demonstrates some important tweaks:
* A simple line plot with custom color and line width.
* A shaded region created using a Polygon patch.
* A text label with mathtext rendering.
* figtext calls to label the x- and y-axes.
* Use of axis spines to hide the top and right spines.
* Custom tick placement and labels.
“”"
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
def func(x):
return (x - 3) * (x - 5) * (x - 7) + 85
a, b = 2, 9 # integral limits
x = np.linspace(0, 10)
y = func(x)
fig, ax = plt.subplots()
plt.plot(x, y, ‘r’, linewidth=2)
plt.ylim(ymin=0)
Make the shaded region
ix = np.linspace(a, b)
iy = func(ix)
verts = [(a, 0)] + list(zip(ix, iy)) + [(b, 0)]
poly = Polygon(verts, facecolor=‘0.9’, edgecolor=‘0.5’)
ax.add_patch(poly)
plt.text(0.5 * (a + b), 30, r"$\int_a^b f(x)\mathrm{d}x$",
horizontalalignment=‘center’, fontsize=20)
plt.figtext(0.9, 0.05, ‘$x$’)
plt.figtext(0.1, 0.9, ‘$y$’)
ax.spines[‘right’].set_visible(False)
ax.spines[‘top’].set_visible(False)
ax.xaxis.set_ticks_position(‘bottom’)
ax.set_xticks((a, b))
ax.set_xticklabels((’$a$’, ‘$b$’))
ax.set_yticks([])
plt.show()
Out of this large community and skilled experts at IA I know this is achievable.
Please Help.