Question

This is a very special plotting request, but I have data I want to view in a very particular way. Here's the situation:

1) The data I have is binned into 25 bins, each bin contains a different number of data points. The larger the bin value, the smaller then number of data points it has within it, roughly speaking (This is just a result of the data processing which was done).

[9568, 10079, 10137, 10090, 10154, 10091, 10046, 10116, 9959, 9401, 7703, 5216, 3089, 1632, 854, 466, 221, 106, 63, 27, 12, 5, 1, 0]

2) I have access to the bin values.

[ 0.02648645  0.09996368  0.1734409   0.24691813  0.32039536  0.39387258
  0.46734981  0.54082703  0.61430426  0.68778148  0.76125871  0.83473593
  0.90821316  0.98169038  1.05516761  1.12864483  1.20212206  1.27559928
  1.34907651  1.42255373  1.49603096  1.56950818  1.64298541  1.71646264]

I can easily produce an 'errorbar' type plot in matplotlib (the y-axis is scaled from radius to degrees below):

LowMass_Virialized

But, this is not particularly insightful for what I'd like to study. I'd really like to know if there are 'islands' of angle values within each bin, and to do this, I would need something like a scatterplot or an imshow/hexbin type plot, where the density of points can be represented by color (in the case of imshow/hexbin at least). The following is an example of what happens when represented by a regular scatterplot with the smallest marker size:

LowMass_Virialized_Scatter

Would anybody know of a good way to generate this type of visualization?

EDIT: This may help clarify a couple of things. The following plot is a sample of what a histogram would look like for the first couple of bins. Data contained within bins seem to follow some sort of distribution (I mentioned 'islands' before, because I am not ruling out the possibility of multiple peaks in the distribution). I would like this distribution to be visualized for all bins simultaneously. In other words, is there a way to do a vertical temperature map for each bin and have them all shown on the same plot?

enter image description here

Was it helpful?

Solution

The violin plot mentioned in the comments was a nice solution to my problem. Here's where I found a python implementation of it - it would certainly be nice if this were included into matplotlib eventually. Overplotted is a box plot centered on the median value, and includes the 2nd and 3rd quartiles.

violinplot

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top