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

3 ビュー (過去 30 日間)
Iago Lopez Grobas
Iago Lopez Grobas 2019 年 7 月 24 日
回答済み: Ganesh Regoti 2019 年 8 月 1 日
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

回答 (1 件)

Ganesh Regoti
Ganesh Regoti 2019 年 8 月 1 日
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

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by