From 2e29d3b5ff9cd3e3b9d27c601a951539e9bc9619 Mon Sep 17 00:00:00 2001 From: srcarter3 Date: Fri, 4 Sep 2020 10:47:37 -0600 Subject: [PATCH] fix labels warning, fix cbar extend warning For the contourf function (last code block) the extend='both' parameter has to be passed into the contourf() function and removed from the colorbar() function in order to work and to not get a warning. --- examples/notebooks/Grid_Levels_and_Parameters.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/notebooks/Grid_Levels_and_Parameters.ipynb b/examples/notebooks/Grid_Levels_and_Parameters.ipynb index 5b1c62d..14b128a 100644 --- a/examples/notebooks/Grid_Levels_and_Parameters.ipynb +++ b/examples/notebooks/Grid_Levels_and_Parameters.ipynb @@ -944,7 +944,7 @@ " ax.set_extent(bbox)\n", " ax.coastlines(resolution='50m')\n", " gl = ax.gridlines(draw_labels=True)\n", - " gl.xlabels_top = gl.ylabels_right = False\n", + " gl.top_labels = gl.right_labels = False\n", " gl.xformatter = LONGITUDE_FORMATTER\n", " gl.yformatter = LATITUDE_FORMATTER\n", " return fig, ax\n", @@ -987,8 +987,8 @@ "source": [ "fig2, ax2 = make_map(bbox=bbox)\n", "cs2 = ax2.contourf(lons, lats, data, 80, cmap=cmap,\n", - " vmin=data.min(), vmax=data.max())\n", - "cbar2 = fig2.colorbar(cs2, extend='both', shrink=0.5, orientation='horizontal')\n", + " vmin=data.min(), vmax=data.max(), extend='both')\n", + "cbar2 = fig2.colorbar(cs2, shrink=0.5, orientation='horizontal')\n", "cbar2.set_label(grid.getLocationName() +\" \" + grid.getLevel() + \" \" \\\n", " + grid.getParameter() + \" (\" + grid.getUnit() + \") \" \\\n", " + \"valid \" + str(grid.getDataTime().getRefTime()))"