Get the current property cycle, create a new cycler object for the line styles, and define a new property cycle using a multiplication operator, that here means an outer product.
current_prop_cycle = plt.rcParams['axes.prop_cycle']
from cycler import cycler
style_cycler = cycler('linestyle', ["solid", "dotted", "dashed", "dashdot"])
new_prop_cycle = current_prop_cycle * style_cycler
Next, change the property cycle for a single subplot
ax.set_prop_cycle(new_prop_cycle)
or change the default for the rest of your script
plt.rc('axes', prop_cycle=new_prop_cycle)
ps — the cycler cycles on all the combinations of colors and line styles, with line styles changing faster, c1 s1, c1 s2, ..., c2 s1, ...
, if you want c1 s1, c2 s1, ...
simply invert the order of the outer product, that is not commutative.