Plot contours from counts of a scatter plot
Hi everyone, I’m fairly new to Matlab and i’m not sure how to obtain what i what i want.
I made this graphics where i’m trying to match some datas with my simulation. The prolem is that i’m simulating thtat same amounts of point as the ones in the data set (about 100) but has some statistic problems. So i wanted to simulate more points (about 1000) to use contour lines to show where i have different density of simulated points. This is where i ran into trubles.
I looked into the contour(Z) function, but i’m not sure how to make the Z matrix. I have two vectors, x and y, with the coordinates of my simulated point (and anoters set of twwo vectors for the datas).
I was thinking about using something lixe this to:
Z = histcounts2(x, y, ‘BinWidth’, [n, n], ‘XBinLimits’, [x1 x2], ‘YBinLimits’, [y1 y2])
But I’m not sure wich BinWidht to use to obtain what I want, or even if ot’s the best way to go about it.
Any pointers would be really appreciated,
Thakns to allHi everyone, I’m fairly new to Matlab and i’m not sure how to obtain what i what i want.
I made this graphics where i’m trying to match some datas with my simulation. The prolem is that i’m simulating thtat same amounts of point as the ones in the data set (about 100) but has some statistic problems. So i wanted to simulate more points (about 1000) to use contour lines to show where i have different density of simulated points. This is where i ran into trubles.
I looked into the contour(Z) function, but i’m not sure how to make the Z matrix. I have two vectors, x and y, with the coordinates of my simulated point (and anoters set of twwo vectors for the datas).
I was thinking about using something lixe this to:
Z = histcounts2(x, y, ‘BinWidth’, [n, n], ‘XBinLimits’, [x1 x2], ‘YBinLimits’, [y1 y2])
But I’m not sure wich BinWidht to use to obtain what I want, or even if ot’s the best way to go about it.
Any pointers would be really appreciated,
Thakns to all Hi everyone, I’m fairly new to Matlab and i’m not sure how to obtain what i what i want.
I made this graphics where i’m trying to match some datas with my simulation. The prolem is that i’m simulating thtat same amounts of point as the ones in the data set (about 100) but has some statistic problems. So i wanted to simulate more points (about 1000) to use contour lines to show where i have different density of simulated points. This is where i ran into trubles.
I looked into the contour(Z) function, but i’m not sure how to make the Z matrix. I have two vectors, x and y, with the coordinates of my simulated point (and anoters set of twwo vectors for the datas).
I was thinking about using something lixe this to:
Z = histcounts2(x, y, ‘BinWidth’, [n, n], ‘XBinLimits’, [x1 x2], ‘YBinLimits’, [y1 y2])
But I’m not sure wich BinWidht to use to obtain what I want, or even if ot’s the best way to go about it.
Any pointers would be really appreciated,
Thakns to all ‘countours’ ‘contour plot’ ‘histcounts’ ‘counts’ MATLAB Answers — New Questions