darkeclipz / calcupy

Calculus powered graphical calculator.
3 stars 0 forks source link

Line plot of tan is weird #9

Open darkeclipz opened 5 years ago

darkeclipz commented 5 years ago

https://stackoverflow.com/questions/21204740/drawing-tangent-plot-in-python-matplotlib

darkeclipz commented 5 years ago

Kinda works for line plots (no matrices):

from scipy.stats import scoreatpercentile
percentile = 2
p1, p99 = scoreatpercentile(Y, percentile), scoreatpercentile(Y, 100-percentile)
sd = np.std(Y)
iqr = p99 - p1
print('P1={} P99={} IQR={}, SD={}'.format(p1, p99, iqr, sd))
Y = map(lambda x: x if x < 3*iqr else np.inf, Y)
Y = map(lambda x: x if x > -3*iqr else -np.inf, Y)
ax.set_ylim(request.json['ylim'][0], request.json['ylim'][1])