0
$\begingroup$

I ran into some odd behavior with ListDensityPlot. I simplified the data as much as I could. If I simplify it further, the odd behavior goes away. What might be going on here?

$Version

10.4.1 for Linux x86 (64-bit) (April 11, 2016)

data =
 {{1, -0.04, 0}, {1, -0.01, 1}, {101, -0.04, 0}, {101, -0.01, 1},
  {201, -0.04, 0}, {201, -0.01, 1}, {301, -0.04, 0}, {301, -0.01, 1},
  {401, -0.04, 0}, {401, -0.01, 1}, {501, -0.04, 0}, {501, -0.01, 1},
  {601, -0.04, 0}, {601, -0.01, 1}}

Edit: So here the x-coordinate takes values 1,101,201,301,401,601 and y-coordinate -0.04,-0.01. The data values are just 0 and 1.

ListDensityPlot[data]

ListDensityPlot image

If I leave out just the 2 last data points, then everything works ok:

ListDensityPlot[data[[1 ;; 12]]]

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ The triangulation algorithm used to create the plot's mesh does not work properly if the data has a very large or very small aspect ratio. $\endgroup$ Mar 31, 2017 at 19:29

1 Answer 1

-1
$\begingroup$

Your problem that the data is not in the form {x, y, f[x,y]}

Fix that this way:

ListDensityPlot[RotateRight /@ data]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.