SphericalPlot3D with List: Create 3D Plots from Point Data

  • Thread starter sukharef
  • Start date
  • Tags
    List
In summary, the conversation discusses the use of the SphericalPlot3D function and its limitations when using a list of points as input. The solution is to interpolate the list to obtain a function that can then be used with SphericalPlot3D. The conversation also mentions the importance of ensuring the data is structured correctly for proper interpolation.
  • #1
sukharef
54
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
  • #2
Just interpolate your list to get a function, then use SphericalPlot3D as normal.
 
  • #3
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. >>"
 
  • #4
Did you read the online help for Interpolation and Interpolation::indim? How do they say the data must be structured?
 
  • #5
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:
  • #6
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:

FAQ: SphericalPlot3D with List: Create 3D Plots from Point Data

1. What is SphericalPlot3D with List?

SphericalPlot3D with List is a function in the Mathematica software that allows you to create 3D plots from point data. It is commonly used in scientific research to visualize and analyze data.

2. How do I use SphericalPlot3D with List?

To use SphericalPlot3D with List, you need to have a list of data points in the form of {{r1, θ1, ϕ1}, {r2, θ2, ϕ2}, ...}. These points represent the radius, polar angle, and azimuthal angle of each data point. You can then input this list into the function and customize the plot as needed.

3. What types of plots can be created with SphericalPlot3D with List?

SphericalPlot3D with List can create various types of 3D plots, including scatter plots, surface plots, and density plots. These plots can be customized with different color schemes, shapes, and labeling options.

4. Can I add additional features and annotations to my plot?

Yes, SphericalPlot3D with List allows you to add additional features and annotations to your plot. You can add titles, legends, axes labels, and even incorporate other graphics or images into your plot.

5. How can I export my SphericalPlot3D with List plot for further analysis?

You can easily export your plot as an image or a data file using the Export function in Mathematica. This allows you to save your plot for further analysis or to use it in other software or presentations.

Similar threads

Replies
4
Views
8K
Replies
1
Views
953
Replies
5
Views
1K
Replies
2
Views
1K
Replies
2
Views
6K
Replies
3
Views
1K
Replies
1
Views
574
Replies
1
Views
924
Back
Top