I tried to plot a single line with multiple colors and for that I followed this example.
Exported pdf result has breaks at the starts and the ends of the lines, while I would like the result to a smooth line without breaks.
LineCollection plots every single line in one color, but I am also fine with smoothly changing colors.
I tried to add round ends for each line, but it does not affect the exported pdf result (while plt.show() plot looks nicer and with round edges in place).
Code for reference:
lc = mcoll.LineCollection(segments, array=z, cmap='copper', linewidth=3)
ax.add_collection(lc)
plt.savefig("{}_l.pdf".format(filenamebase))