Plotting Hex grid - matplotlib-users - Matplotlib
Plotting Hex grid Community matplotlib-users iCy-fLaME December 17, 2009, 11:09am 1 I am aware of Hexbin, which is a kind of histogram with hexagonal cells. But what if my data comes in a Hex grid to start with? I have a 2-D array probe with sensor elements arranged in a hexagonal close packed geometry, plotting the sensor readings in normal x-y (rectangular grid) directly will distort every other line of the element spacing.
What would be a good way to plot such data? Thanks! _Chris_Barker December 17, 2009, 4:56pm 2 iCy-fLaME wrote: I am aware of Hexbin, which is a kind of histogram with hexagonal cells. But what if my data comes in a Hex grid to start with? What would be a good way to plot such data? Use the source, Luke! Take a look at the source of Hexbin -- the answer must be there. With luck, it's been factored in a way that you can use the drawing code without the binning code. -Chris ··· -- Christopher Barker, Ph.D.
Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] ... _John_Hunter1 December 17, 2009, 5:57pm 3 You will probably want to create a PolyCollection or a RegularPolyCollection: http://matplotlib.sourceforge.net/search.html?q=PolyCollection Examples at: http://matplotlib.sourceforge.net/examples/api/collections_demo.html?highlight=polycollection JDH ··· On Thu, Dec 17, 2009 at 10:56 AM, Christopher Barker < [email protected] ...> wrote: iCy-fLaME wrote: I am aware of Hexbin, which is a kind of histogram with hexagonal cells.
But what if my data comes in a Hex grid to start with? What would be a good way to plot such data? Use the source, Luke! Take a look at the source of Hexbin -- the answer must be there.