Re: [Matplotlib-users] colorbar questions ...

2010-09-14 Thread Oz Nahum
Hi Ben,
Thanks for your reply it sure helps.
My awkward work around until now was to put before the colorbar:
matplotlib.rc('axes',edgecolor='w')

and the return it to
matplotlib.rc('axes',edgecolor='k').

Does some one knows how to increase the distance between the color bar and
the X-axis ?

Now I noticed that the color bar hides the xlabel 

Thanks again,

Oz


 I agree, Colorbar isn't the most elegant of objects and is probably due for
 some improvements.  I am sure there is probably a better way to do what you
 have done, but I am not familiar with it.  Anyway, to get rid of the box
 around the colorbar, the colorbar object has a member attribute called
 outline which you can set_visible(False).

 a = plt.colorbar()
 a.outline.set_visible(False)

 Should do the trick for that part.

 I hope this helps!
 Ben Root





-- 
Oz Nahum
Graduate Student
Zentrum für Angewandte Geologie
Universität Tübingen

---

Imagine there's no countries
it isn't hard to do
Nothing to kill or die for
And no religion too
Imagine all the people
Living life in peace
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib on Ubuntu 10.04 (64-bit)

2010-09-14 Thread Eric Firing
On 09/13/2010 04:46 PM, jules hummon wrote:
 Virgil

 The scheme illustrated below actually does work.

 Message: 5
 Date: Mon, 13 Sep 2010 12:55:43 -1000
 From: Eric Firingefir...@hawaii.edu
 Subject: Re: [Matplotlib-users] matplotlib on Ubuntu 10.04 (64-bit)
 To: matplotlib-users@lists.sourceforge.net
 Message-ID:4c8eabef.30...@hawaii.edu
 Content-Type: text/plain; charset=iso-8859-1

 On 09/13/2010 12:08 PM, Virgil Stokes wrote:
On 2010-09-13 21:55, Benjamin Root wrote:
 On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokesv...@it.uu.se
 mailto:v...@it.uu.se  wrote:



 If you would like up-to-date versions of both numpy and matplotlib, then
 you can either find and install the *dev packages individually, or do
 something like this:

 sudo apt-get build-dep python-matplotlib
 sudo apt-get remove python
 ^^^

 No, that is probably supposed to be

   sudo apt-get remove numpy

Horrible mistake on my part.  Put your version and mine together, and it 
works:

sudo apt-get remove python-numpy



 Now untar your numpy, go in, build and install:

 setup.py build
 sudo setup.py install

 And last, do the same for matplotlib, preferably with a checkout from
 svn.  Some bugs have been fixed since the last release.

 Before all of this, you might do well to uninstall whatever versions or
 parts of numpy and matplotlib had been installed via your previous efforts.

   [snip]
   
 Eric

 You can tell whether you have any leftover pieces of numpy or matplotlib
 from the *.deb files by looking in /usr/lib/python2.6/dist-packages
 for numpy or matplotlib.

 Eric, the script was scrubbed.  Does it land somewhere else?

It was in the message as distributed, and as received by at least one 
mail archive:

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg18475.html

Eric


 Jules

 (Jules Hummon/Univ. Hawaii/physical oceanography)


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib on Ubuntu 10.04 (64-bit)

2010-09-14 Thread Eric Firing
On 09/13/2010 12:55 PM, Eric Firing wrote:
 If you would like up-to-date versions of both numpy and matplotlib, then
 you can either find and install the *dev packages individually, or do
 something like this:

 sudo apt-get build-dep python-matplotlib
 sudo apt-get remove python

No! I meant:

sudo apt-get remove python-numpy

Eric



 Now untar your numpy, go in, build and install:


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with MPL+py2exe (wx app needs qt?)

2010-09-14 Thread Stephen George
  On 14/09/2010 8:18 AM, Carlos Grohmann wrote:
 Many thanks, that helper.

 After some more problems with scipy, I got a working EXE.

 PyQt4 is still in the library, though. Eating almost 15Mb... Now all I
 have to do is to find out how to remove it..


 cheers

 Carlos


Have you read the info on py2exe wiki relating to matplotlib

http://www.py2exe.org/index.cgi/MatPlotLib
Have a look at  section on Backends

Steve

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib on Ubuntu 10.04 (64-bit)

2010-09-14 Thread Virgil Stokes
  On 14-Sep-2010 00:55, Eric Firing wrote:
 On 09/13/2010 12:08 PM, Virgil Stokes wrote:
   On 2010-09-13 21:55, Benjamin Root wrote:
 On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokes v...@it.uu.se
 mailto:v...@it.uu.se wrote:

 I have tried to produce a very simple plot with my recent
 installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit)
 using the following code (taken from the matplotlib tutorial
 material).

 *import matplotlib
 import numpy
 import matplotlib.pyplot as plt

 print matplotlib.__version__
 print numpy.__version__

 plt.plot([1,2,3,4])
 plt.ylabel('some numbers')
 plt.show()*

 If I execute this in Windows 7 (64-bit) it works correctly. If I
 execute this in Windows Vista (32-bit) it works correctly.
 If I execute this in Ubuntu 10.04 64-bit the versions are printed
 out correctly and thus I believe that the packages are being
 imported; but, /no plot is produced!/

 Why not?


 Virgil,

 Did you build matplotlib from source?
 I did try this and believe that it succeeded (saw no errors displayed
 during the build).
 If so, then chances are that one or more backends were not built
 properly.
 But, I do not understand what you mean here...
 This typically happens if you do not have all the build dependencies.
 And what can I do to correct this?

 Note, the build will not necessarily fail if some dependencies are
 missing because the core portions of matplotlib still build successfully.
 Sorry Ben, bu I do not understand what you mean here.
 Would you please explain how I can use some combination of the following
 (with Python 2.6 on Ubuntu 10.04 both 64-bit) to get a working
 matplotlib and numpy.

 * *python-numpy_1.4.1-4_amd64.deb*
 * *python-numpy_1.5.0-1ppa1_amd64.deb*
 * *numpy-1.5.0.tar.gz*

 and,

 * *matplotlib_0.99.3-1ubuntu1.debian.tar.gz*
 * *matplotlib_0.99.3.orig.tar.gz*
 * *matplotlib-1.0.0.tar.gz*

 This has become such a frustrating task that I would settle for vers.
 0.99.3 of matplotlib and/or vers. 1.4.1-4 of numpy. I thought I
 understood Python and Ubuntu 10.04 enough to accomplish this task; but,
 obviously this was not the case. And I have looked at the FAQs and help
 given at matplotlib's homepage.

 If you would like up-to-date versions of both numpy and matplotlib, then you 
 can either find and install the *dev packages individually, or do something 
 like this:

 sudo apt-get build-dep python-matplotlib
 sudo apt-get remove python
Very interesting --- what do these two commands actually do? (Just a short 
explanation would be appreciated)

 Now untar your numpy, go in, build and install:

 setup.py build
 sudo setup.py install
Yes, this makes good sense...

 And last, do the same for matplotlib, preferably with a checkout from svn.  
 Some bugs have been fixed since the last release.
Never, have installed from svn; but, I assume that there is a tar file there 
that I can download and use for a 64-bit Linux system.

 Before all of this, you might do well to uninstall whatever versions or parts 
 of numpy and matplotlib had been installed via your previous efforts.
Yes, I have already done this; but, I will check this carefully again before I 
start the reinstallation process.

 The point of the first apt-get is to install things like freetype and the gui 
 toolkits.  The only problem is that this also installs an old version of 
 numpy, hence the second apt-get command.
Ok, this seems to have answered my previous question.

 The good news is that once you get over the hump of having the dependencies 
 installed, subsequent updates and compilations of numpy and matplotlib are 
 easy.  It is usually advisable to delete the build directory, since setup.py 
 is not very smart with respect to knowing what needs to be recompiled.  
 Sometimes it is also necessary to clean out the old version from its 
 installation location.  See attached script for an example of mpl 
 uninstallation.
This is exactly where I was headed --- a complete and new mpl installation with 
the latest matplotlib.

Thanks for all the tips and pointing me in the correct direction. I will get 
back to you on how it went.

--V

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Ternary Plotting using Matplotlib

2010-09-14 Thread Lab Rat
I saw some 3d ternary plots on the URL:
http://www.hca.com/index.php?id=76L=0 that I'd love to recreate using
matplotlib.  Can anyone give me some general code examples of where I should
likely begin?
Thanks in advance!
Wil
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] weird behaviour in x axis

2010-09-14 Thread Jan Skowron
Hi,
apropos this offset discussion.
matplotlib makes offsets not aligned to the full tens or some other
easy number with small amount of non-zero digits in front?

For example having ticks:
4917, 4918, 4919, 4920, 4921, 4922

it will now display:
1, 2, 3, 4, 5, 6   with offset 4916  (of even +4.916e3)

this makes reading values on the axis really really hard as every time
one have to perform not obvious summations with all digits of length.
It would be beneficial to have as a default behaviour some
optimization of offsets to have it as some basic number for easy
reading instead of current behaviour that tries to minimize the number
of digits in the ticks and starts from a low number like 1 or 0.05 or
so.
In our case the best display would be:

17, 18, 19, 20, 21, 22  with offset 4900

So we minimize the number of non-zero digits in offset and not a
number of digits in tick labels.

Another more ridiculous example (from life) are ticks with values:

4916.25, 4916.30, 4916.35, 4916.40, 4916.45

are displayed as:

0.05, 0.10, 0.15, 0.20, 0.25   with offset +4.9162e3

and with good algorithm should be displayed as:

0.25, 0.30, 0.35, 0.40, 0.45  with offset 4962  (nottice that not
+4.962e3 as it usually displays now)

and if we would cross the boundary between 4962 and 4963 than ticks
should look like:
2.80, 2.85, 2.90, 2.95, 3.00, 3.05   with offset 4960


In my opinion the current behaviour of offsets really hampers the
usability of these at all, and probably 90% of users spent some time
on nothing but trying to figure out how to turn this thing off (thanks
for sending this solutions here).

So this is message to signal or show the need for fixing this
algorithm. For now I think that the title of this post: weird
behaviour in x axis, really summarize current offset algorithm
nicely.


Thanks for your comments,
Jan



On Mon, Sep 13, 2010 at 18:35, Eric Firing efir...@hawaii.edu wrote:
 On 09/11/2010 11:12 AM, freekk wrote:

 Im trying to do a very simple x vs y plot. Where the x values range between
 3247 and 3256 and y between 0 and 1. This data is stored in data.dat. I plot
 it using the code below, the resulting plot is shown in the first of the two
 plots below. Everything goes well except for the x axis, for some reason
 tickmarks from 0 up to 9 appear. At the far end of the axis my xmin is
 printed: 3.247e3.
 I started looking for the cause and it turns out that as long as my range in
 x is lower than 10, this happens. If I change the xlimits to xlim(3246,3256)
 I get the plot at the bottom of this page, everything is fine. But if I
 change this to for instance xlim(3246.01,3256) or xlim(3245, 3254.99) I get
 the same behaviour as in the first graph.

 Does any one have any experience with this/ know the reason for this
 happening? Thanks!

 from numpy import *
 from pylab import *

 datafile = mlab.load('./data.dat')
 xx=datafile[:,0]
 yy=datafile[:,1]

 plot(xx,yy,'black')
 xlim(3247,3256)
 ylim(0,1.2)

 with older mpl, try this:

 gca().xaxis.set_major_formatter(ScalarFormatter(useOffset=False))

 with 1.0 or later try the following instead:

 ticklabel_format(useOffset=False)

 Eric


 show()


 http://old.nabble.com/file/p29687404/wrong.png
 http://old.nabble.com/file/p29687404/right.png


 --
 Start uncovering the many advantages of virtual appliances
 and start using them to simplify application deployment and
 accelerate your shift to cloud computing.
 http://p.sf.net/sfu/novell-sfdev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib on Ubuntu 10.04 (64-bit)

2010-09-14 Thread Virgil Stokes

 On 14-Sep-2010 09:25, Eric Firing wrote:

On 09/13/2010 12:55 PM, Eric Firing wrote:

If you would like up-to-date versions of both numpy and matplotlib, then
you can either find and install the *dev packages individually, or do
something like this:

sudo apt-get build-dep python-matplotlib
sudo apt-get remove python

No! I meant:

sudo apt-get remove python-numpy

Eric



Now untar your numpy, go in, build and install:


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Ok Eric and Ben,
You made  my day --- I now have the latest numpy and matplotlib up and running 
on my Ubuntu 10.04 64-bit system. Some preliminary testing indicates things are 
working as they should. I am now summarizing what you had posted earlier on this 
problem Eric, so that others might benefit from your expertise  (as I have):


*#  Thanks to Eric Firing (efir...@hawaii.edu) who is a member of the matplotlib
#   user group for this clever use of Linux commands to accomplish the task
#   that solved my problem :-)
#
#  Lets clean the slate before a reinstallation (if you believe older versions 
are present)

sudo rm -rf /usr/local/lib/python2.6/dist-packages/matplotlib*
sudo rm -rf /usr/local/lib/python2.6/dist-packages/pylab*
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/mplot3d
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/axisartist
sudo rm  /usr/local/lib/python2.6/dist-packages/mpl_toolkits/*.py*

*# Install all the dependencies (installs an old version of numpy)
sudo apt-get build-dep python-matplotlib
# Now to get rid of the old version of numpy
sudo apt-get remove python-numpy

# Download the latest numpy tar, untar it, then navigate to
#  where setup.py for numpy is located and give the following commands
python setup.py build
python setup.py install

# Repeat the previous for matplotlib (download tar, untar it, etc.)
python setup.py build
python setup.py install*

and th-th-tha-that-that's all folks!

--V
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users