SuperDARN / pydarn

Python library for visualizing SuperDARN Data
GNU Lesser General Public License v3.0
31 stars 11 forks source link

Fix colourbar preference not being preserved #374

Closed billetd closed 5 months ago

billetd commented 6 months ago

Scope

This is a very small PR which fixes the behaviour of colourbars when making a convection map. Previously, setting colorbar=False when using plot_mapdata() would not work if contour_fill=True. This is because plot_potential_contours() uses a different keyword to control the colourbar for contours, and the one used in plot_mapdata() only controls the velocity colourbar.

This PR adds a second keyword to control the potential contour colourbar, contour_colorbar, which is set to False as default.

Approval

1

Test

import pydarn
import matplotlib.pyplot as plt

mapfile = '20231004.n.map'
SDarn_read = pydarn.SuperDARNRead(mapfile)
map_data = SDarn_read.read_map()

pydarn.Maps.plot_mapdata(map_data, record=0, lowlat=50, coastline=True, contour_fill=True, color_vectors=False, colorbar=False, contour_colorbar=False)

Gives:

Screenshot 2024-02-13 at 9 57 47 AM
carleyjmartin commented 6 months ago

Tested with the comma put in and it works as expected.