1234567891011121314151617181920212223242526 |
- def plotIn2D(LHStok, RHStok, variables, axisRange):
- """Returns function array for 2D plots
- Arguments:
- LHStok {list} -- expression tokens
- RHStok {list} -- expression tokens
- variables {list} -- variables in equation
- axisRange {list} -- axis limits
- Returns:
- graphVars {list} -- variables for plotting
- func {numpy.array} -- equation to be plotted in 2D
- """
- xmin = -axisRange[0]
- xmax = axisRange[0]
- ymin = -axisRange[1]
- ymax = axisRange[1]
- xdelta = 0.01 * (xmax - xmin)
- ydelta = 0.01 * (ymax - ymin)
- xrange = np.arange(xmin, xmax, xdelta)
- yrange = np.arange(ymin, ymax, ydelta)
- graphVars = np.meshgrid(xrange, yrange)
- function = getFunction(LHStok, RHStok, variables, graphVars, 2)
- return graphVars, function
|