Skip to content

Commit

Permalink
Fix colorbar tick placements for data in range of 1..100
Browse files Browse the repository at this point in the history
gcpy/six_plot.py
- In routine "colorbar_for_small_data_range", now use
  pos = [vmin, vmin+vrange*0.25, vmin+vrange*0.5, vmin+vrange*0.75, vmax]
  which should place the intermediate tickpoints symmetrically.

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Oct 6, 2023
1 parent 343e229 commit 8dedac7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcpy/plot/six_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ def colorbar_for_small_data_range(

# Otherwise place ticks symmetrically along the data range
vrange = vmax - vmin
pos = [vmin, vrange*0.25, vrange*0.5, vrange*0.75, vmax]
pos = [vmin, vmin+vrange*0.25, vmin+vrange*0.5, vmin+vrange*0.75, vmax]
cbar.set_ticks(pos)
cbar.formatter = ticker.ScalarFormatter()
cbar.formatter.set_useOffset(False)
Expand Down

0 comments on commit 8dedac7

Please sign in to comment.