Achieving square aspect for Facetgrid heatmaps
See original GitHub issueimport xarray as xr
import numpy as np
%matplotlib inline
array = xr.DataArray(np.random.rand(20,5,2,1), dims=['a', 'b', 'c', 'd'])
array.plot(x='a', y='b', col='c')
Problem description
How can I force these heatmap cells into squares rather than rectangles? I’m aware that it is possible to pass kwargs through to Seaborn’s FacetGrid, but setting square=True
or subplot_kws={'square":True}
both raise AttributeError: Unknown property square
.
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8
xarray: 0.10.8 pandas: 0.23.4 numpy: 1.15.1 scipy: 1.1.0 netCDF4: None h5netcdf: None h5py: None Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: 0.18.2 distributed: 1.22.1 matplotlib: 2.2.3 cartopy: None seaborn: 0.9.0 setuptools: 40.2.0 pip: 10.0.1 conda: 4.5.11 pytest: 3.7.3 IPython: 6.5.0 sphinx: 1.7.7
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to make heatmap square in Seaborn FacetGrid
To adjust quadratic heatmap and axis you may set corrected axis bounding box position manually with function set_bbox . Another way is a...
Read more >How to make a heatmap square in Seaborn FacetGrid using ...
To make a heatmap square in Seaborn facetgrid, we cn use heatmap() method with 10×10 random data set. Steps. Create a random data...
Read more >Making Faceted Heatmaps with ggplot2 | rud.is
This ensures the plot will have a 1:1 aspect ratio (i.e. geom_tile() –which draws rectangles–will draw nice squares). gg <- gg + coord_equal()....
Read more >Intermediate Data Visualization with ggplot2 - AWS
Quantile regression is a great tool for getting a more detailed overview of a large ... Using a 1:1 aspect ratio would make...
Read more >seaborn heatmap legend - You.com | The search engine you control.
Getting a legend in a seaborn FacetGrid heatmap plot ... Draw the heatmap with the mask and correct aspect ratio _ = sns.heatmap(df,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would prefer
axis_aspect
to allow other than square aspects.Is this what you want?
I don’t know that we need to add
square=True
as a supported argument but consistency with seaborn could be a good thing I guess. Thoughts?