# Jagged edges in ListDensityPlot[ ] output?

Posted 1 month ago
293 Views
|
3 Replies
|
4 Total Likes
|
 I'm trying to create a ListDensityPlot of a limb-darkened star using the Table function. I have had success in that (I can create a reasonable star if I add more points) but I noticed that points outside of the surface of the star also contain nonzero values (look at the Matrixform[s]) that create problems with what I'm trying to do. Is there an If statement that can be used to set any points where sqrt(x^2+y^2)>rstar to zero? Any help would be greatly appreciated! Below is the code at present:
3 Replies
Sort By:
Posted 1 month ago
 The points outside the radius are complex and are ignored by ListDensityPlot. From the documentation holes will be left in the plot whenever there are elements that are not real numbers The jagged edges are caused by not having enough points. Try pts = 200.You can replace the complex values with 0 like this, but that does not do what you want because the color function is applied to those values. sReal = Replace[S, _Complex -> 0, 2] 
 I get rounded edges also with RegionFunction: ListDensityPlot[S, ColorFunction -> "SolarColors", DataRange -> rstar {{-1, 1}, {-1, 1}}, RegionFunction -> Function[{x, y, z}, Norm[{x, y}] < .95 rstar]]