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

3 views (last 30 days)
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

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

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!