How to plot overlapping series using line and markers? How to plot overlapping series using line and markers? pandas pandas

How to plot overlapping series using line and markers?


The there are different possible formats for markevery. None of them uses the actual values to mark. Here, it makes sense to either use the indices of the values to mark, or a boolean array of the same length as the data. The latter would look like this:

import numpy as np markers_on = np.isin(df1.index, df2.index) plt.plot(df1["b"], '-gD', markevery=list(markers_on))plt.show()