Hist3 error when displayed

1 次查看(过去 30 天)
Bran
Bran 2016-7-18
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?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by