msfz751

major_minor_demo2.py - datanitro

Oct 20th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. # major_minor_demo2.py
  2. import numpy as np
  3. import nitroplot
  4. from matplotlib.ticker import AutoMinorLocator
  5.  
  6. # example based on
  7. # http://matplotlib.org/examples/pylab_examples/major_minor_demo2.html
  8.  
  9. active_sheet("sine")
  10.  
  11.  
  12. # One can supply an argument to AutoMinorLocator to
  13. # specify a fixed number of minor intervals per major interval, e.g.:
  14. # minorLocator = AutoMinorLocator(2)
  15. # would lead to a single minor tick between major ticks.
  16.  
  17. minorLocator   = AutoMinorLocator()
  18.  
  19.  
  20. t, s = Cell("A1").vertical, Cell("B1").vertical
  21.  
  22. fig, ax = nitroplot.subplots()
  23. nitroplot.plot(t,s)
  24.  
  25. ax.xaxis.set_minor_locator(minorLocator)
  26.  
  27. nitroplot.tick_params(which='both', width=2)
  28. nitroplot.tick_params(which='major', length=7)
  29. nitroplot.tick_params(which='minor', length=4, color='r')
  30.  
  31. nitroplot.graph(
Advertisement
Add Comment
Please, Sign In to add comment