Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # number of variable
- categories=list(data)[0:]
- N = len(categories)
- # Angles for plotting
- angles = [n / float(N) * 2 * pi for n in range(N)]
- angles += angles[:1]
- # Initialise
- f, ax = plt.subplots(1,1,figsize=(40,20))
- ax = plt.subplot(111, polar=True)
- # Draw one axe per variable
- plt.xticks(angles[:-1], color='grey', size=16)
- # the main problem in my code - placing yticks 'around' the plot
- # to be near the corresponding values
- for idx, an in enumerate(angles):
- ax.set_rlabel_position(an) # positioning labels at a given angle
- tick_values = [blue_values[idx],red_values[idx]] # to get the two labels values
- plt.yticks(tick_values, [x.rstrip('.0') for x in list(map(str, tick_values))], color="black", size=16)
- plt.ylim(0,max(red_values))
- # Add plots
- # Plot data
- ax.plot(angles, blue_values, linewidth=1, linestyle='solid')
- # Fill area
- ax.fill(angles, blue_values, 'b', alpha=0.5)
- # Plot data
- ax.plot(angles, red_values, linewidth=1, linestyle='solid')
- # Fill area
- ax.fill(angles, red_values, 'r', alpha=0.2)
Add Comment
Please, Sign In to add comment