Question

Is it possible to plot multiple ListPolarPlots to give a 3D effect in Mathematica?

I can plot multiple polar plots using ListPolarPlot[{data1, data2, data3}] without any problems; but with lots of data sets a 3D graph would display my data better, with each polar plot along a third axis. I have used ListPLot3D which works just fine, but I'm curious to see if I can do the same with polar plots...

Thanks in advance!

Était-ce utile?

La solution

When you want to make a 3D plot you will need to have 3D data first. Therefore, I assume you really meant a ListSphericalPlot3D. If you already have the list of your points in spherical coordinates, it's not really hard to plot them.

What we do is, basically first changing the coordinates to "Cartesian", then plotting it:

ListSphericalPlotPoints3D[list_List] := ListPointPlot3D[Map[CoordinateTransformData["Spherical" -> "Cartesian","Mapping", #] &,Map[{#[[1]], Mod[#[[2]], \[Pi]], Mod[#[[3]], 2 \[Pi]]} &, list]]];
ListSphericalPlot3D[list_List] := ListPlot3D[Map[CoordinateTransformData["Spherical" -> "Cartesian", "Mapping", #] &, Map[{#[[1]], Mod[#[[2]], \[Pi]], Mod[#[[3]], 2 \[Pi]]} &,list]]];

These two functions will hopefully do, what you are asking for.

Update:

Since this transformation is rather simple, it is straightforward to write the whole transformation by hand:

ListSphericalPlotPoints3D[list_List] := ListPointPlot3D[Map[{#[[1]] Sin[#[[2]]] Cos[#[[3]]], #[[1]] Sin[#[[2]]] Sin[#[[3]]], #[[1]] Cos[#[[2]]]} &,Map[{#[[1]], Mod[#[[2]], \[Pi]], Mod[#[[3]], 2 \[Pi]]} &, list]]];
ListSphericalPlot3D[list_List] := ListPlot3D[Map[{#[[1]] Sin[#[[2]]] Cos[#[[3]]], #[[1]] Sin[#[[2]]] Sin[#[[3]]], #[[1]] Cos[#[[2]]]} &, Map[{#[[1]], Mod[#[[2]], \[Pi]], Mod[#[[3]], 2 \[Pi]]} &,list]]];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top