DensityHistogram
has a function hf
, which I believe allows you to alter what defines the colours (I presume hf stands for height function) at any coordinate.
The default is to take data points such as {x, y}
and color the corresponding coordinate according to the number of {x, y}
as a percentage of all data points {_, _}
.
I want to instead color the x
, y
coordinate according to the number of data points {x, y, z}
, as a percentage of all data points {x, y, _}
.
To try and state it another way, I'd like the colours of each coordinate (x,y) of the final density map to be determined by Count[data, {x,y,z}]] / Count[data, {x,y,_}]]. By default the colours of each coordinate (x,y) are instead determined by Count[data, {x,y}]].
The particular problem I'm trying to solve is that I have data, where each data point looks like {Shortlisted, Grade 5, Female}. So the x axis for the final graph should be categories of recruitment, while the y axis is types of job, and the colour is the percentage of people in that specific x,y coordinate (category of recruitment and type of job) who are female determines the colour, rather than the total number of people in that coordinate, which is the default.
I've managed to do this using ListDensityPlot[appropriately altered data set,InterpolationOrder->0,...]
, but this leaves me with the problem of labelling (in text) the coordinates with both the percentage and absolute number of {x,y,z} - a task that is pretty easy in DensityHistogram
, while ListDensityPlot
has a different understanding of what the coordinates are, and I'm yet to work out how to apply some of the solutions on here for labelling 3d charts to my particular problem.
{x, y, z}
(a three dimensional point) and then visualize the count/fraction on a two-dimensional grid. Surely this would require a 3D-dimensional grid. $\endgroup$