# ListDensityPlot seems to break down for large arrays

(Using Mathematica 10)

When using ListDensityPlot to plot 40000 + data points, the produced plot seems to be blurred/incorrect for points occurring later in the list.

For instance, in the following code, a dataset is imported (data available as txt file here (ListDensityPlot data)) and plotted using ListDensityPlot over the entire range of data. Points later on the x-axis appear fuzzy'.

Following this, the same data is split into three segments and these segments plotted separately. It is clear that the data appears different (a more detailed investigation shows the divided data is plotted correctly).

    (*Load in the text file,
entries in form {x, y, z} 40602 data points on grid.
402 segments in x and 101 in y*)

densityList =
Import["minimal_working_densityList.txt", "Data"];

(*Plot All data using List density Plot*)

ListDensityPlot[densityList, AspectRatio -> 1,
PlotRange -> {{0, 400}, All, All}]

(*Plot 1st 200 x-values followed by final 200 x values; show together \
- observe difference with 1st plot*)

Show[
ListDensityPlot[densityList[[1 ;; (200*101)]], AspectRatio -> 1,
PlotRange -> {{0, 400}, All, All}],
ListDensityPlot[
densityList[[(Length[densityList] - (200*101) + 1) ;;
Length[densityList]]], AspectRatio -> 1,
PlotRange -> {{0, 400}, All, All}]
]

(*Plot values as above but now with a third plot filling in' the gap \
in x. *)

Show[
ListDensityPlot[densityList[[1 ;; (200*101)]], AspectRatio -> 1,
PlotRange -> {{0, 400}, All, All}],
ListDensityPlot[
densityList[[(199*101 + 1) ;; (Length[densityList] - (199*101))]],
PlotRange -> {{0, 400}, All, All}],
ListDensityPlot[
densityList[[(Length[densityList] - (200*101) + 1) ;;
Length[densityList]]], AspectRatio -> 1,
PlotRange -> {{0, 400}, All, All}]
]


The output for this looks as follows. (Mathematica output)

Notice that the right-hand side of the first plot has not been produced correctly/clearly.

• Not related to ListDensityPlot, but I'm noticing that your data is rectangularly-spaced, so you could convert it into matrix form, plot it using Image or ArrayPlot and apply a DataRange. – DumpsterDoofus Jan 31 '15 at 2:33
• Dang, just realized DataRange doesn't work with ArrayPlot. You can still convert it into array form, like this: arr = ConstantArray[0, {402, 101}]; (arr[[#[], Round[100 #[] + 1]]] = #[]) & /@ densityList; MatrixPlot[arr]. – DumpsterDoofus Jan 31 '15 at 2:41
• Great, this is an awesome workaround. Thanks for your help! – GeoWA Feb 2 '15 at 17:04