[Matplotlib-users] remove white area around

2011-06-13 Thread Andrea Crotti
I found this question asked other times, but trying myself there is no way that I get something working.. So I just want to generate a pdf from a plot with the smallest possible margin, and I was trying for example this: fig = plt.figure(1) fig.frameon = False plt.plot(range(10), ran

[Matplotlib-users] Turn off autoscale and optional subplots

2011-04-13 Thread Andrea Crotti
I need to generate in some cases a subplot with two plots one on top of the other, and in some other cases just one subplot. So after some attempts I ended up with the ugliest code I've ever written (maybe not) that you see below. Is there a better way to do it? I still didn't fully get how to get

[Matplotlib-users] bins and histograms

2011-03-10 Thread Andrea Crotti
I'm having some troubles understanding basic concepts. Suppose I want to do something like this, given a dictionary values = { (0,10) : 0.5, (10, 20) : 0.3 } and so on, where the key is a time slot interval and the value is the value I want to plot. What should be the correct way to get

[Matplotlib-users] bins and histograms

2011-03-10 Thread Andrea Crotti
I'm having some troubles understanding basic concepts. Suppose I want to do something like this, given a dictionary values = { (0,10) : 0.5, (10, 20) : 0.3 } and so on, where the key is a time slot interval and the value is the value I want to plot. What should be the correct way to get

[Matplotlib-users] bins and histograms

2011-03-10 Thread Andrea Crotti
I'm having some troubles understanding basic concepts. Suppose I want to do something like this, given a dictionary values = { (0,10) : 0.5, (10, 20) : 0.3 } and so on, where the key is a time slot interval and the value is the value I want to plot. What should be the correct way to get

Re: [Matplotlib-users] Text box adaptable

2011-03-08 Thread Andrea Crotti
Goyo writes: > > As Ben explained you need to draw first. So the usual path is: > 1. Draw > 2. Figure out the size of potentially problematic things (labels, > titles...) and the space you need. > 3. Adjust subplots or whatever needs adjustment to fit. > 4. Draw again. > > Sort of weird but it wo

Re: [Matplotlib-users] Text box adaptable

2011-03-07 Thread Andrea Crotti
Here I am again with the text boxing and scaling. I'm having some troubles to understand the whole picture, since it seems that there are so many actors involved. So suppose I have some text and I want to see how big it is, I thought I could t = matplotlib.text.Text(0, 0, "very long string") t.ge

[Matplotlib-users] Easy_setup

2011-03-01 Thread Andrea Crotti
Some time ago I tried to install matplotlib using zc.buildout, to make sure I always had the same version everywhere and so on. Even if numpy was installed it was not found, and someone told me to modify the setup.py of matplotlib. But since I think it should work out of the box I think I'm doing

Re: [Matplotlib-users] Make the area a bit larger

2011-03-01 Thread Andrea Crotti
Paul Ivanov writes: > > Hi Andrea, > > I think Gökhan is pointing out a different feature than the one > you want. You seem to want to adjust the x and y limits of the > plot to be some fraction larger than the data that's plotted. > > You can do this with: > > ax = plt.subplot(111) > ax.plot(ra

Re: [Matplotlib-users] Make the area a bit larger

2011-03-01 Thread Andrea Crotti
Gökhan Sever writes: > Hi, > > You can try: > > fig, ax = plt.subplots(1,1) > ax.plot(range(10)) > fig.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95) > > If you choose WXAgg as your backend you get a nice config tool to adjust > spacing in the figure. Then just pass those numbers in

[Matplotlib-users] Make the area a bit larger

2011-02-28 Thread Andrea Crotti
So since I wanted some space on the borders of my graph, I did this really extremely convoluted thing, which apparently works... I get a 10% more area on each side, but I'm quite sure there's a better way to this, right? I didn't find any function to pass an increment to the size that's why I did

Re: [Matplotlib-users] Text box adaptable

2011-02-27 Thread andrea crotti
2011/2/18 Benjamin Root : > > > Automatic layouts are difficult to do in matplotlib.  This was a design > decision trade-off made early in its development.  Instead of having > matplotlib determining optimal layouts and such, the developers decided that > it would be better to give the programmers

[Matplotlib-users] Text box adaptable

2011-02-18 Thread andrea crotti
Hi everyone, and thanks for the amazing library first of all :) Now a short question, I have some graphs and I would like to add some statistical summary as text on the figure. I see how I can add text and it's quite easy, the problem is that the text wants a coordinate to write the graph. And