Re: [Matplotlib-users] making subplots more square

2009-05-24 Thread Eric Firing
per freem wrote:
> hi eric,
> 
> i tried your suggestion but it still did not work.  here's a code 
> snippet that demonstrates what i am trying to do:

No, I'm still baffled.  If you stack 3 subplots vertically in a figure 6 
inches high, they are going to be small.  You can fiddle with their 
sizes a bit by using subplots_adjust, but they are still going to be 
small--less than 2 inches high.  What physical dimensions do you want, 
when you say you want the plot to be "scaled bigger"?

Eric

> 
> import matplotlib.pyplot as 
> plt 
> from scipy import 
> * 
>   
>
> 
> my_fig = plt.figure(figsize=(7,6), 
> dpi=100) 
> plot_ax1 = 
> plt.subplot(3,1,1)   
> a = 
> rand(100) 
>
> 
> b = rand(100) + 
> rand()  
> plt.scatter(a, 
> b)   
> plot_ax1.set(xticklabels=[])  
>
> 
> plot_ax1.set_aspect('equal', 
> adjustable='box')  
> plt.savefig('myplot.pdf') 
>  
> 
>   
> 
> when i run this, i get a small square scatter plot in the middle of the 
> page. i want this plot to be scaled to be bigger.  if i remove the 
> set_aspect() call, the plot becomes bigger in the horizontal direction, 
> and is rectangular.
> 
> any ideas how to fix this?  thanks again.
> 
> On Sun, May 24, 2009 at 9:24 PM, Eric Firing  > wrote:
> 
> per freem wrote:
> 
> hi all,
> 
> i have a series of subplots organized in a column (3x1). i
> noticed that if i plot them then matplotlib tends to make the
> x-axis long and the y-axis short, so the plot is really
> rectangular. how can i make it more square? if i do:
> 
> f = figure(figsize=(7,6), dpi=100)
> p1 = subplot(3,1,1)
> plot()
> # make axes square
> p1.set_aspect('equal')
> 
> p2 = subplot(3,1,2)
> plot()
> p2.set_aspect('equal')
> 
> # etc for third subplot...
> 
> then the subplots i get are square, but very small and squished
> compared to the space they have in the figure (ie what i set in
> figsize.) how can i fix this? i just want to have square axes,
> but have each subplot take up as much space as it would if i
> didnt set square axes... it works fine for the rectangular axes
> case.
> 
> 
> Maybe what you are looking for is
> p1.set_aspect('equal', adjustable='datalim')
> 
> It is not clear from your message, but try the modification above
> and see if it does what you want.
> 
> Eric
> 
> 


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Failure to build due to missing X?

2009-05-24 Thread Jouni K . Seppänen
"John R. Cary"  writes:

> $ python setup.py install --prefix=/d/facets/contrib
> connect 173.8.244.121 port 6000: Connection timed out
> X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown).

Try unsetting your DISPLAY environment variable, e.g.

env DISPLAY= python setup.py install --prefix=/d/facets/contrib

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making subplots more square

2009-05-24 Thread per freem
hi eric,

i tried your suggestion but it still did not work.  here's a code snippet
that demonstrates what i am trying to do:

import matplotlib.pyplot as
plt
from scipy import
*


my_fig = plt.figure(figsize=(7,6),
dpi=100)
plot_ax1 =
plt.subplot(3,1,1)
a =
rand(100)

b = rand(100) +
rand()
plt.scatter(a,
b)
plot_ax1.set(xticklabels=[])

plot_ax1.set_aspect('equal',
adjustable='box')
plt.savefig('myplot.pdf')



when i run this, i get a small square scatter plot in the middle of the
page. i want this plot to be scaled to be bigger.  if i remove the
set_aspect() call, the plot becomes bigger in the horizontal direction, and
is rectangular.

any ideas how to fix this?  thanks again.

On Sun, May 24, 2009 at 9:24 PM, Eric Firing  wrote:

> per freem wrote:
>
>> hi all,
>>
>> i have a series of subplots organized in a column (3x1). i noticed that if
>> i plot them then matplotlib tends to make the x-axis long and the y-axis
>> short, so the plot is really rectangular. how can i make it more square? if
>> i do:
>>
>> f = figure(figsize=(7,6), dpi=100)
>> p1 = subplot(3,1,1)
>> plot()
>> # make axes square
>> p1.set_aspect('equal')
>>
>> p2 = subplot(3,1,2)
>> plot()
>> p2.set_aspect('equal')
>>
>> # etc for third subplot...
>>
>> then the subplots i get are square, but very small and squished compared
>> to the space they have in the figure (ie what i set in figsize.) how can i
>> fix this? i just want to have square axes, but have each subplot take up as
>> much space as it would if i didnt set square axes... it works fine for the
>> rectangular axes case.
>>
>
> Maybe what you are looking for is
> p1.set_aspect('equal', adjustable='datalim')
>
> It is not clear from your message, but try the modification above and see
> if it does what you want.
>
> Eric
>
--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Failure to build due to missing X?

2009-05-24 Thread John Hunter
On Sun, May 24, 2009 at 11:18 AM, John R. Cary  wrote:
> $ python setup.py install --prefix=/d/facets/contrib
> 
> BUILDING MATPLOTLIB
>            matplotlib: 0.98.5
>                python: 2.5.2 (r252:60911, Dec 15 2008, 17:11:36)  [GCC
>                        3.4.6 20060404 (Red Hat 3.4.6-10)]
>              platform: linux2
>
> REQUIRED DEPENDENCIES
>                 numpy: 1.2.1.1
>             freetype2: 9.7.3
>
> OPTIONAL BACKEND DEPENDENCIES
>                libpng: 1.2.7
> connect 173.8.244.121 port 6000: Connection timed out
> X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown).
>
> Is this expected?  Any way around?
>
> Thanks..John Cary

It is not expected in that I do not know why the connection was broken
(did it once exits, do you expect X connectivity in your build
environment?).  I am not sure why the X connection was broken, whether
you wanted it, or whether you wanted it to persist.  mpl can be built
w/o an X connection, but not all of the mpl backends can.  Details on
all of the mpl backends can be found here:

http://matplotlib.sourceforge.net/faq/installing_faq.html#backends

A plain vanilla mpl install which can generate PS, PDF, SVG and PNG
should be buildable w/o an X connection.  You can copy the
setup.cfg.template file which lives alongside setup.py to setup.cfg
and edit it to turn off optional GUI backend building.

But if you want an mpl install that works with one or more GUIs, you
may need an X connnection.  That is because mpl tries to import one or
more GUI toolkits at build time to see if they are present as part of
an auto-configure routine.  If they are present, we try and build our
extensions for them.  So, for example, when we try and import pygtk to
see if we should build our gtk extensions, an X connection is made.
You might be able to work around this by explicitly stating in
setup.cfg which backends you want to build, turning off all
non-essential ones.

JDH

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Failure to build due to missing X?

2009-05-24 Thread John R. Cary
$ python setup.py install --prefix=/d/facets/contrib

BUILDING MATPLOTLIB
matplotlib: 0.98.5
python: 2.5.2 (r252:60911, Dec 15 2008, 17:11:36)  [GCC
3.4.6 20060404 (Red Hat 3.4.6-10)]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.2.1.1
 freetype2: 9.7.3

OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.7
connect 173.8.244.121 port 6000: Connection timed out
X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown).

Is this expected?  Any way around?

Thanks..John Cary

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] making subplots more square

2009-05-24 Thread Eric Firing
per freem wrote:
> hi all,
> 
> i have a series of subplots organized in a column (3x1). i noticed that 
> if i plot them then matplotlib tends to make the x-axis long and the 
> y-axis short, so the plot is really rectangular. how can i make it more 
> square? if i do:
> 
> f = figure(figsize=(7,6), dpi=100)
> p1 = subplot(3,1,1)
> plot()
> # make axes square
> p1.set_aspect('equal')
> 
> p2 = subplot(3,1,2)
> plot()
> p2.set_aspect('equal')
> 
> # etc for third subplot...
> 
> then the subplots i get are square, but very small and squished compared 
> to the space they have in the figure (ie what i set in figsize.) how can 
> i fix this? i just want to have square axes, but have each subplot take 
> up as much space as it would if i didnt set square axes... it works fine 
> for the rectangular axes case.

Maybe what you are looking for is
p1.set_aspect('equal', adjustable='datalim')

It is not clear from your message, but try the modification above and 
see if it does what you want.

Eric

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] making subplots more square

2009-05-24 Thread per freem
hi all,

i have a series of subplots organized in a column (3x1). i noticed that if i
plot them then matplotlib tends to make the x-axis long and the y-axis
short, so the plot is really rectangular. how can i make it more square? if
i do:

f = figure(figsize=(7,6), dpi=100)
p1 = subplot(3,1,1)
plot()
# make axes square
p1.set_aspect('equal')

p2 = subplot(3,1,2)
plot()
p2.set_aspect('equal')

# etc for third subplot...

then the subplots i get are square, but very small and squished compared to
the space they have in the figure (ie what i set in figsize.) how can i fix
this? i just want to have square axes, but have each subplot take up as much
space as it would if i didnt set square axes... it works fine for the
rectangular axes case.
--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] x= / y= labels default format is wrong

2009-05-24 Thread Xavier Gnata
Hello all,

I routinely work with images sizes >  [1000,1000].
There is a slight annoying problem whatever the backend I use:
Pixels coordinates default format is wrong.
It does not make sense to display "x=1.42e+03,y=1.92e+03".
Pixels coordinates should be formated *by default* as integers.

Would it be possible to fix that?

Steps to reproduce:
import numpy
import pylab
a=numpy.random.random((2000,2000))
pylab.imshow(a,interpolation='Nearest')


Xavier

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] LineCollection and fill....

2009-05-24 Thread vehemental

Hi guys,

I' m playing around with line collections, and I was wondering if it was
possible to use fill with line collections?

or maybe I would have to use PolyCollection?

would it represents a big challenge to include that in Linecollection? (just
to know if I could do it myself eventually)

on a not completely related note... is there a sweet spot when
LineCollection is faster than multiple over plots?...I'm plotting 1300 lines
of 3000 points each...and the overplot solution is still faster (though
using 2 or 3 times memory)

J.
-- 
View this message in context: 
http://www.nabble.com/LineCollection-and-fill-tp23693305p23693305.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users