Ask Your Question
4

How can seaborn.heatmap be modified to have cells of different sizes?

asked 2023-07-08 18:49:02 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-07-08 19:13:02 +0000

huitzilopochtli gravatar image

Seaborn's heatmap function creates a grid of squares with each cell representing a value in a matrix. It is not possible to modify the size of individual cells, as the size of all cells is determined by the dimensions of the grid and any additional padding specified by the user.

However, one workaround is to create multiple smaller heatmaps and arrange them in a grid using subplots or gridspec. Each smaller heatmap can represent a subset of the data and have its own dimensions. The resulting grid of heatmaps can then be treated as a single visualization.

Another option is to use a scatter plot to represent the data, with the size of the markers representing the values. This allows for more control over the size of individual points, but may not produce the same visual effect as a heatmap.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-08 18:49:02 +0000

Seen: 13 times

Last updated: Jul 08 '23