I don't understand. I imagine the image is your 2-D matrix and you've applied a colormap to it. But what is the black line plot? The "number of occurrence" to most people means "histogram". But if you had a histogram for each row, you would have multiple values, not just the one value you're plotting at each row. Even if you took the histogram of the entire array, it would be misleading and deceptive to plot the histogram going vertically down the rows. So attach your data, and explain the black curve.
I attached my data. Forget about the black line. I just to plot my data (501*381) as the density plot. the same as the figure I attached as the example above.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
2 Comments
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/713198-density-plot-of-a-2d-matrix#comment_1255263
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/713198-density-plot-of-a-2d-matrix#comment_1255263
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/713198-density-plot-of-a-2d-matrix#comment_1255293
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/713198-density-plot-of-a-2d-matrix#comment_1255293
Sign in to comment.