[Again copying to matplotlib-users; maybe the main developers can comment on whether these shortcomings in the getp/setp interface should be fixed.]
Hi Derek,
It does seem as those these settings affect the top and bottom of the graph - I was wondering if it was possible to show tickmarks along the bottom edge but not the top edge?
I don't think that's directly supported. Here's a hacky way to do it:
lines = getp(gca(), 'xticklines')
toplines = [ l for l in lines if getp(l, 'ydata') == (1,) ]
setp(toplines, visible=False)
How I came up with this: I knew that I wanted to make some of the xticklines invisible, so I looked at the list of line objects for clues as to what differs between them. They seem to have xdata and ydata properties, and ydata is (0,) for half of the lines and (1,) for the other half, so it looks like it is the vertical position in axis coordinates. (xdata seems to be in data coordinates.)
And the other property I do not see on the list is the one that shows whether a tick goes "into" the graph or just "out" - in the prc file, there is a line:
xtick.direction : in # direction: in or out
but there is no "direction' property?
You're right, there is no obvious property to control this. Here's an even hackier way to do this (and one that doesn't look very future-proof):
for l in getp(gca(), 'xticklines'):
setp(l, 'marker', 5-getp(l, 'marker'))
The line objects have a marker property, which is 2 for some markers and 3 for the others... so I guessed that one of them means upwards and the other downwards, and checked this guess by flipping the xtick.direction parameter and looking again. So subtracting the marker from 5 flips the direction.
I wonder how this is done in Matlab?
label: any string
which shows me that the Yaxis has a label - in this case a
string - but I do not see how one can set the font properties
for the Yaxis label as it is not Text object??
I think you cannot do this with setp alone. Use the ylabel command:
ylabel('foo bar', fontsize=18)
···
--
Jouni