Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. def make_subplot_better(ax):
  2. ax.figure.subplots_adjust(bottom=0.15, left=0.125, right=0.925, top=0.90, hspace=0.5)
  3.  
  4. # set the grid on
  5. ax.grid('on')
  6.  
  7. # add more ticks
  8. ax.set_xticks(np.arange(25))
  9.  
  10. # remove tick marks
  11. ax.xaxis.set_tick_params(size=0)
  12. ax.yaxis.set_tick_params(size=0)
  13.  
  14. # change the color of the top and right spines to opaque gray
  15. ax.spines['right'].set_color((.8, .8, .8))
  16. ax.spines['top'].set_color((.8, .8, .8))
  17.  
  18. # tweak the axis labels
  19. xlab = ax.xaxis.get_label()
  20. ylab = ax.yaxis.get_label()
  21.  
  22. xlab.set_style('italic')
  23. xlab.set_size(10)
  24. ylab.set_style('italic')
  25. ylab.set_size(10)
  26.  
  27. # tweak the title
  28. ttl = ax.title
  29. ttl.set_weight('bold')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement