Created
June 22, 2021 08:36
-
-
Save fgerick/eadc509047c0abcdc07d90d1274e1ee4 to your computer and use it in GitHub Desktop.
Two subplots with shared colorbar using PyPlot.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PyPlot | |
f,ax = subplots(2) | |
y = randn(10,10) | |
y2 = randn(10,10)/maximum(abs.(y)) | |
c1 = ax[1].pcolor(y) | |
c2 = ax[2].pcolor(y2) | |
f.colorbar(c2; ax=ax) | |
#gives same solution as mentioned in https://stackoverflow.com/questions/13784201/matplotlib-2-subplots-1-colorbar using ax=ax.ravel().tolist() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment