MATLAB Answers

using hist3 to plot 2 different categories of data with two different colorbars

6 views (last 30 days)
Iago Lopez Grobas
Iago Lopez Grobas on 24 Jul 2019
Answered: Ganesh Regoti on 1 Aug 2019
Hello,
I have two different variables a and b and I want to create a density map with them. I have been trying to use the projection in the x-y plane of hist3 and using a colorbar as my z (frequency of the histogram). The X-axis would be given by my variable a and the Y-axis by my variable b. The problem with this is that I have two categories of data and I want a different colorbar for each of them. Let's say that I want color blue for category alfa and color red for my category beta. How can I do that? Of course, there are some bins where both colors would overlap but that's totally fine. I will play with the transparency. If there is any other function which does it let me know, it doesn't need to be hist3, I also played with pcolor and hist2D

  0 Comments

Sign in to comment.

Answers (1)

Ganesh Regoti
Ganesh Regoti on 1 Aug 2019
I think axesm function of Mapping Toolboxwould be helpful. You need to plot the data separately based on the categories and overlap it on the same figure. There is one similar question answered and here is the link

  0 Comments

Sign in to comment.

Sign in to answer this question.