SuperDARN / pydarn

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

Add alpha to plt.colorbar when using pyplot.contourf #372

Closed billetd closed 7 months ago

billetd commented 7 months ago

Scope

This is a really small change to fix the alpha in the map potential colour bar. The mappable object created for the colour bar doesn't preserve the alpha used when using plt.contourf(). This change adds it in.

Current behaviour:

Screenshot 2024-01-31 at 2 58 15 PM

Fixed behaviour:

Screenshot 2024-01-31 at 3 29 54 PM

issue:

Approval

1

Test

import pydarn
import matplotlib.pyplot as plt
import datetime as dt

mapfile = '20221130.n.map'
SDarn_read = pydarn.SuperDARNRead(mapfile)
map_data = SDarn_read.read_map()
record = dt.datetime(2022, 11, 30, 15, 0)
pydarn.Maps.plot_mapdata(map_data, start_time=record, lowlat=50, coastline=True, contour_fill=True, color_vectors=False)