Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4e32ee

Browse files
author
shawnchen
committed
modify the gallery example of colorbar
1 parent d1e6266 commit a4e32ee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

examples/color/colorbar_basics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
fig.colorbar(pos, ax=ax1)
3333

3434
# repeat everything above for the negative data
35+
# you can specifiy location, anchor and shrink the colorbar
3536
neg = ax2.imshow(Zneg, cmap='Reds_r', interpolation='none')
36-
fig.colorbar(neg, ax=ax2)
37+
fig.colorbar(neg, ax=ax2, location='right', anchor=(0,0.3), shrink=0.7)
3738

3839
# Plot both positive and negative values between +/- 1.2
3940
pos_neg_clipped = ax3.imshow(Z, cmap='RdBu', vmin=-1.2, vmax=1.2,

0 commit comments

Comments
 (0)