only vertical grid lines?

Hello, I used matplotlib to create a graphical

    > representation of the boot process of my Debian GNU/Linux
    > system. The result can be found at

    > Profile of the Boot Process of a Debian System

    > and especially in the (2400x1500 sized) picture


Very nice - you manage to pack a lot of information into the graph.
Edward Tufte would be proud! It's nice to have folks stress testing

    > I have a question about matplotlib usage:

  * I would like the picture to have vertical grid lines at positions
    1, 2, 3, 4, ..., On the horizontal x-Axis I would like to see
    labels at positions 0, 5, 10, 15, ...

The best way to do this would be to use minor ticks on 1,2,3,4,etc and
major ticks on 0,5,10,15 - the grids occur at the locations of the
ticks, and you can customize how you want the ticks labeled. See
examples/ and the use of the MultipleLocator. The
Multiple locator places ticks at multiples of some base. For you minor
ticks you would use MultipleLocator(1) and for your major ticks
MultipleLocator(1). The labels for the minor ticks are off by default
which is what you want, though you can customize this.

See for more info.

  * not horizonzal grid lines.

The ax.xaxis.grid and ax.yaxis.grid functions can be used to
selectively turn on and off the grids for the respective axes. The
signature is

    def grid(self, b, which='major'):

where b is a boolean. You can use this to control gridding for the
major and minor ticks on a per-axis basis. So


selectively turns off the grids for the y axis major tick grid lines.
The minor grids are off by default. You can turn them on, eg with

   ax.xaxis.grid(True, which='minor')

  * and I would like to get rid of the labels on the y-Axis. Is this


See also the functions xticks and yticks in the matlab interface for
easy customization of tick locations and labels.


Hello John,

thanks a lot for your help. My picture is improving.
But one problem is left: the script

    from matplotlib.matlab import *
    from matplotlib.ticker import MultipleLocator

    ax.xaxis.grid(True, which="minor")


has vertical grid lines ONLY on the minor ticks, which looks silly.
How do I get regularly spaced grid lines here?

All the best,