Hist3 error when displayed

4 visualizaciones (últimos 30 días)
Bran
Bran el 18 de Jul. de 2016
I am turning a scatter plot into a matrix where the number in each 'pixel' is the number of scatter points in that bin
I have been using hist3() to help me do this. If for example I have values ranging from -0.4 to 0.4 in the x axis and 0 to 10 in the y axis on the scatter plot. I have been calling up the Data = [ xvalues, yvalues]
I have been using [num,bincenters] = hist3(Data,{-0.45:0.02:0.45 -0.5:0.02:10.5})
xcenters = bincenters{1} ycenters = bincenters{2}
then imagesc(xcenters,ycenters,num)
The shape seems correct, however, the graph seems to be shifted and so not sitting in quite the correct place in terms of the x and y axis. What am I doing wrong?

Respuestas (0)

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by