I have a dataset here here. It consists of three columns. It x values or the column 1 is not the same for all the data sets for corresponding z values (or in other words, x values are not equally spaced). But I would like to make a 2D color plot. It turns out that when I use the following
ListDensityPlot[data, InterpolationOrder -> 0]
will give a very wierd value.
If you look at the data set one can easily understand that it only has a three data sets combined. In principle the image must have three strips along the horizontal axis, instead, it has many strips.
Clearly, ListDesnity plot is not doing a good job here.How do I fix this?
EDIT
The point is that it has 3 x 651 (Y x X) data points. Clearly, from the plot, it is very clear that it has not been plotting that many data points when the Interpolation is zero. That is pretty weird by the way.
I need the actual data points without any sort of additional filtering like smoothing or anything.
Instead, of plotting {x,y,z} values directly in ListDensityPlot, I had used Matrix method something like the following, first make the partition the z value as 31x3 Matrix, then plot in list density plot. But this clearly does not work here since x values for three different sets (y) are not uniform. Or in other words for example. I have a data something like this
set1 = {{x,1,z11},{{x,2,z12},{x,3,z13}};
set2 = {{x2,1.1,z21},{{x2,2.5,z22},{x2,2.7,z23}}
set3={{x3,1.1,z31},{{x3,2.2,z32},{x3,3.5,z33}}
mydata=Join[set1,set2,set].
what I do not have is something like this.
set1 = {{x,1,z11},{{x,2,z12},{x,3,z13}};
set2 = {{x2,1,z21},{{x2,2,z22},{x2,3,z23}}
set3={{x3,1,z21},{{x3,2,z22},{x3,3,z23}}
Notmydata=Join[set1,set2,set].
PlotRange -> All
. These have values that are clipped otherwise. I do not understand what you mean byx
not being equally spaced. Thex
values are the same fory=200
,300
and400
. Also, I do see three strips along the horizontal axis, so I do not understand this comment. UseMesh -> All
to see them better. However, the middle strip is made of many more parts than the top and bottom.This is weird and looks incorrect. The middle is wider, but that's fixable. $\endgroup${{x, y, z}, ...}
or{{x, ...}, {y, ...}, {z, ...}}
? To me, it looks like your data is in the latter form, not the former. $\endgroup$InterpolationOrder->0
? $\endgroup$ListLinePlot
like this $\endgroup${x, y f(x,y)}
is much worse than when it is for an array. But they don't seem to want to fix this. I still think for this data the plot with three lines is better, bug if you want the plot with three stripes of uniform width you could do that just graphics primitives fairly easily. I can look more closely some time this weekend maybe $\endgroup$