X and Y-axises is duplicated when major_formatter is set

I have a code to plot an empty graph: from datetime import datetime, timedelta from matplotlib import pyplot, dates pyplot.yticks([0,1,2,3,4]) ts_start = datetime.now() – timedelta(hours=1) ts_end = datetime.now() delta = timedelta(minutes=10) x_dates = dates.drange(ts_start, ts_end, delta=delta) pyplot.xlim(x_dates[0], x_dates[-1]) # fmt = dates.DateFormatter(‘%Y-%m-%d %H:%M:%S’) # pyplot.axes().xaxis.set_major_formatter(fmt) pyplot.tick_params(axis=’x’, labelrotation=30) pyplot.xticks(x_dates) pyplot.show() I want to display time in… Read More X and Y-axises is duplicated when major_formatter is set

Trying to change line thickness with matplotlib.mpatches.Patch

I am manually making a legend as there are too many inputs in my figure, so I use matplotlib.mpatches.Patch to make legend using: orange_patch = mpatches.Patch(color=’orange’, label=’n=505 distribution’, lw = 1) grey_patch = mpatches.Patch(color = ‘grey’, label = ‘n=100 sampled 100 times’, lw = 1) plt.legend(handles=[orange_patch, grey_patch], frameon = False) This works, but the lines… Read More Trying to change line thickness with matplotlib.mpatches.Patch