Skip to content

v. 3.3.0: horizontal colorbar broken #18033

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

Closed
chris-hld opened this issue Jul 23, 2020 · 9 comments · Fixed by #17494 or #18038
Closed

v. 3.3.0: horizontal colorbar broken #18033

chris-hld opened this issue Jul 23, 2020 · 9 comments · Fixed by #17494 or #18038
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout topic: mplot3d
Milestone

Comments

@chris-hld
Copy link

Bug report

Bug summary

Horizontal colorbar location changed to something broken in latest 3.3.0

Code for reproduction

Here is a minimal example in the exact way I am using it. Is there any quick fix/workaround? I really appreciate the improved 3D axis handling in v. 3.3!

import numpy as np
import matplotlib.pyplot as plt

import matplotlib as mpl
ver = mpl.__version__

num_plots = 4
fig = plt.figure(figsize=plt.figaspect(1 / num_plots),
                 constrained_layout=True)

ax_l = []

for idx in range(num_plots):
    ax = fig.add_subplot(1, num_plots, idx+1, projection='3d')
    p_tri = ax.plot_trisurf(np.random.randn(5), np.random.randn(5), np.random.randn(5),
                            cmap=plt.cm.coolwarm)
    ax_l.append(ax)

cbar = plt.colorbar(p_tri, ax=ax_l, orientation='horizontal')


plt.suptitle(ver)

plt.savefig(str(ver)+'.jpg')
plt.show()

Actual outcome

from v. 3.2.0
3 2 0

from v. 3.3.0
3 3 0

@tacaswell tacaswell added this to the v3.3.1 milestone Jul 23, 2020
@chris-hld
Copy link
Author

Possibly related to constrained_layout.

Output with constrained_layout=False
3 3 0

@jklymak jklymak added the topic: geometry manager LayoutEngine, Constrained layout, Tight layout label Jul 23, 2020
chris-hld added a commit to chris-hld/spaudiopy that referenced this issue Jul 23, 2020
chris-hld added a commit to chris-hld/spaudiopy that referenced this issue Jul 23, 2020
@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

This is not a bug with regular axes, so its some sort of mplot3d issue.

Its possible constrained_layout works w/ mplot3d sometimes, but its not tested with mplot3d. But I can't bisect the error sensibly, partially because the toolkits don't install in conda/pip the same way as the core library. So hopefully someone w/ a working mplot3d debug setup can at least bisect so we can see what change caused this.

@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

Note this would be closed by #17494

@jklymak jklymak linked a pull request Jul 23, 2020 that will close this issue
6 tasks
@tacaswell
Copy link
Member

To check, the problematic change is the colorbar floating to the top?

Assuming we don't want to backport the CL re-write for 3.3.x is there another workaround other than turning CL off ?

@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

I don't know. I can't bisect mplot3d stuff to figure out what is going on.

@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

This bisects to 4479a0f #16472

@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

ok fixed #18038 as far as I can tell.

@jklymak
Copy link
Member

jklymak commented Jul 23, 2020

@chris-hld unfortunately I cannot think of a good workaround short of installing the 3.3.1 branch or downgrading to 3.2 until 3.3.1 is released.

@chris-hld
Copy link
Author

Thank you very much!
I just disable constrained_layout for this particular one now and will revisit with 3.3.1!

chris-hld added a commit to chris-hld/spaudiopy that referenced this issue Aug 25, 2020
* WIP: Epad

* Add Tapering to EPAD

* Add EPAD to performance plots

* Fix energy

* Scale EPAD energy to unity regardless of order

* Add EPAD to examples and better warning

* simplify scaling in epad

* Add MAD

* Update decoder.py

Cleanup

* Extend decoder performance plots

* Get ready for matplotlib 3.3

* Add custom legends to DOA plot

* Make DOA compatible to mpl < 3.3

* Use gouraud shading in performance plot

* Allow mpl 3.3 for setup

* Don't use horizontal colorbar, broken in mpl3.3.0
matplotlib/matplotlib#18033

* Update setup.py

* Incorporate fix mpl 3.3.1

* More explicit cbar pos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout topic: mplot3d
Projects
None yet
3 participants