On Thu, 2008-02-28 at 14:19 +0100, Bernhard Voigt wrote:
>
> How do I get rid of the redundant ticks on the top and right
> edges?
>
> pylab.gca().get_xaxis().set_ticks_postion('bottom')
>
> same for yaxis
That worked, thanks!
> Why is there such a big gap between the plot itself and the
> axes ticks?
>
> did you try pylab.axis('tight')
That did improve the situation slightly, but it still looks like
something odd is going on. It's clearer if I actually draw the axis
frame. These two screenshots show the graphic before and after calling
axis('tight'):
http://img87.imageshack.us/img87/7352/beforetightku8.png
http://img403.imageshack.us/img403/9506/aftertightyk5.png
As you can see the data moves a little closer to the axes when I call
axis('tight'). But that dashed line starts at (0,0), it is plotted with
the simple command:
plot([0,7],[0,7],color='#999999',linestyle='--')
and yet the beginning of the line is nowhere near either axis, even
after calling axis('tight'). So something's up. Here's the output of
axis('tight'):
(-0.33718689788053952,
7.0809248554913298,
-0.34782608695652173,
7.3043478260869561)
And here's the source code that produced the graphic in the first place:
rc('xtick.major',size=8)
rc('xtick',direction='out')
rc('ytick.major',size=8)
rc('ytick',direction='out')
fig = figure(facecolor='white' )
ax = axes(frameon=True)
ax.get_xaxis().set_ticks_position('bottom')
ax.get_yaxis().set_ticks_position('left')
title('Comparison of frequency of cards per function in week one and
week two')
s =
scatter(functions.proportioncardsweek1,functions.proportioncardsweek2,marker='s',color='g')
plot([0,7],[0,7],color='#999999',linestyle='--')
xlabel('Proportion of total number of cards, week 1')
ylabel('Proportion of total number of cards, week 2')
xticks(functions.proportioncardsweek1,'
'*len(functions.proportioncardsweek1))
yticks(functions.proportioncardsweek2,'
'*len(functions.proportioncardsweek2))
for function,x,y in
map(None,functions.shortnames,functions.proportioncardsweek1,functions.proportioncardsweek2):
annotate(function,xy=(x,y),size=8)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users