user1558881
user1558881

Reputation: 225

Smooth out Density Plot Mathematica

I am importing a three column table into Mathematica and using it to make a density plot. However unless you have a very large amount of data in small increments the density plot looks disjointed and obviously not continuous.

is there a way or a function to smooth out my plots?

Thanks, Ben

Upvotes: 4

Views: 2930

Answers (2)

halirutan
halirutan

Reputation: 4341

I guess what you are looking for is the InterpolationOrder option. Below is the example from the documentation which shows how it works even for a 6x6 data grid

data = Table[Sin[j^2 + i], {i, 0, Pi, Pi/5}, {j, 0, Pi, Pi/5}];
Table[ListDensityPlot[data, Mesh -> None, InterpolationOrder -> o, 
  ColorFunction -> "SouthwestColors"], {o, {0, 1, 2, 3}}]

Mathematica graphics

Upvotes: 6

Dr. belisarius
Dr. belisarius

Reputation: 61056

Use InterpolationOrder:

data = Table[Sin[j^2 + i], {i, 0, Pi, Pi/5}, {j, 0, Pi, Pi/5}];
GraphicsRow@{ListDensityPlot[data, Mesh -> None, InterpolationOrder -> 3], 
             ListDensityPlot[data, Mesh -> None]}

Mathematica graphics

Upvotes: 3

Related Questions