Search code examples
pythonmatplotlibsurface

Description of arguments in surface plot function in Python


Hi I am writing a code which uses ax.plot_surface() to plot data on a unit sphere for theta = linspace(0,pi,100) and phi = linspace(0,2*pi,100).

For some reason my image is distorted in the sense that the sphere is ahead of the axis. Does anyone have any idea of why this would be the case?


Solution

  • 3D plotting isn't necessarily a good place to start learning how to use plotting libraries; the fundamentals are more often explained in simpler 2d plots. But to get started,

    • read the 3d tutorial
    • use the 3d examples for reference
    • experiment! Produce the same figure with different parameter settings.

    The specific parameters you asked about: