plotter_3.py 781 B

123456789101112131415161718192021222324252627
  1. def plotIn3D(LHStok, RHStok, variables, axisRange):
  2. """Returns function for 3D plots
  3. Arguments:
  4. LHStok {list} -- expression tokens
  5. RHStok {list} -- expression tokens
  6. variables {list} -- variables in equation
  7. axisRange {list} -- axis limits
  8. Returns:
  9. graphVars {list} -- variables for plotting
  10. func {function} -- equation to be plotted in 3D
  11. """
  12. xmin = -axisRange[0]
  13. xmax = axisRange[0]
  14. ymin = -axisRange[1]
  15. ymax = axisRange[1]
  16. zmin = -axisRange[2]
  17. zmax = axisRange[2]
  18. meshLayers = axisRange[3]
  19. xrange = np.linspace(xmin, xmax, meshLayers)
  20. yrange = np.linspace(ymin, ymax, meshLayers)
  21. zrange = np.linspace(zmin, zmax, meshLayers)
  22. graphVars = [xrange, yrange, zrange]