I'd like to create an inset within my fig which is a zoom in on part of my polar plot.
I've tried various different methods but can't seem to crack the correct way to do using matplotlib. My code to create the plot (from my pandas dataframe) is below. I've also included the plot that it produces.
def plot_polar_chart_new(n, start, df, sales, title):
HSV_tuples = [(x * 1.0 / n, 0.5, 0.5) for x in range(n)]
RGB_tuples = map(lambda x: colorsys.hsv_to_rgb(*x), HSV_tuples)
RGB_normalised = [tuple(n / max(t) for n in t) for t in RGB_tuples]
figsize=(15, 15)
fig = mpl.pyplot.figure(figsize=figsize)
ax = fig.add_subplot(1,1,1, polar=True)
start = 0
prev_count = 0
for i, salesperson in enumerate(sales):
count, division = (df[salesperson], df.index)
ax.bar((division - start) * 2 * np.pi / N, height=count, width=2 * np.pi / N, color=RGB_normalised[i], bottom=prev_count, label=salesperson)
prev_count += count
ax.set_xticks(np.linspace(0, 2 * np.pi, N, endpoint=False))
ax.set_xticklabels(range(start, N + start),fontsize=20)
ax.yaxis.set_tick_params(labelsize=20)
ax.set_theta_direction(-1)
ax.set_theta_offset(np.pi / 2.0)
ax.set_title(title, y=1.1, fontsize=20)
ax.legend(bbox_to_anchor=(0.9, 1.1), loc=2)
mpl.pyplot.show()
I'd like to create a plot inset which zooms in on part of the plot between 17 and 02.
Please help! Thanks
