Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Description
Problem
I often find myself using an equivalent of this code:
x=np.linspace(x_min,x_max)pyplot.plot(x,f(x))
This is unnecessarily verbose, and if written in one line has redundancy:
pyplot.plot(np.linspace(x_min,x_max),f(np.linspace(x_min,x_max)))
Proposed solution
It would be convenient if.plot
and similar high level plotting routines identified callable arguments and if possible evaluated those with array arguments. I imagine the amount of meaningful combinations would be limited.
Additional context and prior art
Providing functions as input to plotting routines and letting those take care of the evaluation is a common pattern.
- Julia has suchinterface
- Mathematica goes astep further and determines how to sample the function. This is out of scope for matplotlib.
- Similarly matlab hasfplot