Okay I've learnt a bit more about this:
I need to explicitly make a new figure as well as a new axis, and put
the rc calls before the figure calls, rc changes only seem to take
effect on figures created afterwards. Also I was stupidly using the plot
function (for plotting lines) for a scatter plot, I've now discovered
the scatter function.
Things are pretty much how I want them now, but I still have a couple of
How do I get rid of the redundant ticks on the top and right edges?
Is there any way to stop some of my text labels from overlapping?
Why is there such a big gap between the plot itself and the axes ticks?
The scatter function seems to do this, but I don't see any option to
control the size of the gap. I wonder if I've done something weird like
create an axes within an axes. I would like to get rid of the gap because
it makes the graphic less readable, in particular it gives a misleading
impression about where (0,0) is located.
Here's my new source code:
fig = figure(facecolor='white' )
title('Comparison of lower- and upper-bounds per function in week one
and week two')
for function,x,y in
for function,x,y in
On Tue, 2008-02-26 at 16:51 +0000, chombee wrote:
> I'm having a couple of problems drawing a basic relational scatter plot.
> (Specifically, it's called a dot-dash-plot in the book I have and is
> described as "framing the bivariate scatter with the marginal distribution
> of each variable.") The idea is that you have a bivariate scatter plot
> and use the two marginal frequency distributions of the data as the two
> 1. By setting the x and y tick length and using space characters as the
> tick labels I was able to get ticks only and no labels on the axes as I
> want. But these ticks appear along the top and right edges of the plot,
> as well as the left and bottom. Is there any way to get rid of the top
> and right ticks?
> 2. I'm getting phantom numbers on my axes, the 0.2, 0.4, 0.6 etc. I
> don't know where these are coming from or what they measure (my data
> ranges from 0-7 on both axes, not 0-1).
> 3. I want to label each data point with a string. I'm doing this with
> annotate but the strings sometimes overlap each other. Any idea how to
> avoid this?
> Here's a PNG of my plot as it is:
> And here's the source:
> # datax and datay are equal length lists of floats, the data I want to
> # plot. labels is another equal length list containing the strings I
> # want to label the data points with. All three lists are in the same
> # order.
> xticks(datax,' '*len(datax))
> yticks(datay,' '*len(datay))
> xlabel('Proportion of total number of cards, week 1')
> ylabel('Proportion of total number of cards, week 2')
> title('Frequency of cards per function')
> for label,x,y in map(None,labels,datax,datay):
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> Matplotlib-users mailing list