calplot icon indicating copy to clipboard operation
calplot copied to clipboard

Fixed colorbar positioning with tight layout

Open lukasmu opened this issue 4 years ago • 4 comments

This should fix https://github.com/tomkwok/calplot/issues/4. The issue seems to be that plt.tight_layout() and fig.subplots_adjust() do not work well with each other.

I have to admit it's not the most beautiful code, but it seems to work fine.

Resulting in: image Instead of: image

lukasmu avatar Mar 15 '21 22:03 lukasmu

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Mar 15 '21 22:03 sonarqubecloud[bot]

Thanks for the suggestion. Do you use Windows or Linux? I am looking for a way to produce correctly aligned/padded plots on all platforms without resorting to using OS detection hacks. With your patch applied the plots generated on macOS would not be correctly positioned.

tomkwok avatar Mar 16 '21 10:03 tomkwok

Oh weird, I didn't know that there are such differences between OSes. I used Ubuntu for this.

lukasmu avatar Mar 16 '21 10:03 lukasmu

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Nov 19 '23 05:11 sonarqubecloud[bot]