Formatting X-axis

I want to format my graph as in MS-Excel. I don't know what term to use for
this.
It looks like the X-axis has 2 labels on them.
http://old.nabble.com/file/p28579609/omp_parallel.png

I have showed it in the image that is generated from Excel. I want to have
exactly the same
using matplotlib.

Can anyone tell me how exactly this can be achieved?

Thanks !
Raj.

···

--
View this message in context: http://old.nabble.com/Formatting-X-axis-tp28579609p28579609.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Is there any API to draw the lines between the labels?
I guess its not possible with this tool.

···

--
View this message in context: http://old.nabble.com/Formatting-X-axis-tp28579609p28585415.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hi,

Is there any API to draw the lines between the labels?
I guess its not possible with this tool.

You could use the ticks' properties (one of their children is a
matplotlib.lines.Line2D instance which you could modify to your wishes). The
second possibility is see is you put a box with only two drawn borders around
the labels, which I think might lead to problems.

So if you want to inspect, what you can do with those ticks you can use

pyplot.getp(object_to_inspect) and pyplot.setp(object_to_inspect) aswell as
dir(object_to_inspect).

I mostly do this by having an open python shell where I create and check out
the properties I want to work on and a little script I modify to check out how
the changes affect the plot. What I did looked something like this:

from matplotlib import pyplot
fig = pyplot.figure()
p = fig.add_subplot(111)
p.yaxis.set_ticks([3,4,5])

[<matplotlib.axis.YTick object at 0xa3b580c>, <matplotlib.axis.YTick object at
0xa6861cc>, <matplotlib.axis.YTick object at 0xa6a858c>]

m = p.yaxis.set_ticks([3,4,5])
dir(m[0])

['__class__', '__d..........., 'get_children', 'get_cli.......]

pyplot.getp(m[0])

    alpha = 1.0
...
    children = [<matplotlib.lines.Line2D object at 0xa3b5fac>, <m...
...

m[0].get_children()
pyplot.getp(m[0].get_children()[0])
pyplot.setp(m[0].get_children()[0])

and if you don't have the return of creating the ticks ("m" in this case) then
you can get then using

p.yaxis.get_children()

[<matplotlib.text.Text object at 0xaa80a6c>, <matplotlib.axis.YTick object at
0xaa9494c>, <matplotlib.axis.YTick object at 0xaa80a0c>,
<matplotlib.axis.YTick object at 0xaab650c>, <matplotlib.axis.YTick object at
0xaab652c>, <matplotlib.axis.YTick object at 0xaab68ec>,
<matplotlib.axis.YTick object at 0xaab6cec>]

Hope it helps,

Malte