I have some data and values for the variables,

data = Import["http://pastebin.com/raw.php?i=J0WP1cqe", "Table"];

{xdat, tdat} = Get["http://pastebin.com/raw.php?i=sEpBfkk2"];

I can plot this data, which is a 100x100 array, using the DataRange option

ListDensityPlot[data, DataRange -> {MinMax@tdat, MinMax@xdat}]

enter image description here

Now if I didn't want to bother with the DataRange option, and wanted to plot a list of tuples, I would make this list like

tuples1 = 
  Flatten[Table[{tdat[[j]], xdat[[i]], data[[i, j]]}, {i, 
     Length@xdat}, {j, Length@tdat}], 1];
ListDensityPlot @ tuples1

enter image description here

which is just awful. It does a little better if I switch the indices, but it is still horrible,

tuples2 = 
  Flatten[Table[{tdat[[i]], xdat[[j]], data[[j, i]]}, {i, 
     Length@xdat}, {j, Length@tdat}], 1];

enter image description here

A workaround is to rescale the x coordinate,

tuples3 = 
  Flatten[Table[{tdat[[i]], .01 xdat[[j]], data[[j, i]]}, {i, 
     Length@xdat}, {j, Length@tdat}], 1];

enter image description here

but this is less than ideal.

This problem happens the same for ListContourPlot and ListPlot3D. It is different than this bug which was supposedly fixed in version 10. The workaround listed there, using Method -> {"DelaunayDomainScaling" -> True} does not work here.

I believe this to be related to, but separate from this post, both of which I believe should be reported as bugs.

I am using version 10.2 on Linux

  • 4
    $\begingroup$ Related: mathematica.stackexchange.com/questions/68973/… $\endgroup$
    – Michael E2
    Nov 3, 2015 at 13:12
  • $\begingroup$ ahhh, okay, I could delete it if it's just a duplicate of that one. $\endgroup$
    – Jason B.
    Nov 3, 2015 at 13:19
  • $\begingroup$ Another workaround would probably be to use MapAt to plot the Log of your xdat? I know, not the best option but at least it should work $\endgroup$
    – Lukas
    Nov 3, 2015 at 16:18
  • $\begingroup$ I hope you won't delete it, since it is a different command (even if the same underlying problem). It will help others who search the site for such a problem. $\endgroup$
    – Michael E2
    Nov 4, 2015 at 2:04
  • $\begingroup$ Perhaps it's worth pointing out for others that in the linked duplicate, one should substitute tuples1 here for data there. $\endgroup$
    – Michael E2
    Nov 4, 2015 at 2:10


Browse other questions tagged or ask your own question.