[Matplotlib-users] editor ?

2008-01-21 Thread Giorgio . Luciano
I was just wondering if there is any "editor" for the figures done in 
matplotlib. I mean something like the matlab(TM) figure or esayplot for 
QToctave. Since I use a software that use embedded matplotlib and after 
having the plot it could be very helpful to have somthing that can help 
"tweaking" the figure without using command line
Thanks in advance for every hints/suggestion
Giorgio-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Using non ascii characters

2008-01-21 Thread BL
   Hi,

I would like to use non ascii characters in title and label but with my
current intallation it does not work properly.
There's no warning or error messages when I set a title with some non ascii
characters (I use iso-88599-1 characters, like é or à), but I get a empty
square instead of theses characters in the figure.

I'm using matplotlib-0.90.1.
Is there anything to configure to handle non ascii characters ?

Regards,

-- 
BL
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in pylab?

2008-01-21 Thread Darren Dale
On Thursday 17 January 2008 09:05:53 am Michael Droettboom wrote:
> Darren Dale wrote:
> > On Wednesday 16 January 2008 08:22:45 am Michael Droettboom wrote:
> >> But reading Darren's new bug report makes me wonder if my fix was
> >> correct.  To be honest, I'm a little confused by the bug report, not out
> >> of any lack of clarity on Darren's part, but I think due to insufficient
> >> understanding of the problem.  As assumption about the purpose of cla is
> >>   that is should return the plot to a pristine state -- and in this case
> >> that means linear axes.  But are you suggesting that sometimes that is
> >> not the case?
> >
> > If you have hold=True, and the x or y scale is log, repeated calls to
> > plot() will add new lines to the plot without changing the scaling. If
> > hold is instead False, one might reasonably expect that future calls to
> > plot would replace the old line with the new one, again without changing
> > the scaling. That would be consistent. Instead, the scaling changes.
>
> That indeed is a problem.  I suspect it has something to do with the
> extra step that log scales do to "round" to the nearest decade.  I can
> have a look when I get a chance, or let me know if you'd like to tackle
> it, Darren.

I don't know when I would have a chance to look into this (my wife and I are 
trying to buy a house). 

Darren

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using non ascii characters

2008-01-21 Thread Michael Droettboom
This probably depends on the backend you are using.  Which backend and 
on which platform are you having trouble with?  0.90.1 had a number of 
Unicode and non-ascii problems that 0.91.2 resolves.  You may want to 
try that.

Failing that, can you attach a small script that exhibits the problem? 
There may be all kinds of things going wrong, from the encoding of the 
source file, to an incorrect font etc. and an example would help us 
narrow it down.

Cheers,
Mike

BL wrote:
>Hi,
>  
> I would like to use non ascii characters in title and label but with my 
> current intallation it does not work properly.
> There's no warning or error messages when I set a title with some non 
> ascii characters (I use iso-88599-1 characters, like é or à), but I get 
> a empty square instead of theses characters in the figure.
>  
> I'm using matplotlib-0.90.1.
> Is there anything to configure to handle non ascii characters ?
>  
> Regards,
>  
> -- 
> BL
>  
>  
>  
> 
> 
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using non ascii characters

2008-01-21 Thread BL
I'm using a basic Debian Etch distribution.
I've attached a very simple file showing the problem. On my computer,
neither the title, nor the legend are displayed correctly, and I've got
square instead of each non ascii characters.

The attached script gives me the following informations :

matplotlib :  0.90.1
backend:  TkAgg
encoding   :  UTF-8

I will try to install a SVN version of matplotlib and see if this works
better.
#! /usr/bin/python
# -*-coding: utf-8-*-

from numpy import arange
import pylab as p
import matplotlib
import sys

print "matplotlib : ", matplotlib.__version__
print "backend: ", matplotlib.get_backend()
print "encoding   : ", sys.getfilesystemencoding()

x = arange(10)
y = x**2-x+4

p.plot(x, y, 'ro-', label=r'polynôme')
p.title(r'à é ï ù')
p.xlabel('x')
p.legend()
p.show()
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Automatic location for annotation or text objects ?

2008-01-21 Thread BL
  Hi,

Is there a way to create annotation or text object at an automatic "best
location", to prevent  different annotation from overlapping each other ?
I've seen the " loc='best' " keyword for the legend  class and I was
wondering is something similar existed for annotation and text.
Otherwise, is-there a way to move the annotation interactively ?


-- 
BL
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using non ascii characters

2008-01-21 Thread Michael Droettboom
To use non-ascii characters, you need prefix the string literal with a 
'u'.  For example:

u"This is a Unicode string"

Alternatively, you can write out an 8-bit string and then explicitly 
decode it into Unicode:

unicode("This is UTF-8", "utf-8")

Replacing the r's with u's in the strings in your example solves the 
problem for me on 0.91.2.  (I wasn't able to test 0.90.1 -- that still 
may have internal problems handling Unicode strings in some backends.)

Cheers,
Mike

BL wrote:
> I'm using a basic Debian Etch distribution.
> I've attached a very simple file showing the problem. On my computer, 
> neither the title, nor the legend are displayed correctly, and I've got 
> square instead of each non ascii characters.
> 
> The attached script gives me the following informations :
> 
> matplotlib :  0.90.1
> backend:  TkAgg
> encoding   :  UTF-8
> 
> I will try to install a SVN version of matplotlib and see if this works 
> better.
> 
> 
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] pcolorfast

2008-01-21 Thread Eric Firing
Rob,

You might try substituting "ax.pcolorfast(data)" for 
"ax.pcolormesh(data)".  It is much faster and uses less memory, unless 
you specify a non-rectilinear grid, in which case it falls back on the 
quadmesh code behind pcolormesh.

pcolorfast is a unification of slightly modified code from image, 
NonUniformImage, and quadmesh.  It is tagged as "experimental" because 
it may need some API tweaks, and maybe a different name.  It is not yet 
exposed via pyplot or pylab interfaces.

The API is similar but not identical to that for pcolormesh; read the 
docstring (and code if necessary) for details.

Eric

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] missing slice of pie()

2008-01-21 Thread James Battat
It looks like pie() omits slices that are smaller than a few percent.

In the following example, only one pie slice is drawn:

>>> import pylab
>>> pylab.pie([98,2])
>>> pylab.show()

The missing pie slice has neither a color fill nor a boundary (the
arc of the pie slice is missing).

By contrast, the following works as expected:
>>> pylab.pie([97,3])

It seems that the problem occurs for small slices, apparently the
threshold is around 2-3%.

Any ideas?

Thanks in advance,
James


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] missing slice of pie()

2008-01-21 Thread Michael Droettboom
The pie wedges are approximated using a 72-sided polygon (each side 5 
degrees), rather than a true ellipse.  There is a bug that if the wedge 
is smaller than a half of a side of this polygon (2.5 degrees) it 
creates only one side of the wedge.

This has been fixed on the 0.91.x maintenance branch in SVN r4882.

The SVN trunk uses a completely different approach using bezier curves, 
so doesn't exhibit this problem.

Cheers,
Mike

James Battat wrote:
> It looks like pie() omits slices that are smaller than a few percent.
> 
> In the following example, only one pie slice is drawn:
> 
 import pylab
 pylab.pie([98,2])
 pylab.show()
> 
> The missing pie slice has neither a color fill nor a boundary (the
> arc of the pie slice is missing).
> 
> By contrast, the following works as expected:
 pylab.pie([97,3])
> 
> It seems that the problem occurs for small slices, apparently the
> threshold is around 2-3%.
> 
> Any ideas?
> 
> Thanks in advance,
> James
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Set figure of graph1 to another figure from existing graph2

2008-01-21 Thread Christian Clementson
Hi everyone, I've been trying to solve this problem for the last few
days without success. I am afraid that part of the problem is my own
lack of understanding of matplotlib/wx's inner workings, this is my
first attempt to a GUI-tool.

I am using th networkx (https://networkx.lanl.gov/wiki) package to
generate a graph, this graph is according to the API "a pylab friendly
function that will use the current pylab figure axes (e.g. subplot)."

I want to embed this graph in the wx main application window. I've
been trying to do this using the wxmpl-package
(http://agni.phys.iit.edu/~kmcivor/wxmpl/) which creates a wx.Panel
containing a matplotlib.Figure. What I cant manage to do is to get the
networkx-graph (figure? subplot?) into the panel created by wxmpl.

What _does_ work is getting an embedded matplot-graph into the wxPanel
however I cant get the figure created by networkx to be drawn there
instead of an empty one. I think using the set_figure() function would
be a obvious way to do it, but I can't get it to work.

I realise that the problem might not be related to matplotlib at all
but I was hoping someone could give me help/pointers to a solution.

I attatched an .py example that shows what I am trying to do (you will
need wx, matplotlib, wxmpl and networkx).
Thanks!
#example.py

import wx
import pylab as P
import networkx as NX
import wxmpl as wxmpl


class MainWindow(wx.Frame):

def __init__(self,parent,id,title):
wx.Frame.__init__(self,parent,wx.ID_ANY, title, wx.DefaultPosition, wx.Size(800,600))

#Layout
vbox = wx.BoxSizer(wx.VERTICAL)
gpanel = wxmpl.PlotPanel(self, -1)
vbox.Add(gpanel, 1, wx.EXPAND | wx.ALL, 10)

hbox = wx.BoxSizer(wx.HORIZONTAL)
hbox.Add(wx.Button(self, 10, 'Quit'), 0, wx.LEFT, 10)
self.Bind(wx.EVT_BUTTON, self.OnQuit, id=10)
vbox.Add(hbox, 0, wx.BOTTOM | wx.EXPAND, 10)

fig = MakeGraph()
Gtmp = gpanel.get_figure()
Gtmp.set_figure(fig.GFig)
#P.show()
self.SetSizer(vbox)

def OnQuit(self, event):
self.Close()


class TestApp(wx.App):
def OnInit(self):
frame = MainWindow(None, -1, 'App')
frame.Show(True)
frame.Centre()
return True

class MakeGraph:
def __init__(self):
self.Graph = NX.Graph()
self.Graph.add_edge(1,2)
self.Graph.add_edge(1,3)
self.Graph.add_edge(2,3)
self.DrawGraph()

def DrawGraph(self):
pos = NX.spectral_layout(self.Graph)
NX.draw_networkx_nodes(self.Graph, pos, node_size=400)
NX.draw_networkx_edges(self.Graph, pos, width=2)
NX.draw_networkx_labels(self.Graph, pos, font_size=10, font_family='sans-serif')

P.xticks([]) #no x-axis
P.yticks([]) #no y-axis
self.GFig = P.gcf()

app = TestApp(0)
app.MainLoop()

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using non ascii characters

2008-01-21 Thread BL
> To use non-ascii characters, you need prefix the string literal with a
> 'u'.  For example:

I thought that the u"string" notation was only needed when characters had to
be handled with their utf-8 code


Replacing the r's with u's in the strings in your example solves the
> problem for me on 0.91.2.  (I wasn't able to test 0.90.1 -- that still
> may have internal problems handling Unicode strings in some backends.)


This works fine for me with the SVN version (matplotlib :  0.98pre) but not
with matplotlib 0.90.1

Thanks
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Broken Axes

2008-01-21 Thread Darckense
Hello,

I would like to know if there is a way to plot "broken" axis using
matplotlib. I would like to plot only the left and the right part of a
spectrum, and put a mark on the X axis to show that the axis scaling is
interrupted here.

Thank you,
-- 
Darckense
http://darckense.online.fr

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users