askap-vast / vast-tools

A collection of tools that are useful for the VAST project and for exploration of results from the VAST Pipeline.
https://vast-survey.org/vast-tools/
MIT License
8 stars 0 forks source link

v2: Unexpected behaviour in postagestamp PNG output (matplotlib v3.3.0) #180

Closed ddobie closed 4 years ago

ddobie commented 4 years ago

Passing bbox_inches="tight" to plt.savefig() results in the figure title being cut off: image

Using fig.set_tight_layout(True) results in the x axis being cut off: image

It looks like constrained_layout should handle this (https://matplotlib.org/3.1.1/tutorials/intermediate/constrainedlayout_guide.html) but it's still experimental. I've tried it and it cuts everything off.

ajstewart commented 4 years ago

What I don't understand is that this wasn't happening before? Are you on the same matplotlib version? I see 3.3.0 was released 10 days ago.

Only other thing is to check the multiprocessing is not messing this up.

ddobie commented 4 years ago

You're right - I upgraded to 3.3.0. I've downgraded and the issue is solved.

ajstewart commented 4 years ago

On 3.3.0 does it work if you ask for no colorbar?

ddobie commented 4 years ago

Doesn't seem to :(

ajstewart commented 4 years ago

Ok then I guess a temp solution to this is that we set matplotlib to a max of 3.2.2, but leave this issue open.

We should also try and report to matplotlib, I wonder if you get the same with a simple plot?

ddobie commented 4 years ago

Currently requirements.txt currently specifies matplotlib<=3.1.2. If I run pip install -r requirements.txt followed by pip install . I get 3.1.2. If I simply run pip install . then the required packages are installed but I get 3.3.0. Not sure if that's a bug or (more likely) a misunderstanding on my part.

ajstewart commented 4 years ago

Currently requirements.txt currently specifies matplotlib<=3.1.2. If I run pip install -r requirements.txt followed by pip install . I get 3.1.2. If I simply run pip install . then the required packages are installed but I get 3.3.0. Not sure if that's a bug or (more likely) a misunderstanding on my part.

Looks like the setup.py is not consistent, matplotlib there is >=3.1.2 but smaller than 4.0.

ddobie commented 4 years ago

Pretty sure this can be closed

ajstewart commented 3 years ago

Just a note here that this is fixed when testing matplotlib v3.4.1.

21:29:45 2899_-04:29:11 9004_EPOCH06x