|
From: John H. <jdh...@ac...> - 2004-11-19 15:11:10
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes:
Jochen> Hello, I used matplotlib to create a graphical
Jochen> representation of the boot process of my Debian GNU/Linux
Jochen> system. The result can be found at
Jochen> http://seehuhn.de/comp/bootlog.html
Jochen> and especially in the (2400x1500 sized) picture
Jochen> http://seehuhn.de/comp/bootlog2.png
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
matplotlib
Jochen> 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/major_minor_demo1.py 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 http://matplotlib.sf.net/matplotlib.ticker.html 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
ax.yaxis.grid(False)
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
possible?
ax.set_yticklabels('')
See also the functions xticks and yticks in the matlab interface for
easy customization of tick locations and labels.
Cheers,
JDH
|