SphericalPlot3D with List: Create 3D Plots from Point Data

  • Thread starter Thread starter sukharef
  • Start date Start date
  • Tags Tags
    List
Click For Summary

Discussion Overview

The discussion revolves around the use of SphericalPlot3D in generating 3D plots from a list of points represented in spherical coordinates (z, theta, phi). Participants explore the possibility of interpolating point data to create a function suitable for SphericalPlot3D.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions whether SphericalPlot3D can be used with a list of points in the form {z, theta, phi} instead of a function.
  • Another participant suggests interpolating the list to create a function that can be used with SphericalPlot3D.
  • A participant provides an example of data and the interpolation process, but encounters an error related to the structure of the data for interpolation.
  • Some participants highlight the importance of understanding the required data structure for interpolation versus ListPlot3D.
  • One participant shares results from ListPlot3D and the interpolation attempt, indicating that interpolation works for certain inputs but not for others.
  • Another participant notes that while the data appears structured correctly for ListPlot3D, it may not meet the requirements for interpolation, suggesting potential format errors or interpolation errors.

Areas of Agreement / Disagreement

Participants express differing views on the structure required for interpolation and whether the provided data meets those requirements. There is no consensus on the best approach to resolve the issues encountered.

Contextual Notes

Participants mention specific error messages related to interpolation and emphasize the need for proper data formatting. The discussion reflects uncertainty regarding the compatibility of the data structure with the interpolation function.

sukharef
Messages
54
Reaction score
0
Hello.
SphericalPlot3D can build 3d plot only if arguments are : function (theta,phi) and theta's and phi's ranges.
Is there an opportunity to use SphericalPlot3D or smth like that, if i have a list of points, {z,theta,phi}?
Thanks!
 
Physics news on Phys.org
Just interpolate your list to get a function, then use SphericalPlot3D as normal.
 
DaleSpam said:
Just interpolate your list to get a function, then use SphericalPlot3D as normal.

data = {
{4.27126*10^-2, 0.05, 0.05}, {4.23865*10^-2, 0.05, 0.1},
{4.18468*10^-2, 0.05, 0.15}...
};

func = Interpolation[data];

SphericalPlot3D[ func[x, y], {x, 0, Pi}, {y, 0, 2 Pi}, PlotPoints -> 100, PlotRange -> Full]

An error is "Interpolation::indim: The coordinates do not lie on a structured \
tensor product grid. >>"
 
Did you read the online help for Interpolation and Interpolation::indim? How do they say the data must be structured?
 
DaleSpam said:
Did you read the online help for Interpolation and Interpolation::indim? How do they say the data must be structured?

i did.

here is two results: 1) ListPlot3D 2) the same plot but after interpolation of list.

[PLAIN]http://i038.radikal.ru/1108/95/8863f173203b.jpg

ListPlot3D[data, PlotRange -> All]
func = Interpolation[data];
func[3.7, 1.6]; <- it works great
Plot3D[func[x, y], {x, 0, Pi/2}, {y, 0, 2 Pi}, PlotRange -> All]
 
Last edited by a moderator:
Looks like the data is structured correctly for ListPlot3D, but not for Interpolation. Note that interpolation requires a different input than ListPlot3D. Also, note that you will better able to see problems by specifying the same plot range for both. That will help you distinguish between format errors and interpolation errors. It looks like a format error to me, but due to the scale it is not possible to rule out interpolation errors also.
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K