Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the coupled color and size features in one legend #99

Open
winglet0996 opened this issue Nov 18, 2024 · 3 comments
Open

Merge the coupled color and size features in one legend #99

winglet0996 opened this issue Nov 18, 2024 · 3 comments

Comments

@winglet0996
Copy link

Thank you for developing and maintaining such an excellent python visualization tool.
In some cases, like the heatmap in cell 8 in your tutorial, we want to synchronously use the color and size of the dots just to show one dimension of data better. But in this case, two legends are created to separately show the color and size information:

image

In fact, the color and size features of the dots are coupled. It would be perfect if the coupled features can be merged in a single legend as follows:

image

@DingWB
Copy link
Owner

DingWB commented Nov 18, 2024

Hi @winglet0996 ,

Thanks again for your feedback. This was a bug and it has already been fixed now.
You can assign the same column to c, value and s, then you will see what you expected.
please see this example: https://dingwb.github.io/PyComplexHeatmap/build/html/notebooks/dotHeatmap.html#Changing-the-size-of-point

plt.figure(figsize=(8,8))
cm = DotClustermapPlotter(corr_mat,x='level_0',y='level_1',value='correlation',
                          s='correlation',cmap='RedYellowBlue_r',c='correlation',
                          vmax=1,vmin=0,
                          linewidth=0.5,edgecolor='black')
plt.show()

image

@winglet0996
Copy link
Author

Thank you for your reply! In fact, what I want to say is whether the bar legend and dot legend can be merged into one if they are telling the same thing, and the size and color of the dots in this legend can change at the same time as in the figure. Please refer to the example I provided.

@DingWB
Copy link
Owner

DingWB commented Nov 19, 2024

I will think about whether to combine two legends as one or not.
From my point of view, I prefer to plot two legends separately, because we also have different markers (such as circle, square, star and so on), if we combine three legends (dotsize, colromap and markers shape) together, then it would be too complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants