python pyplot: colorbar on contourf and scatter in same plot
问题 I have two different datasets. One is a numpy NxM matrix and another is a Lx3 pandas dataframe. I am overlaying scatter plot (Lx3 dataframe) on top of a contour plot (NxM) and the colorbar is scaling based on the scatter plot data. How can I force the colorbar to scale based on both data sets (How can I synchronize the colorbar on both plot layers) ? import numpy as np import matplotlib.pyplot as plt #generate random matrix with min value of 1 and max value 5 xx = np.random.choice(a = [1,2,3