[Matplotlib-users] mixed color dashes

2013-07-22 Thread Mark Bakker
Hello List,

I want to make dashes that alternate in color, red, white, blue. Or black,
yellow, red, etc.

I thought I could overlay different dashes (first draw the black, then the
yellow then the red dashes), but the 'dashes' command always starts with a
colored dash. What I need is the opposite, start with a blank, then a dash.
Or have an offset of xx points and then start the dashed line. Does
matplotlib have such a feature?

Thanks,

Mark
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] datestr2num of year and month

2013-09-19 Thread Mark Bakker
Hello List,

When I use datestr2num('2010-05') it nicely converts that to a number
representing the date.
When I convert that number back with num2date, it turns out it sets the day
to the 19th of the month. The dime is 0:00:00.
Any reason it is set to the 19th instead of the first?
Maybe because today it the 19th, or is that just a coincidence?

Thanks,

Mark
--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] datestr2num of year and month fails for February on September 30

2013-09-30 Thread Mark Bakker
The design of the function datestr2num, unfortunately, has an undesired
side-effect.
Today (September 30) I cannot convert monthly data, as February doesn't
have 30 days.
Conversion of:
datestr2num('2000-02')
Gives an error:
ValueError: day is out of range for month

Should I file a bug report or a feature request?

Thanks,

Mark


>
> On Thu, Sep 19, 2013 at 11:38 PM, Goyo  wrote:
>
>> 2013/9/19 Mark Bakker :
>> > Hello List,
>> >
>> > When I use datestr2num('2010-05') it nicely converts that to a number
>> > representing the date.
>> > When I convert that number back with num2date, it turns out it sets the
>> day
>> > to the 19th of the month. The dime is 0:00:00.
>> > Any reason it is set to the 19th instead of the first?
>> > Maybe because today it the 19th, or is that just a coincidence?
>>
>> datestr2num calls dateutil.parser.parse, which by default uses the
>> current date at 00:00:00 for missing fields. The dateutil function
>> also can use a "default" argument to change this bahavoir but it is
>> not available in datestr2num.
>>
>>
>> http://labix.org/python-dateutil#head-a23e8ae0a661d77b89dfb3476f85b26f0b30349c
>>
>> Goyo
>>
>
>
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] why does floor(x) return a float while docs state it returns integer?

2014-03-31 Thread Mark Bakker
I expected that floor(x) would return an integer especially since the docs
state:

Return the floor of the input, element-wise.


The floor of the scalar `x` is the largest integer `i`, such that

`i <= x`. It is often denoted as :math:`\lfloor x \rfloor`.


Any reason why it returns a float? Bug/feature?


Thanks, Mark
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] why does floor(x) return a float while docs state it returns integer?

2014-04-01 Thread Mark Bakker
I should have posted this question on the numpy list of course, even though
floor is imported with pylab.

Off-list, Felix pointed me to the following discussion where some of the
reasons are explained why a float is returned rather than an integer:

http://stackoverflow.com/questions/8582741/why-do-pythons-math-ceil-and-math-floor-operations-return-floats-instead-of



On Mon, Mar 31, 2014 at 5:05 PM, Mark Bakker  wrote:

> I expected that floor(x) would return an integer especially since the docs
> state:
>
> Return the floor of the input, element-wise.
>
>
> The floor of the scalar `x` is the largest integer `i`, such that
>
> `i <= x`. It is often denoted as :math:`\lfloor x \rfloor`.
>
>
> Any reason why it returns a float? Bug/feature?
>
>
> Thanks, Mark
>
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
Hello list,

I am trying to animate a patch. The animation should show a circle orbiting
around a point. I took the code from
http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html

Problem is that when I run the code, the animation doesn't remove the
initial position of the circle (blit is True) while it works correctly on
the website referenced above.

Does anybody else see this behavior? Here's the code:

import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation

fig = plt.figure()
fig.set_dpi(100)
fig.set_size_inches(7, 6.5)

ax = plt.axes(xlim=(0, 10), ylim=(0, 10))
patch = plt.Circle((5, -5), 0.75, fc='y')

def init():
patch.center = (5, 5)
ax.add_patch(patch)
return patch,

def animate(i):
x, y = patch.center
x = 5 + 3 * np.sin(np.radians(i))
y = 5 + 3 * np.cos(np.radians(i))
patch.center = (x, y)
return patch,

anim = animation.FuncAnimation(fig, animate,
   init_func=init,
   frames=360,
   interval=20,
   blit=True)

plt.show()

Thanks, Mark
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
I thought about that. I even thought about changing the initial color to
white or radius to zero.

But I am thinking this is a bug. When blitting, whatever is created with
the init function is not removed. That is why lines that are animated
initially have no data. For a Patch object this is a bit harder, as it
needs something to begin with.

 It seems that this used to work in a previous version.

Should I file a bug report?

Mark


On Wed, Apr 23, 2014 at 3:34 PM, Raymond Smith  wrote:

> Hi Mark,
>
> I can't say this is the 'proper' solution or the correct interpretation,
> but it should work.
>
> I think when blitting that the init function serves as a something of a
> "background" for the rest of the animation. So try changing
>
>
> def init():
> *patch.center = (5, 5)*
> ax.add_patch(patch)
> return patch,
>
> to
>
> def init():
> *patch.center = (5, -5)*
> ax.add_patch(patch)
>     return patch,
>
> Cheers,
> Ray
>
>
> On Wed, Apr 23, 2014 at 5:44 AM, Mark Bakker  wrote:
>
>> Hello list,
>>
>> I am trying to animate a patch. The animation should show a circle
>> orbiting around a point. I took the code from
>> http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html
>>
>> Problem is that when I run the code, the animation doesn't remove the
>> initial position of the circle (blit is True) while it works correctly on
>> the website referenced above.
>>
>> Does anybody else see this behavior? Here's the code:
>>
>> import numpy as np
>> from matplotlib import pyplot as plt
>> from matplotlib import animation
>>
>> fig = plt.figure()
>> fig.set_dpi(100)
>> fig.set_size_inches(7, 6.5)
>>
>> ax = plt.axes(xlim=(0, 10), ylim=(0, 10))
>> patch = plt.Circle((5, -5), 0.75, fc='y')
>>
>> def init():
>> patch.center = (5, 5)
>> ax.add_patch(patch)
>> return patch,
>>
>> def animate(i):
>> x, y = patch.center
>> x = 5 + 3 * np.sin(np.radians(i))
>> y = 5 + 3 * np.cos(np.radians(i))
>> patch.center = (x, y)
>> return patch,
>>
>> anim = animation.FuncAnimation(fig, animate,
>>init_func=init,
>>frames=360,
>>interval=20,
>>blit=True)
>>
>> plt.show()
>>
>> Thanks, Mark
>>
>>
>> --
>> Start Your Social Network Today - Download eXo Platform
>> Build your Enterprise Intranet with eXo Platform Software
>> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
>> Get Started Now And Turn Your Intranet Into A Collaboration Platform
>> http://p.sf.net/sfu/ExoPlatform
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
Benjamin,

I don't mind doing classes to store the state, but isn't a Patch already a
class?
Do you know of an example online that I can work off?

Thanks for your suggestions,

Mark


On Wed, Apr 23, 2014 at 5:12 PM, Benjamin Root  wrote:

> I think it is because the figure may or may not have some things drawn by
> the time the blitting starts. This is due to draw_idle(). So, it is trying
> to capture whatever is in the figure's canvas, but drawing may or may not
> have happened yet.
>
> Try this:
>
> def animate(i):
> if not animate.patch:
> animate.patch = plt.Circle((5, -5), 0.75, fc='y')
> animate.ax.add_patch(animate.patch)
> x, y = animate.patch.center
>
> x = 5 + 3 * np.sin(np.radians(i))
> y = 5 + 3 * np.cos(np.radians(i))
> animate.patch.center = (x, y)
> return animate.patch,
> animate.ax = ax
> animate.patch = None
>
> If you have something more complicated, then just go full bore and use
> classes to store the state.
>
> Cheers!
> Ben Root
>
>
>
> On Wed, Apr 23, 2014 at 10:51 AM, Raymond Smith  wrote:
>
>> This is pretty weird. If instead of Mark's original script, if I move the
>> add_patch out of init and have the init simply return an empty tuple, it
>> _mostly_ works as expected. But -- at least on my computer -- on some runs,
>> it has the moving circle, but also leaves a circle at the "top", starting
>> point, whereas on other runs it simply has the desired moving circle with
>> no 'background' circle. Usually, it will happen at least once if I start
>> the animation script 10 times. So still, the init function is a bit of a
>> mystery to me.
>>
>>
>> import numpy as np
>> from matplotlib import pyplot as plt
>> from matplotlib import animation
>>
>> fig = plt.figure()
>> fig.set_dpi(100)
>> fig.set_size_inches(7, 6.5)
>>
>> ax = plt.axes(xlim=(0, 10), ylim=(0, 10))
>> patch = plt.Circle((5, -5), 0.75, fc='y')
>> ax.add_patch(patch)
>>
>> def init():
>> return tuple()
>>
>>
>> def animate(i):
>> x, y = patch.center
>> patch.set_facecolor('y')
>> patch.set_edgecolor('k')
>>
>> x = 5 + 3 * np.sin(np.radians(i))
>> y = 5 + 3 * np.cos(np.radians(i))
>> patch.center = (x, y)
>> return patch,
>>
>> anim = animation.FuncAnimation(fig, animate,
>>init_func=init,
>>frames=360,
>>interval=20,
>>blit=True)
>>
>> plt.show()
>>
>>
>>
>>
>> On Wed, Apr 23, 2014 at 10:29 AM, Benjamin Root  wrote:
>>
>>> Working off of very faded memory, try not to return any objects in your
>>> init function that you intend to be animated. If I remember correctly, when
>>> blitting is True, the animator treats any object returned by the init()
>>> function as background objects, and any objects returned by the animation
>>> function as blittable. Since your patch is returned in both functions, I
>>> think it is getting confused.
>>>
>>> Again, very rusty memory here...
>>>
>>> Ben Root
>>>
>>>
>>>
>>> On Wed, Apr 23, 2014 at 9:34 AM, Raymond Smith  wrote:
>>>
>>>> Hi Mark,
>>>>
>>>> I can't say this is the 'proper' solution or the correct
>>>> interpretation, but it should work.
>>>>
>>>> I think when blitting that the init function serves as a something of a
>>>> "background" for the rest of the animation. So try changing
>>>>
>>>>
>>>> def init():
>>>> *patch.center = (5, 5)*
>>>> ax.add_patch(patch)
>>>> return patch,
>>>>
>>>> to
>>>>
>>>> def init():
>>>> *patch.center = (5, -5)*
>>>> ax.add_patch(patch)
>>>> return patch,
>>>>
>>>> Cheers,
>>>> Ray
>>>>
>>>>
>>>> On Wed, Apr 23, 2014 at 5:44 AM, Mark Bakker  wrote:
>>>>
>>>>> Hello list,
>>>>>
>>>>> I am trying to animate a patch. The animation should show a circle
>>>>> orbiting around a point. I took the code from
>>>>> http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html
>>>&

Re: [Matplotlib-users] problem with patches in animation

2014-04-23 Thread Mark Bakker
Raymond,

The documentation says:

If blit=True, *func* and *init_func* should return an iterable of drawables
to clear.

But clearly, whatever is set by init_func is not cleared during animation
when blit=True, while it is cleared when blit=False.

Unless anybody knows what I am doing wrong I will file a bug report.

Thanks again, Mark


On Wed, Apr 23, 2014 at 4:25 PM, Raymond Smith  wrote:

> Well, the intended behavior of init() isn't completely clear to me after
> reading over some of the docs <http://matplotlib.org/contents.html> and
> examples <http://matplotlib.org/examples/animation/index.html>, so I'm
> not sure if it's a bug or not. Either way, it could be a request for
> documentation, perhaps.
>
>
> On Wed, Apr 23, 2014 at 10:08 AM, Mark Bakker  wrote:
>
>> I thought about that. I even thought about changing the initial color to
>> white or radius to zero.
>>
>> But I am thinking this is a bug. When blitting, whatever is created with
>> the init function is not removed. That is why lines that are animated
>> initially have no data. For a Patch object this is a bit harder, as it
>> needs something to begin with.
>>
>>  It seems that this used to work in a previous version.
>>
>> Should I file a bug report?
>>
>> Mark
>>
>>
>> On Wed, Apr 23, 2014 at 3:34 PM, Raymond Smith  wrote:
>>
>>> Hi Mark,
>>>
>>> I can't say this is the 'proper' solution or the correct interpretation,
>>> but it should work.
>>>
>>> I think when blitting that the init function serves as a something of a
>>> "background" for the rest of the animation. So try changing
>>>
>>>
>>> def init():
>>> *patch.center = (5, 5)*
>>> ax.add_patch(patch)
>>> return patch,
>>>
>>> to
>>>
>>> def init():
>>> *patch.center = (5, -5)*
>>> ax.add_patch(patch)
>>> return patch,
>>>
>>> Cheers,
>>> Ray
>>>
>>>
>>> On Wed, Apr 23, 2014 at 5:44 AM, Mark Bakker  wrote:
>>>
>>>> Hello list,
>>>>
>>>> I am trying to animate a patch. The animation should show a circle
>>>> orbiting around a point. I took the code from
>>>> http://nickcharlton.net/posts/drawing-animating-shapes-matplotlib.html
>>>>
>>>> Problem is that when I run the code, the animation doesn't remove the
>>>> initial position of the circle (blit is True) while it works correctly on
>>>> the website referenced above.
>>>>
>>>> Does anybody else see this behavior? Here's the code:
>>>>
>>>> import numpy as np
>>>> from matplotlib import pyplot as plt
>>>> from matplotlib import animation
>>>>
>>>> fig = plt.figure()
>>>> fig.set_dpi(100)
>>>> fig.set_size_inches(7, 6.5)
>>>>
>>>> ax = plt.axes(xlim=(0, 10), ylim=(0, 10))
>>>> patch = plt.Circle((5, -5), 0.75, fc='y')
>>>>
>>>> def init():
>>>> patch.center = (5, 5)
>>>> ax.add_patch(patch)
>>>> return patch,
>>>>
>>>> def animate(i):
>>>> x, y = patch.center
>>>> x = 5 + 3 * np.sin(np.radians(i))
>>>> y = 5 + 3 * np.cos(np.radians(i))
>>>> patch.center = (x, y)
>>>> return patch,
>>>>
>>>> anim = animation.FuncAnimation(fig, animate,
>>>>init_func=init,
>>>>frames=360,
>>>>interval=20,
>>>>blit=True)
>>>>
>>>> plt.show()
>>>>
>>>> Thanks, Mark
>>>>
>>>>
>>>> --
>>>> Start Your Social Network Today - Download eXo Platform
>>>> Build your Enterprise Intranet with eXo Platform Software
>>>> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
>>>> Get Started Now And Turn Your Intranet Into A Collaboration Platform
>>>> http://p.sf.net/sfu/ExoPlatform
>>>> ___
>>>> Matplotlib-users mailing list
>>>> Matplotlib-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>>
>>>
>>
>
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] datestr2num for day/month/year

2014-04-25 Thread Mark Bakker
Hello List,

datestr2num works great when dates are stored as month/day/year (as
American like).

Europeans store them as day/month/year.

Any quick function to convert a day/month/year string do a date? Is there
an eu version: datestr2numeu?

Thanks,

Mark
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] datestr2num for day/month/year

2014-04-25 Thread Mark Bakker
OK, I figured out I can use:
converters={0:strpdate2num('%d-%m-%y')}

What now if part of my dates are given as 'day-month-year' and part as
'day/month/year' in the same file (I know, who does that, an I could do a
replace first and then read it in). Can I specify both formats for the
converter? I guess not

Thanks,

Mark



On Fri, Apr 25, 2014 at 10:46 AM, Mark Bakker  wrote:

> Hello List,
>
> datestr2num works great when dates are stored as month/day/year (as
> American like).
>
> Europeans store them as day/month/year.
>
> Any quick function to convert a day/month/year string do a date? Is there
> an eu version: datestr2numeu?
>
> Thanks,
>
> Mark
>
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] datestr2num for day/month/year

2014-04-25 Thread Mark Bakker
Thanks, Andreas, but it doesn't quite work.

This works for me (I manually changed all dates to 'day-month-year' for
testing):

a = loadtxt('test.csv',converters={2:strpdate2num('%d-%m-%Y')})

But when I define the same function in a separate function, as you
suggested:

def conv_date(s):
 return strpdate2num('%d-%m-%Y')

and do

a = loadtxt('test.csv',converters={2:conv_date})

I get the non-descript error:

loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols,
unpack, ndmin)
847 fh.close()
848
--> 849 X = np.array(X, dtype)
850 # Multicolumn data are returned with shape (1, N, M), i.e.
851 # (1, 1, M) for a single row - remove the singleton dimension
there

SystemError: error return without exception set

Any suggestions?

Thanks, Mark




On Fri, Apr 25, 2014 at 11:17 AM, Andreas Hilboll  wrote:

> On 25.04.2014 11:02, Mark Bakker wrote:
> > OK, I figured out I can use:
> > converters={0:strpdate2num('%d-%m-%y')}
> >
> > What now if part of my dates are given as 'day-month-year' and part as
> > 'day/month/year' in the same file (I know, who does that, an I could do
> > a replace first and then read it in). Can I specify both formats for the
> > converter? I guess not
>
> Try this:
>
>def _conv_date(s):
>try:
>return strpdate2num('%d-%m-%y')
>except Exception:   # figure out which exception class to use
>return strpdate2num('%d/%m/%y')
>
>converters={0:_conv_date}
>
> Cheers, Andreas.
>
>
> >
> > Thanks,
> >
> > Mark
> >
> >
> >
> > On Fri, Apr 25, 2014 at 10:46 AM, Mark Bakker  > <mailto:mark...@gmail.com>> wrote:
> >
> > Hello List,
> >
> > datestr2num works great when dates are stored as month/day/year (as
> > American like).
> >
> > Europeans store them as day/month/year.
> >
> > Any quick function to convert a day/month/year string do a date? Is
> > there an eu version: datestr2numeu?
> >
> > Thanks,
> >
> > Mark
> >
> >
> >
> >
> >
> --
> > Start Your Social Network Today - Download eXo Platform
> > Build your Enterprise Intranet with eXo Platform Software
> > Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> > Get Started Now And Turn Your Intranet Into A Collaboration Platform
> > http://p.sf.net/sfu/ExoPlatform
> >
> >
> >
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
> --
> -- Andreas.
>
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Do animations work in Notebook on Mac?

2015-02-02 Thread Mark Bakker
Hello List,

I could swear that animations used to work inside a Notebook using the
nbagg backend on my Mac.

But they seem not to do anything anymore. Just updated to mpl 1.4.2 and am
running IPython 2.3.1.

Can anybody get the basic example to work:
http://matplotlib.org/1.4.2/examples/animation/basic_example.html

Thanks,

Mark
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Do animations work in Notebook on Mac?

2015-02-02 Thread Mark Bakker
Thanks, Thomas.
They sure have a working example.
Now I gotta figure out what they do different than I did in the one that
didn't work.
I'll report back (although things may be fixed with the upcoming 1.4.3
release),
Mark

On Mon, Feb 2, 2015 at 5:26 PM, Thomas Caswell  wrote:

> The nbagg UAT has an animation example:
> https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb
> that should work on 1.4.2.
>
> Tom
>
> On Mon Feb 02 2015 at 11:17:15 AM Benjamin Root  wrote:
>
>> There have been many fixes to the nbagg backend that I think are lined up
>> for the upcoming 1.4.3 release (the release candidate was tagged
>> yesterday). Perhaps it has been fixed there? What version did you upgrade
>> from?
>>
>> Cheers!
>> Ben Root
>>
>>
>> On Mon, Feb 2, 2015 at 10:42 AM, Mark Bakker  wrote:
>>
>>> Hello List,
>>>
>>> I could swear that animations used to work inside a Notebook using the
>>> nbagg backend on my Mac.
>>>
>>> But they seem not to do anything anymore. Just updated to mpl 1.4.2 and
>>> am running IPython 2.3.1.
>>>
>>> Can anybody get the basic example to work: http://matplotlib.org/1.
>>> 4.2/examples/animation/basic_example.html
>>>
>>> Thanks,
>>>
>>> Mark
>>>
>>> 
>>> --
>>> Dive into the World of Parallel Programming. The Go Parallel Website,
>>> sponsored by Intel and developed in partnership with Slashdot Media, is
>>> your
>>> hub for all things parallel software development, from weekly thought
>>> leadership blogs to news, videos, case studies, tutorials and more. Take
>>> a
>>> look and join the conversation now. http://goparallel.sourceforge.net/
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>> 
>> --
>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net/
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-07 Thread Mark Bakker
Hello list,

I want to axes above each other. They share the x-axis. The top figure has
'aspect=1' (it is a map), the bottom figure shows a cross-section along a
horizontal line on the map, so it doesn't have 'aspect=1'. When I do this
with code, for example like this:

fig, axes = plt.subplots(nrows=2,sharex=True)
plt.setp(axes[0], aspect=1.0, adjustable='box-forced')

then the physical size of the top axes is much sorter than the physical
size of the bottom axes (although they are poperly linked, as they have the
same data limit, and when zooming in the top figure, the bottom figure
adjusts). It just looks weird, as the size of the horizontal axis of the
bottom figure should have the same physical size as the horizontal axis of
the top figure. This used to be possible (a few years ago; haven't tried it
for a while). Is there a way to do it with the current matpotlib? (1.4.3)

Thanks,

Mark
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Mark Bakker
Thanks, Thomas.

That works indeed, but it doesn't make the figure adjustable, which is what
I wanted (that the physical size of the axes changes while the aspect ratio
is fixed to 1). I guess that functionality has been taken out.

Mark

On Wed, Apr 8, 2015 at 12:50 PM, Thomas Caswell  wrote:

> What are the data limits you are using?
>
> I suspect they you are over constraining the system/order of operations
> issue. Try dropping the adjustable setting and pre setting both the data
> limits and the approximate size in figure fraction (ex via grid spec) of
> the axes.
>
> Tom
>
> On Tue, Apr 7, 2015, 15:54 Mark Bakker  wrote:
>
>> Hello list,
>>
>> I want to axes above each other. They share the x-axis. The top figure
>> has 'aspect=1' (it is a map), the bottom figure shows a cross-section along
>> a horizontal line on the map, so it doesn't have 'aspect=1'. When I do this
>> with code, for example like this:
>>
>> fig, axes = plt.subplots(nrows=2,sharex=True)
>> plt.setp(axes[0], aspect=1.0, adjustable='box-forced')
>>
>> then the physical size of the top axes is much sorter than the physical
>> size of the bottom axes (although they are poperly linked, as they have the
>> same data limit, and when zooming in the top figure, the bottom figure
>> adjusts). It just looks weird, as the size of the horizontal axis of the
>> bottom figure should have the same physical size as the horizontal axis of
>> the top figure. This used to be possible (a few years ago; haven't tried it
>> for a while). Is there a way to do it with the current matpotlib? (1.4.3)
>>
>> Thanks,
>>
>> Mark
>> 
>> --
>> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
>> Develop your own process in accordance with the BPMN 2 standard
>> Learn Process modeling best practices with Bonita BPM through live
>> exercises
>> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
>> event?utm_
>> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_
>> campaign=VA_SF___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Mark Bakker
import matplotlib.pyplot as plt
%matplotlib qt
fig, axes = plt.subplots(nrows=2,sharex=True)
plt.setp(axes[0], aspect=1.0, adjustable='box-forced')
plt.show()

This used to create two axes of the same horizontal size. What it does now
is that it scales the upper axis so that the aspect=1.0 by changing the
physical size of the axis. But the physical size of the lower axis is not
changed, while this used to be the case in the past (but that may have been
a few years back). That sure used to be the desired behavior.

Thanks for your help,

Mark



On Wed, Apr 8, 2015 at 2:16 PM, Thomas Caswell  wrote:

> Can you please provide a minimal, but complete and runnable example of
> what you are doing?
>
> On Wed, Apr 8, 2015, 08:13 Mark Bakker  wrote:
>
>> Thanks, Thomas.
>>
>> That works indeed, but it doesn't make the figure adjustable, which is
>> what I wanted (that the physical size of the axes changes while the aspect
>> ratio is fixed to 1). I guess that functionality has been taken out.
>>
>> Mark
>>
>> On Wed, Apr 8, 2015 at 12:50 PM, Thomas Caswell 
>> wrote:
>>
>>> What are the data limits you are using?
>>>
>>> I suspect they you are over constraining the system/order of operations
>>> issue. Try dropping the adjustable setting and pre setting both the data
>>> limits and the approximate size in figure fraction (ex via grid spec) of
>>> the axes.
>>>
>>> Tom
>>>
>>> On Tue, Apr 7, 2015, 15:54 Mark Bakker  wrote:
>>>
>>>> Hello list,
>>>>
>>>> I want to axes above each other. They share the x-axis. The top figure
>>>> has 'aspect=1' (it is a map), the bottom figure shows a cross-section along
>>>> a horizontal line on the map, so it doesn't have 'aspect=1'. When I do this
>>>> with code, for example like this:
>>>>
>>>> fig, axes = plt.subplots(nrows=2,sharex=True)
>>>> plt.setp(axes[0], aspect=1.0, adjustable='box-forced')
>>>>
>>>> then the physical size of the top axes is much sorter than the physical
>>>> size of the bottom axes (although they are poperly linked, as they have the
>>>> same data limit, and when zooming in the top figure, the bottom figure
>>>> adjusts). It just looks weird, as the size of the horizontal axis of the
>>>> bottom figure should have the same physical size as the horizontal axis of
>>>> the top figure. This used to be possible (a few years ago; haven't tried it
>>>> for a while). Is there a way to do it with the current matpotlib? (1.4.3)
>>>>
>>>> Thanks,
>>>>
>>>> Mark
>>>> 
>>>> --
>>>> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
>>>> Develop your own process in accordance with the BPMN 2 standard
>>>> Learn Process modeling best practices with Bonita BPM through live
>>>> exercises
>>>> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
>>>> event?utm_
>>>> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_
>>>> campaign=VA_SF___
>>>> Matplotlib-users mailing list
>>>> Matplotlib-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>>
>>
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] background color of text plots as foreground

2015-07-09 Thread Mark Bakker
Hello list,

I am trying to set the backgroundcolor of a textbox:

from pylab import *
plot([1, 2, 3])
text(1, 2, 'Hello', backgroundcolor = 'red')

This plots a nice red box but no text. It looks like the backgroundcolor is
set as the foreground. Am I doing something wrong or is this a bug? mpl
version 1.4.3

Thanks, Mark
--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] background color of text plots as foreground

2015-07-09 Thread Mark Bakker
Fails on MacOSX backend.

Just tried it, and it works fine with the QT backend.

So I guess a MacOSX bug...

Thanks for your help,

Mark

On Thu, Jul 9, 2015 at 6:18 PM, Sterling Smith 
wrote:

> Works for me with TkAgg backend on 1.4.3.
>
> -Sterling
>
> On Jul 9, 2015, at 3:52AM, Mark Bakker  wrote:
>
> > Hello list,
> >
> > I am trying to set the backgroundcolor of a textbox:
> >
> > from pylab import *
> > plot([1, 2, 3])
> > text(1, 2, 'Hello', backgroundcolor = 'red')
> >
> > This plots a nice red box but no text. It looks like the backgroundcolor
> is set as the foreground. Am I doing something wrong or is this a bug? mpl
> version 1.4.3
> >
> > Thanks, Mark
> >
> >
> --
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> >
> https://www.gigenetcloud.com/___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib with eclipse: how to get a graph?

2009-09-22 Thread Mark Bakker
Hello list,
I recently started using Eclipse with Pydev. I like it a lot but have not
been able to get interactive plotting going (which otherwise works fine).

My file is simple:

from pylab import *

ion()

plot([1,2,3])


When I run this form within Eclipse, I do see a graphing window open up but
then it disappears again when it is done, before I can even look at it.

Any suggestions on how to keep the graphing window open?

Thanks,

Mark
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib with eclipse: how to get a graph?

2009-09-23 Thread Mark Bakker
Hello list,
I recently started using Eclipse with Pydev. I like it a lot but have not
been able to get interactive plotting going (which otherwise works fine).

My file is simple:

from pylab import *

ion()

plot([1,2,3])


When I run this form within Eclipse, I do see a graphing window open up but
then it disappears again when it is done, before I can even look at it.

Any suggestions on how to keep the graphing window open?

Thanks,

Mark
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib with eclipse: how to get a graph?

2009-09-24 Thread Mark Bakker
Excellent. Many thanks.After all those years of using matplotlib, I finally
find a use for show()
Mark

On Wed, Sep 23, 2009 at 11:02 PM, Gökhan Sever wrote:

>
>
> On Wed, Sep 23, 2009 at 3:51 PM, Mark Bakker  wrote:
>
>> Hello list,
>> I recently started using Eclipse with Pydev. I like it a lot but have not
>> been able to get interactive plotting going (which otherwise works fine).
>>
>> My file is simple:
>>
>> from pylab import *
>>
>> ion()
>>
>> plot([1,2,3])
>>
>>
>>
> You need to issue a show() here. Thus the plotting window will hang on the
> screen until you close it.
>
>
> Eclipse Platform
> Version: 3.5.0
> Build id: I20090611-1540
>
> PyDev for Eclipse1.5.0.1251989166
> org.python.pydev.feature.feature.group
>
>
>>  When I run this form within Eclipse, I do see a graphing window open up
>> but then it disappears again when it is done, before I can even look at it.
>>
>> Any suggestions on how to keep the graphing window open?
>>
>> Thanks,
>>
>> Mark
>>
>>
>>
>> --
>> Come build with us! The BlackBerry® Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9-12, 2009. Register
>> now!
>> http://p.sf.net/sfu/devconf
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> --
> Gökhan
>
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] setting ticks on Axes3D

2010-01-04 Thread Mark Bakker
Hello list, I am trying to set ticks on an Axes3D plot.
What I really want is, actually, not to have any ticks.
For a 2D plot I set the ticks to an empty list.
But in a 3D plot, I cannot set any ticks whatsover.
At least not with a sequence.
Any thoughts?

from mpl_toolkits.mplot3d import Axes3D

fig = figure()

ax = Axes3D(fig)

ax.plot([0,1],[0,1],[0,1])

# Now I want to set ticks:

ax.set_xticks([])

# ax.set_xticks([.2,.3,.4]) # changes the scale of the figure, but not the
ticks

show()

And the plot has ticks at .2 .4 .6 .8 on the x-axis.

Thanks for any help,

Mark
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] bezier curve through set of 2D points

2010-01-14 Thread Mark Bakker
Hello List,

Does matplotlib have a routine that can fit a cubic Bezier curve through an
array of 2D points?

I saw some Bezier routines in Path, but couldn't find what I am looking for.

If matplotlib doesn't have it, does anybody have another suggestion in
Python?

Thanks,

Mark
--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3D output to pdf for animation?

2010-01-21 Thread Mark Bakker
Hello List,

I know I may be hoping for too much, but is there a way to get the 3D
figures into a file that may be converted to an animated pdf?

Pdf now allows for inclusion of a 3D figure, and as far as I can see it
needs to be in U3D or PRC format.

Has anybody been successful converting any of the matplotlib output file
types to U3D or PRC?

Eventually I would like to add the figure in a Latex document and use
movie15 to get a rotatable 3D images in my document.

Thanks,

Mark
--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Easy question: how to select specific subplot for second (or more) time

2008-06-10 Thread Mark Bakker
Hello list -

I want to plot something in two subplots, then add something to the first
subplot.
How do I select the first subplot after I have plotted on the second
subplot?

For example:
subplot(211)
plot([1,2,3])
subplot(212)
plot([4,3,2])

Now I want to add something to the first subplot.
So I thought I could do subplot(211) again, but that destroys the subplot.
Any suggestions?

Thanks, Mark
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Easy question: how to select specific subplot for second (or more) time

2008-06-10 Thread Mark Bakker
Thanks Tony -

I was hoping there was a plyab-ish command.
Like you can do Figure(1), Figure(2), and then reselect Figure(1) to get
access to the first figure. No such command for subplot, I understand.

Cheers, Mark

On Tue, Jun 10, 2008 at 3:27 PM, Tony S Yu <[EMAIL PROTECTED]> wrote:

> Wow, a question I can actually answer:
>
> ax1 = subplot(211)
> ax2 = subplot(212)
> ax1.plot([1,2,3])
> ax2.plot([4,3,2])
> ax1.plot([3,2,1])
>
> Best,
> -Tony
>
>
> On Jun 10, 2008, at 9:09 AM, Mark Bakker wrote:
>
>  Hello list -
>>
>> I want to plot something in two subplots, then add something to the first
>> subplot.
>> How do I select the first subplot after I have plotted on the second
>> subplot?
>>
>> For example:
>> subplot(211)
>> plot([1,2,3])
>> subplot(212)
>> plot([4,3,2])
>>
>> Now I want to add something to the first subplot.
>> So I thought I could do subplot(211) again, but that destroys the subplot.
>> Any suggestions?
>>
>> Thanks, Mark
>> -
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>>
>> http://sourceforge.net/services/buy/index.php___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Easy question: how to select specific subplot for second (or more) time

2008-06-10 Thread Mark Bakker
Yep, that works. I thought I had tried that, but I must have done something
wrong.
Sorry for the clutter,
Mark

On Tue, Jun 10, 2008 at 4:00 PM, John Hunter <[EMAIL PROTECTED]> wrote:

> On Tue, Jun 10, 2008 at 8:41 AM, Tony S Yu <[EMAIL PROTECTED]> wrote:
> > Hey Mark,
> > Actually, recalling subplot(211) seems to work for me. Strange.
>
> Yes, this is the expected behavior, you can reactivate any axes or
> subplot by simply making the same axes or subplot call (with the same
> arguments).  This is discussed in the pylab tutorial section "working
> with multiple figures and axes" at
> http://matplotlib.sourceforge.net/tutorial.html#figs_and_axes
>
> JDH
>
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] APNG support?

2008-07-01 Thread Mark Bakker
I think APNG suppot woudl be very cool.
Would it be hard to write a simple Python script that creates an APNG file
from a set of PNG files? That would be really killer.

Just as important, I was wondering what programs support APNG. It works fine
in my Firefox 3, but I also need it in some presentation software
(Powerpoint, OpenOffice Impress). Anybody know how that is going?

Mark



> Date: Tue, 1 Jul 2008 01:41:32 -0400
> From: Alan G Isaac <[EMAIL PROTECTED]>
>
> Someone said:
> > http://matplotlib.sourceforge.net/faq.html#MOVIE
>
> OK, this works.
> But might it be a possible goal for Matplotlib to be able
> to assemble these PNGs into an APNG?
> http://wiki.mozilla.org/APNG_Specification>
>
> Until then, this can be done with a FireFox 3 extension:
> https://addons.mozilla.org/en-US/firefox/addon/5519>
>
> Cheers,
> Alan Isaac
>
>
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plotting array with inf

2008-08-05 Thread Mark Bakker
I have a question about plotting an array with an inf.

For example:

y = np.array([2.,1.,0,1.,2.])
y = 1.0 / y

So y is array([ 0.5,  1. ,  Inf,  1. ,  0.5])

When I plot this, I get an error, of which the last line is:
OverflowError: math range error

I presume the problem is using the autoscale or something like that to set
the data limits.

But if I replace the Inf by a nan: y[2] = np.nan, then it plots fine.

I know, I know, I can do this with masked arrays, but it cannot be that hard
to make this work correctly, and wouldn't that be much nicer? Desirable?

Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] get a google map image into matplotlib?

2008-08-05 Thread Mark Bakker
Hello list -
There is a recent matlab script floating around that downloads an image from
google map and plots it in a matlab figure.

Can we do the same? I am sure we can (not sure we want, as Google has been
somewhat difficult to people writing scripts to manipulate images from
google maps).

My second question is: Has someone done it and does he/she want to share?

Thanks, Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting array with inf

2008-08-06 Thread Mark Bakker
Thanks for stepping up to the plate, Eric.

I was asleep on this side of the ocean, so I didn't join in the discussion.

>From a functionality point of view, it seems to be a good idea to me not to
plot nans (that would actually be impossible) and not to plot infs. The
latter are indeed different than nans, but they are the same in that we
cannot plot them. And it will shield the pylab user from having to use
masked arrrays when it is not really necessary.

Eric - you think this will also work for contour, or do we have to keep
using masked arrays there? If this works for contouring, what will you do
with -inf and +inf in contourf?

Thanks, Mark

On Wed, Aug 6, 2008 at 5:54 AM, Eric Firing <[EMAIL PROTECTED]> wrote:

> John Hunter wrote:
>
>> On Tue, Aug 5, 2008 at 7:03 PM, Eric Firing <[EMAIL PROTECTED]> wrote:
>>
>>  Matlab ignores it, same as with a nan.
>>>
>>
>> Although intuitively I think of inf as very different from nan, my
>> default is to go with matlab like behavior in the absence of
>> compelling a argument otherwise.  I won't be providing that argument
>> for isnan/inf, so if someone wants mpl to behave differently, step up
>> and argue why.
>>
>>  This needs a bit of thought and checking.  Mike went to some trouble, I
>>> believe, to make nans work without running everything through masked
>>> arrays--whether this is actually *faster* than doing an initial masking
>>> operation when needed and then using masked arrays everywhere internally
>>> when bad values are present, I don't know.  It is possible that
>>> everything
>>> could be made to work with infs simply by changing all "isnan(x)" to
>>> "~isfinite(x)", which has the advantage of being slightly faster
>>> (surprisingly) as well as more general.
>>>
>>
>> Perhaps we should centralize this functionality to a cbook analogue of
>> "is_string_like" or "iterable" called "is_plottable" or something to
>> that effect.  That way, people writing plotting functions will not
>> have to decide if the inclusion criteria is isnan or ~isinfinite, but
>> instead can simply rely on the cbook function (with a moderate
>> performance hit for the extra function call).  We will likely need a
>> version for a single axis (x or y) as well as for points ( (x,y)
>> tuples) -- these ideally will support scalar or array inputs, or we
>> can provide array versions of each.   There are only a few modules
>> using isnan currently (axes, contour, mlab and path) so it would not
>> be too difficult to centralize this functionality.   Do you want to
>> take the lead on this one, Eric?
>>
>
> Yes, but I think that the cbook approach is overkill in this case, and
> counterproductive.  Maybe I should add a bit to the coding guide, but we
> really don't need another wrapper just to handle nans and infs.
>
> I think I see how to fix everything, and improve speed, with only a few
> changes, including a couple in src.
>
> Eric
>
>
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to: manually select contour label location

2008-08-06 Thread Mark Bakker
Hello list -

I read that in 0.98.3 we can manually select contour label locations!

I searched around, but couldn't find any instructions.

Can anybody point me in the right direction?

Thanks, Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] can we set markerspacing?

2008-08-06 Thread Mark Bakker
Can we set the markerspacing in mpl?

If I do

plot( linspace(0,10,100), 'o' )

I get 100 markers. What if I want to plot every tenth marker? Or better
even, what if I want to have a certain spacing between markers.

I know how to work around this, of course (just plot every tenth point), but
I was looking for a keyword argument or so. I thought that would exist and
be useful.

Sorry to flood the list with questions this week.

Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to: manually select contour label location

2008-08-06 Thread Mark Bakker
Never mind, I found it.
The solution is:

cobj = contour(x,y,z)

cobj.clabel(manual=True)

How nice!

Mark

On Wed, Aug 6, 2008 at 10:05 AM, Mark Bakker <[EMAIL PROTECTED]> wrote:

> Hello list -
>
> I read that in 0.98.3 we can manually select contour label locations!
>
> I searched around, but couldn't find any instructions.
>
> Can anybody point me in the right direction?
>
> Thanks, Mark
>
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] bug in labeling contour lines

2008-08-06 Thread Mark Bakker
Hello list -

There seems to be a bug in labeling contour lines.
When I call clabel, it removes all contours that are not labeled (because
the label doesn't fit on the section of contour, I presume).
This seems like a bug to me (or a really odd feature).

Easy example:

>>> x,y = meshgrid( linspace(-10,10,50), linspace(-10,10,50) )
>>> z = log(x**2 + y**2)
>>> cobj = contour(x,y,z)
>>> cobj.clabel()

>>> draw()

And now all contours without a label are gone. On my machine it draws labels
on contours from 1 through 5, and erases the contours in the middle of the
plot with values -2, -1, and 0.

Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] bug in labeling contour lines

2008-08-06 Thread Mark Bakker
A little follow-up.
When I use keyword argument inline=False, it doesn't remove the lines
without a label.

So it seems that when using inline=True the unlabeled contours get a white
box, but no label (because it doesn't fit) which essentially removes the
entire contour.

Mark

On Wed, Aug 6, 2008 at 2:27 PM, Mark Bakker <[EMAIL PROTECTED]> wrote:

> Hello list -
>
> There seems to be a bug in labeling contour lines.
> When I call clabel, it removes all contours that are not labeled (because
> the label doesn't fit on the section of contour, I presume).
> This seems like a bug to me (or a really odd feature).
>
> Easy example:
>
> >>> x,y = meshgrid( linspace(-10,10,50), linspace(-10,10,50) )
> >>> z = log(x**2 + y**2)
> >>> cobj = contour(x,y,z)
> >>> cobj.clabel()
> 
> >>> draw()
>
> And now all contours without a label are gone. On my machine it draws
> labels on contours from 1 through 5, and erases the contours in the middle
> of the plot with values -2, -1, and 0.
>
> Mark
>
>
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] how to end manually positioning contour labels?

2008-08-06 Thread Mark Bakker
I just played with putting contour labels on manually (and interactively).

It works fine by just left clicking on the spot where you want a label.

But how do you end this feature? The doc string says: right click, or
potentially click both mouse buttons together.

Neither works for me on win32, mpl 0.98.3, TkAgg backend, interactive mode.

Does this work for anybody?

Mark

Quick test:
cobj = contour(x,y,z) # x,y,z some arrays
cobj.clabel(manual=True)
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problems with labeling contour lines - 2nd try

2008-08-11 Thread Mark Bakker
Hello - I have two problems labeling contour lines in 0.98.3.

First, when I call clabel, it removes all contours that are not labeled
(because the label doesn't fit on the section of contour, I presume).
This seems like a bug to me (or a really odd feature).
Easy example:

>>> x,y = meshgrid( linspace(-10,10,50), linspace(-10,10,50) )
>>> z = log(x**2 + y**2)
>>> cobj = contour(x,y,z)
>>> cobj.clabel()

>>> draw()

Second, when using the new manual labeling of contour labels works (which is
pretty neat!), how do I end this feature?
The doc string says: right click, or potentially click both mouse buttons
together (which already worries me).
Neither works for me on win32, mpl 0.98.3, TkAgg backend, interactive mode.
Does anybody have a solution?

Thanks, Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to end manually adding contour labels: Solved

2008-08-21 Thread Mark Bakker
Dear list -

David Kaplan added a very cool new feature to add labels to a contour plots
manually.

Check out the ginput_manual_clabel.py example.

I posted a question about this before, because I couldn't figure out how to
end the manual selection of label positions.

The doc string (and the example) says to press the middle mouse button or
potentially both mouse buttons together.

Many laptops don't have a middle mouse button. I have read that pushing both
buttons together mimics the middle button on some machines. Not on mine or
any others I have seen.

The trick (at least on my machine) is to configure the touchpad such that
some corner acts as the middle button.

You can do that in the settings of the touchpad (on my XP laptop, under
settings, control panel, mouse, then select device settings and settings;
select tap zones and check to enable tap zones; then select which corner you
want and select the action 'middle mouse button')

I hope this works for everybody. Great new feature!

Mark

ps. I have asked David whether ending manual positions of labels could be
done with the right mouse button instead. He's on vacation now, so we'll see
what he says when he gets back.
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plans for data entry box widget?

2008-10-22 Thread Mark Bakker
Dear mpl developers -

I recall there has been some discussion in the past on developing the
ability to have a widget for entering data. I also recall that was not an
easy thing to do.

What's the current status? Doable?

Thanks, Mark

ps. The new website is really very nice!
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to change yticks on colorbar?

2008-11-05 Thread Mark Bakker
Hello list -

I am trying to change the yticks on my colorbar (in combination with
contourf) and cannot figure out how to do it.

Short example:

x,y = meshgrid(linspace(0,10),linspace(0,10))
a = contourf(x,y,x,linspace(0,10,6))
b = colorbar(a)

This gives a nice colorbar, with ticks at 0,2,4,6,8,10

But I want labels only at 0,5,10. So I thought I can change that as:

b.ax.set_yticks([0,5,10])
draw()

But this gives really wacky results (totally messes up the colorbar), so
that doesn't seem to be the way to do it.

Can anybody tell me the correct way to do it?

Thanks, Mark
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to change yticks on colorbar?

2008-11-06 Thread Mark Bakker
Thanks Stan.

I read the docs (which are quite nice), but couldn't find a way to set the
ticks after the fact.
But your method worked,

Mark

On Wed, Nov 5, 2008 at 4:00 PM, Stan West <[EMAIL PROTECTED]> wrote:

>   *From:* Mark Bakker [mailto:[EMAIL PROTECTED]
> *Sent:* Wednesday, November 05, 2008 06:25
>  Hello list -
>
> I am trying to change the yticks on my colorbar (in combination with
> contourf) and cannot figure out how to do it.
>
> Short example:
>
> x,y = meshgrid(linspace(0,10),linspace(0,10))
> a = contourf(x,y,x,linspace(0,10,6))
> b = colorbar(a)
>
> This gives a nice colorbar, with ticks at 0,2,4,6,8,10
>
> But I want labels only at 0,5,10. So I thought I can change that as:
>
> b.ax.set_yticks([0,5,10])
> draw()
>
> But this gives really wacky results (totally messes up the colorbar), so
> that doesn't seem to be the way to do it.
>
> Can anybody tell me the correct way to do it?
>
> Thanks, Mark
>
> Try
>
> b = colorbar(a, ticks=linspace(0, 10, 3))
>
> Documentation is at
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.colorbar
> .
>
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] question about example of override the default reporting of coords

2012-05-31 Thread Mark Bakker
I looked at the example of overriding the default reporting of coords,
which is here:
http://matplotlib.sourceforge.net/examples/pylab_examples/coords_report.html

from pylab import *

def millions(x):
return '$%1.1fM' % (x*1e-6)

x = rand(20)
y = 1e7*rand(20)

ax = subplot(111)
ax.fmt_ydata = millions
plot(x, y, 'o')

show()

I don't understand what the millions function does (with a $ and M ?).
In fact, I get the exact same result when I delete the line

ax.fmt_ydata = millions

Any thoughts?
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] question about example of override the default reporting of coords

2012-05-31 Thread Mark Bakker
OK. Got it. That is not what I was looking for.

But, why the leading $ sign? Just as an example? The $ sign shows up in the
cursor coordinate now. Is that what was supposed to happen (it is confusing
with the $ sign also being used for mathtext formatting, as you know).

Thanks,

Mark

On Thu, May 31, 2012 at 3:49 PM, Tony Yu  wrote:

>
>
> On Thu, May 31, 2012 at 9:31 AM, Mark Bakker  wrote:
>
>> I looked at the example of overriding the default reporting of coords,
>> which is here:
>>
>> http://matplotlib.sourceforge.net/examples/pylab_examples/coords_report.html
>>
>> from pylab import *
>>
>> def millions(x):
>> return '$%1.1fM' % (x*1e-6)
>>
>> x = rand(20)
>> y = 1e7*rand(20)
>>
>> ax = subplot(111)
>> ax.fmt_ydata = millions
>> plot(x, y, 'o')
>>
>> show()
>>
>> I don't understand what the millions function does (with a $ and M ?).
>> In fact, I get the exact same result when I delete the line
>>
>> ax.fmt_ydata = millions
>>
>> Any thoughts?
>>
>
> Hi Mark,
>
> It's a bit confusing, but there's actually two different types of
> formatters. You're most likely looking for major/minor tick formatters (
> example<http://matplotlib.sourceforge.net/examples/api/engineering_formatter.html>).
> In the above example, the *cursor coordinate* is reformatted. In an
> interactive window, you should see the current cursor position in the lower
> left (this may depend on the backend)---that's the value that should be
> reformatted by the `millions` function.
>
> Best,
> -Tony
>
>
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] easy question on ytick label format

2012-06-01 Thread Mark Bakker
Hello List,

I want to plot plot([1000,2000])
Then on the y-axis, I want labels 1 and 2, and at the top of the y-axis I
want E3.
This works automatically with plot([1e7,2e7]).
But I assume that is something that can be set for plot([1e3,2e3]) as well.

I have been browsing the examples, and tried the (for me) obvious things,
but couldn't find the answer.

Any help is appreciated,

Mark
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] easy question on ytick label format

2012-06-01 Thread Mark Bakker
Thanks Zoltan.
That sounds like an interesting video that I will watch.

For now, does anybody know the answer?

Mark

On Fri, Jun 1, 2012 at 3:01 PM, Zoltán Vörös  wrote:

>  I think, you could just watch the video by John Hunter. He discusses
> these issues at length.
>
> http://marakana.com/s/advanced_matplotlib_tutorial_with_library_author_john_hunter,1133/index.html
> Cheers,
> Zoltná
>
>
>
> On 06/01/2012 02:58 PM, Mark Bakker wrote:
>
> Hello List,
>
> I want to plot plot([1000,2000])
> Then on the y-axis, I want labels 1 and 2, and at the top of the y-axis I
> want E3.
> This works automatically with plot([1e7,2e7]).
> But I assume that is something that can be set for plot([1e3,2e3]) as well.
>
> I have been browsing the examples, and tried the (for me) obvious things,
> but couldn't find the answer.
>
> Any help is appreciated,
>
> Mark
>
>
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] easy question on ytick label format

2012-06-01 Thread Mark Bakker
Thanks. Easy and useful.

On Fri, Jun 1, 2012 at 7:23 PM, Tony Yu  wrote:

>
>>> On 06/01/2012 02:58 PM, Mark Bakker wrote:
>>>
>>> Hello List,
>>>
>>> I want to plot plot([1000,2000])
>>> Then on the y-axis, I want labels 1 and 2, and at the top of the y-axis
>>> I want E3.
>>> This works automatically with plot([1e7,2e7]).
>>> But I assume that is something that can be set for plot([1e3,2e3]) as
>>> well.
>>>
>>> I have been browsing the examples, and tried the (for me) obvious
>>> things, but couldn't find the answer.
>>>
>>> Any help is appreciated,
>>>
>>> Mark
>>>
>>> Hi Mark,
>
> You can set the (exponent) limits at which scientific notation is
> activated:
>
> plt.ticklabel_format(scilimits=(-3, 3))
>
> -Tony
>
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problem with size of axes with imshow

2012-07-27 Thread Mark Bakker
Dear List,

When I run this little file (I call it testimage.py), I get a different
answer on my Mac (the correct answer) than Windows (the wrong answer).

from pylab import *
c = ones((10,20))
ax = imshow(c)
show()
print ax.get_axes().get_position()

On my Mac I get:
run testimage
Bbox(array([[ 0.125 ,  0.2417],
   [ 0.9   ,  0.7583]]))

On Windows I get:
run testimage
Bbox(array([[ 0.125, 0.1 ],
   [0.9, 0.9 ]]))

Any thoughts? When I type the commands in at the IPython prompt it works
most of the time (on Windows), but it never works when running the file.
What in the world could be different?

mp version 1.1.0 on both systems.

Thanks for your help,

Mark
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to determine position of axes after imshow?

2012-07-30 Thread Mark Bakker
Hello List,

I am trying to determine the position of the axes after an imshow and am
having problems.
I get a different answer on my Mac (the correct answer) than Windows (the
wrong answer).
I have a file called testimage.py with 5 lines:

from pylab import *
c = ones((10,20))
ax = imshow(c)
show()
print ax.get_axes().get_position()

I run this file from IPython.

On my Mac I get:
run testimage
Bbox(array([[ 0.125 ,  0.2417],
   [ 0.9   ,  0.7583]]))

On Windows I get (the wrong answer):
run testimage
Bbox(array([[ 0.125, 0.1 ],
   [0.9, 0.9 ]]))

Any thoughts? When I type the commands in at the IPython prompt it works
most of the time (on Windows), but it never works when running the file.
What in the world could be different?

mp version 1.1.0 on both systems.

Thanks for your help,

Mark
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to determine position of axes after imshow?

2012-08-07 Thread Mark Bakker
I tried a few things and found out that doing a pause works.
So why does a pause work, but a draw() or show() does not?
This all on Windows using the standard PythonXY installation.
Here is the code that works (testimage.py):

from pylab import *
c = ones((10,20))
ax = imshow(c)
pause(0.01)
print ax.get_axes().get_position()

Running from IPython:
run testimage
Bbox(array([[ 0.125 ,  0.2417],
   [ 0.9   ,  0.7583]]))


On Wed, Aug 1, 2012 at 8:56 PM, Stan West  wrote:

> **
>
> *From:* Mark Bakker [mailto:mark...@gmail.com]
> *Sent:* Monday, July 30, 2012 05:54
>
> Hello List,
>
> I am trying to determine the position of the axes after an imshow and am
> having problems.
> I get a different answer on my Mac (the correct answer) than Windows (the
> wrong answer).
>
> [...]
>
> Any thoughts? When I type the commands in at the IPython prompt it works
> most of the time (on Windows), but it never works when running the file.
> What in the world could be different?
>
> mp version 1.1.0 on both systems.
>
>  Are you using the same backend on both systems?
>
> Perhaps when you run the script within IPython on your Windows system, the
> show() call is not triggering a draw. You can force drawing by calling
> draw() before show(). I hope that helps.
>
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to determine position of axes after imshow?

2012-08-09 Thread Mark Bakker
I am glad to see you can reproduce the error, Stan.
I am running whatever is default with a PythonXY installation (sorry my
windows machine is at work).
Strange behavior.
The code works fine on my mac (PyQt4 backend) with all options
(show,draw,pause).
Should we file a bug report?
Mark

On Thu, Aug 9, 2012 at 4:02 PM, Stan West  wrote:

> **
>
> *From:* Mark Bakker [mailto:mark...@gmail.com]
> *Sent:* Tuesday, August 07, 2012 06:42
>
> I tried a few things and found out that doing a pause works.
> So why does a pause work, but a draw() or show() does not?
> This all on Windows using the standard PythonXY installation.
> Here is the code that works (testimage.py):
>
> from pylab import *
> c = ones((10,20))
> ax = imshow(c)
> pause(0.01)
> print ax.get_axes().get_position()
>
> Running from IPython:
> run testimage
> Bbox(array([[ 0.125 ,  0.2417],
>[ 0.9   ,  0.7583]]))
>
> I modified your script to test show(), draw(), and pause(); it's attached.
> For the WXAgg matplotlib backend, I get:
>
> In [1]: print(matplotlib.get_backend())
> WXAgg
>
> In [2]: %run testimage
> show:  Bbox(array([[ 0.125,  0.1  ],
>[ 0.9  ,  0.9  ]]))
> draw:  Bbox(array([[ 0.125 ,  0.2417],
>[ 0.9   ,  0.7583]]))
> pause:  Bbox(array([[ 0.125 ,  0.2417],
>[ 0.9   ,  0.7583]]))
>
> but for the Qt4Agg backend, I get:
>
> In [1]: print(matplotlib.get_backend())
> Qt4Agg
>
> In [2]: %run testimage
> show:  Bbox(array([[ 0.125,  0.1  ],
>[ 0.9  ,  0.9  ]]))
> draw:  Bbox(array([[ 0.125,  0.1  ],
>[ 0.9  ,  0.9  ]]))
> pause:  Bbox(array([[ 0.125 ,  0.2417],
>[ 0.9   ,  0.7583]]))
>
> Which backend have you been using?
>
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Is there an update on: "Matplotlib 1.1.0 animation vs. contour plots"?

2012-10-02 Thread Mark Bakker
Hello List,

Apparently, it is not straightforward to make an animation of contour plots.
I found a discussion (and work-around solution including punching ducks) on
the list through this link: punch the QuadContourSet until it behaves like
an 
Artist

Has there been a fix since then? It would be nice if contours work with
animations like the other plots.
If not, no big deal.

Thanks,

Mark
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] large space after superscript in mathtype

2013-02-19 Thread Mark Bakker
Hello List,

I want to put the following text on a graph, for example along the x-axis:

xlabel('$m^3/d$')

This should show the letter m raised to the power 3 and then a slash and
the letter d.
When I do this, there appears a large space after the power 3 and the slash.
So much so that the copy editor of the journal I am publishing in asked me
to remove the extra white space.

Any suggestions on how to do that?

Thanks,

Mark
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] large space after superscript in mathtype

2013-02-19 Thread Mark Bakker
I found out a \! (negative thin space in Latex) works.
xlabel('$m^3\!/d$')


On Tue, Feb 19, 2013 at 10:15 AM, Mark Bakker  wrote:

> Hello List,
>
> I want to put the following text on a graph, for example along the x-axis:
>
> xlabel('$m^3/d$')
>
> This should show the letter m raised to the power 3 and then a slash and
> the letter d.
> When I do this, there appears a large space after the power 3 and the
> slash.
> So much so that the copy editor of the journal I am publishing in asked me
> to remove the extra white space.
>
> Any suggestions on how to do that?
>
> Thanks,
>
> Mark
>
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Axes3D figure to U3D

2010-05-29 Thread Mark Bakker
Hello List,

Is there anybody who has tried to convert a Axes3D figure to U3D so it can
be imbedded in a pdf file? It would be exceedingly cool. If anybody has code
that can do this, that would be most excellent. If not, does anybody have
any other thoughts on getting a 3D image in an interactive pdf file?

Thanks,

Mark
--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problem with negative numbers on axes in EPS file when using in Latex file

2010-11-10 Thread Mark Bakker
Hello List,

I have a pretty wacky problem.
I create a figure which includes negative values along the y-axis:
plot([-1,1]) for example.
I save the figure as EPS.
When I look at the figure with preview on my Mac it looks fine.
When I import the figure in my Latex document the negative values disappear.
My solution has been to use eps2eps on the eps file created by mpl, and this
solves the problem. So apparently there is something not quite standard on
the EPS file created by MPL.
Is this a bug?
I am running version 0.99.3 (Enthought dis) on a Mac running Leopard.

Thanks for any suggestions,

Mark
--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with negative numbers on axes in EPS file when using in Latex file

2010-11-10 Thread Mark Bakker
That works great.
Never would have looked there.
Thanks!
Mark

On Wed, Nov 10, 2010 at 2:27 PM, John Hunter  wrote:

>  axes.unicode_minus : False
--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] change default format of ticks on vertical axis

2011-03-07 Thread Mark Bakker
Hello List,

My values on the vertical axis are large, but the range is small:

plot([3004,3005,3006])

By default this plots 0,1,2 as tickmarks along the vertical axis, and then
at the top of the vertical axis is prints "+3.005e3".

I prefer to simply get 3004,3005,3006 at the tickmarks.

Any (easy) way I can change the default formatting?

Sorry for the easy question,

Mark
--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] change default format of ticks on vertical axis

2011-03-08 Thread Mark Bakker
Works great Eric.
Is this in the documentation somewhere?
Thanks,
Mark


From: Eric Firing 
> On 03/07/2011 11:51 AM, Mark Bakker wrote:
> > My values on the vertical axis are large, but the range is small:
> > plot([3004,3005,3006])
> > By default this plots 0,1,2 as tickmarks along the vertical axis, and
> > then at the top of the vertical axis is prints "+3.005e3".
> > I prefer to simply get 3004,3005,3006 at the tickmarks.
>
> If you are using a recent mpl, try following your plot command with
>
> ticklabel_format(useOffset=False)
>
> Eric
>
--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] numpy datetime64 plans?

2011-08-29 Thread Mark Bakker
Hello List,

Does anybody know of any plans to include support for the new datetime64
data type in numpy? If this is the new numpy standard for doing dates and
times, it would be great if it would work with plot_date, for example.

Just wondering (but boy, would I do a little dance when all this datetime
stuff is fully operational and integrated),

Mark
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How can I set the backgroundcolor of text with set_backgroundcolor ?

2007-01-03 Thread Mark Bakker

Hello -

I want to set the backgroundcolor of text with the set_backgroundcolor
function.
Does that actually work?
I saw a more complicated way to do it by defining a bbox, but this would be
much easier (if I got it to work).
Here's my example that doesn't work.
Thanks for any suggestions,

Mark

from pylab import *
plot([1,2,3])
t = text(1,2,'Hello')
t.set_backgroundcolor('r')
draw()
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How can I set the backgroundcolor of text with set_backgroundcolor ?

2007-01-03 Thread Mark Bakker

Thanks John. This works great.
I think, however, that set_backgroundcolor would be useful.
It should be easy to fix.
If nobody speaks up, I will take a crack at it,
Mark

On 1/3/07, John Hunter <[EMAIL PROTECTED]> wrote:


>>>>> "Mark" == Mark Bakker <[EMAIL PROTECTED]> writes:

Mark> Hello - I want to set the backgroundcolor of text with the
Mark> set_backgroundcolor function.  Does that actually work?  I
Mark> saw a more complicated way to do it by defining a bbox, but
Mark> this would be much easier (if I got it to work).  Here's my
Mark> example that doesn't work.  Thanks for any suggestions,

Strange.  When I saw your post my first thought was "hmmm, I didn't
know we had a text background color".  I looked through the text.py
code and it is there as a property, but is totally unused.  I don't
know who added it, but apparently someone got interrupted mid-code.
That someone could be me, but if anyone knows where this came from
speak up; otherwise it will be removed.

The bbox is the standard way to do this, and is a bit more general
since you can set the alpha, the linewidth, the edgecolor, etc...

  ax.text(1,2,'hi mom', bbox=dict(facecolor='red'))

JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How can I set the backgroundcolor of text with set_backgroundcolor ?

2007-01-03 Thread Mark Bakker

Thanks for writing the convenience function John !
I think there is a large group (like the students in my class) who use
matplotlib as a simple tool to make beautiful graphs. To compete with matlab
we need to keep simple tasks simple. I personally think that this
convenience function is a good one to add. Probably under pylab.
Anybody else want to weigh in?
Mark

On 1/3/07, John Hunter <[EMAIL PROTECTED]> wrote:


>>>>> "Mark" == Mark Bakker <[EMAIL PROTECTED]> writes:

Mark> Thanks John. This works great.  I think, however, that
Mark> set_backgroundcolor would be useful.  It should be easy to
Mark> fix.  If nobody speaks up, I will take a crack at it, Mark

What do you have in mind, a simple convenience function that does

def set_backgroundcolor(self, color):
"""
Set the background color of the text by updating the bbox
facecolor

ACCEPTS: any matplotlib color
"""
if self._bbox is None:
self._bbox = dict(facecolor=color, edgecolor=color)
else:
self._bbox.update(dict(facecolor=color))

I'm not too opposed to it, but it does violate the maxim "There should be
one--
and preferably only one --obvious way to do it."  Of course, we
violate this throughout mpl offerings lots of convenience functions,
but it is something to bear in mind.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Using 'scaled' for aspect ratio

2007-01-03 Thread Mark Bakker

The enhanced way of handling aspect ratios that Eric implemented works
great.
There is, however, one change from the old implementation that I don't like.

In the old implementation, when setting axis('scaled') it also turned
autoscale off.
This makes sense (and I used it a lot). It means that you can set the
axis('scaled'), which means the aspect ratios are set equal and the axis
limits are not changed, at any point when you like the data limits. The axis
limits are then fixed so that every time you add something else to the
figure it will keep these limits.

In the new implementation (ok, it has been there for a little while now),
you have to give a separate set_autoscale_on(False) command.
Besides the odd name of the function (you actually turn the autoscale off),
it is a command that should be set right away by axis('scaled'). If you want
the autoscale to remain on, you should use axis('equal')

Anybody else an opinion? Andrea?

Thanks, Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using 'scaled' for aspect ratio

2007-01-04 Thread Mark Bakker

Eric -

Yeah, I agree. The words 'equal' is confusing. But it was taken from matlab.
'scaled' was my invention/doing. I thought it was better than 'equal', as it
makes the scales equal on both axes. Either way, I would like it if we can
fix the data limits in a simple way, and I think incorporating it in
'scaled' would be one option. A new option would be a good idea too.
Something like 'scaledfixed' ? Maybe too long. Or just 'scaledf' ? Code is
simple:

elif s == 'scaledf':
self.set_aspect('equal', adjustable='box', anchor='C')
    self.set_autoscale_on(False)

Thanks,

Mark


On 1/3/07, Eric Firing <[EMAIL PROTECTED]> wrote:


Mark Bakker wrote:
> The enhanced way of handling aspect ratios that Eric implemented works
> great.
> There is, however, one change from the old implementation that I don't
like.
>
> In the old implementation, when setting axis('scaled') it also turned
> autoscale off.
> This makes sense (and I used it a lot). It means that you can set the
> axis('scaled'), which means the aspect ratios are set equal and the axis
> limits are not changed, at any point when you like the data limits. The
> axis limits are then fixed so that every time you add something else to
> the figure it will keep these limits.
>
> In the new implementation (ok, it has been there for a little while
> now), you have to give a separate set_autoscale_on(False) command.
> Besides the odd name of the function (you actually turn the autoscale
> off), it is a command that should be set right away by axis('scaled').
> If you want the autoscale to remain on, you should use axis('equal')

Here is the present code fragment (slightly mangled by the mailer):

 elif s in ('equal', 'tight', 'scaled', 'normal', 'auto',
'image'):
 self.set_autoscale_on(True)
 self.set_aspect('auto')
 self.autoscale_view()
 self.apply_aspect()
 if s=='equal':
 self.set_aspect('equal', adjustable='datalim')
 elif s == 'scaled':
 self.set_aspect('equal', adjustable='box',
anchor='C')
 elif s=='tight':
 self.autoscale_view(tight=True)
 self.set_autoscale_on(False)
 elif s == 'image':
 self.autoscale_view(tight=True)
 self.set_autoscale_on(False)
 self.set_aspect('equal', adjustable='box',
anchor='C')

At present, the difference between "equal" and "scaled" is not the
autoscale state but the "adjustable".

I don't have any objection to changing the behavior of "scaled" as you
suggest, if that is what people want.  Alternatively, yet another word
could be used to define the behavior you want, and that behavior could
be added.  I don't find "scaled" or "equal" very descriptive or
intuitive; nor do I find that either word suggests how autoscale should
be set.  (And I agree, "set_autoscale_on(False)" is ugly.)

Eric

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using 'scaled' for aspect ratio

2007-01-06 Thread Mark Bakker

Thanks Eric. I'll give it a shot,
Mark

On 1/6/07, Eric Firing <[EMAIL PROTECTED]> wrote:


Mark Bakker wrote:
> Eric -
>
> Yeah, I agree. The words 'equal' is confusing. But it was taken from
> matlab. 'scaled' was my invention/doing. I thought it was better than
> 'equal', as it makes the scales equal on both axes. Either way, I would
> like it if we can fix the data limits in a simple way, and I think
> incorporating it in 'scaled' would be one option. A new option would be
> a good idea too. Something like 'scaledfixed' ? Maybe too long. Or just
> 'scaledf' ? Code is simple:
>
>  elif s == 'scaledf':
>  self.set_aspect('equal', adjustable='box',
anchor='C')
>  self.set_autoscale_on(False)

No one else said anything about this, so I suspect that you may be the
only person using 'scaled' now.  Given that you invented it, and that it
was present for a while in your original form, I decided to simply
restore it to that rather than to introduce another option.  There are
potentially too many combinations to have a short name for each.

This is not irrevocable, of course.

I had to make a slight change in apply_aspect so that toggling back and
forth between this version of scaled and equal would work; I hope that
hasn't fouled up anything else.  I think it should be OK.

Eric

>
> Thanks,
>
> Mark
>
>
> On 1/3/07, *Eric Firing* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Mark Bakker wrote:
>  > The enhanced way of handling aspect ratios that Eric implemented
> works
>  > great.
>  > There is, however, one change from the old implementation that I
> don't like.
>  >
>  > In the old implementation, when setting axis('scaled') it also
> turned
>  > autoscale off.
>  > This makes sense (and I used it a lot). It means that you can set
the
>  > axis('scaled'), which means the aspect ratios are set equal and
> the axis
>  > limits are not changed, at any point when you like the data
> limits. The
>  > axis limits are then fixed so that every time you add something
> else to
>  > the figure it will keep these limits.
>  >
>  > In the new implementation (ok, it has been there for a little
while
>  > now), you have to give a separate set_autoscale_on(False)
command.
>  > Besides the odd name of the function (you actually turn the
autoscale
>  > off), it is a command that should be set right away by
> axis('scaled').
>  > If you want the autoscale to remain on, you should use
axis('equal')
>
> Here is the present code fragment (slightly mangled by the mailer):
>
>  elif s in ('equal', 'tight', 'scaled', 'normal',
'auto',
> 'image'):
>  self.set_autoscale_on(True)
>  self.set_aspect('auto')
>  self.autoscale_view()
>  self.apply_aspect()
>  if s=='equal':
>  self.set_aspect('equal', adjustable='datalim')
>  elif s == 'scaled':
>  self.set_aspect('equal', adjustable='box',
> anchor='C')
>  elif s=='tight':
>  self.autoscale_view(tight=True)
>  self.set_autoscale_on(False)
>  elif s == 'image':
>  self.autoscale_view(tight=True)
>  self.set_autoscale_on(False)
>  self.set_aspect('equal', adjustable='box',
> anchor='C')
>
> At present, the difference between "equal" and "scaled" is not the
> autoscale state but the "adjustable".
>
> I don't have any objection to changing the behavior of "scaled" as
you
> suggest, if that is what people want.  Alternatively, yet another
word
> could be used to define the behavior you want, and that behavior
could
> be added.  I don't find "scaled" or "equal" very descriptive or
> intuitive; nor do I find that either word suggests how autoscale
should
> be set.  (And I agree, "set_autoscale_on(False)" is ugly.)
>
> Eric
>
>


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] clearing a figure

2007-01-10 Thread Mark Bakker

Belinda -

The hold state is on by default when you use pylab. To clear a figure you
use clf().
Here's a brief example:
from pylab import *
figure() # Not really needed, you could have typed plot right away, but here
you can set some nice features like the size
plot([1,2,3])
plot([2,1,2])  # Will appear on same figure
clf() # Clears entire figure (back to what you had with figure() )

Mark

Message: 10

Date: Tue, 09 Jan 2007 19:50:15 -0800
From: belinda thom <[EMAIL PROTECTED]>
Subject: [Matplotlib-users] clearing a figure
To: matplotlib-users 
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hello,

I'm a new matplotlib user, coming from the Matlab end.

Is there a standard way to create a figure (here I'd like the
equivalent of matlab's hold on, so I can draw multiple things) and
then clear the figure (so the drawing goes away) so I can repeat the
process again? The commands to plot that I'll be using are fairly
simple line commands.






--

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


End of Matplotlib-users Digest, Vol 8, Issue 13
***

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] idle and ipython and axis

2007-01-10 Thread Mark Bakker

I have experienced the same problem with IDLE.
It only works with -n, but then you lose the nice feature of 'starting
over'.
Does anybody know a fix so we can do both?
Thanks,
Mark

BTW, when you use pylab in interactive mode, the axis() command should scale
your figure interactively, also under IDLE. Have you tried that?
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] x=, y=, z=??

2007-01-13 Thread Mark Bakker
I think this is an excellent idea, Eric.
I would love it if this feature would also work in contour.
The difficulty I see is that an axis needs to know whether an image or
contour plot has been added. If so, it needs access to the array with
the data to show the z value.
I am thinking out loud here.
So an axis needs an attribute 'showz' or something, that gets set, and
a pointer to the array needs to be set. What to do when you overlay
two contour plots? Not sure yet. Then the toolbar needs to be modified
to take that into account and call the appropriate function to display
the z value.
I think this would be a great feature.
Does anybody have suggestions for a clean implementation?
Mark

>
> Message: 3
> Date: Fri, 12 Jan 2007 14:13:50 +0100
> From: Eric Emsellem <[EMAIL PROTECTED]>
> Subject: [Matplotlib-users] x=, y=, z=??
> To: matplotlib-users@lists.sourceforge.net
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Dear all,
>
> I am coming back to an issue for which I didn't get a direct answer
> (except for a very nice module from Angus McMorland!):
>
> - at the moment different backends in mpl automatically provides, when
> an image (or a plot) is displayed with e.g. imshow (plot), the
> coordinates x and y directly in the toolbar.
>
> - When it is indeed an image wich is displayed, it would, in my opinion
> makes a LOT of sense to also display the "z" coordinate, namely the
> 'intensity' value of the pixel of the image on which the cursor is
> standing.
>
> The questions are then: does this also make sense to you, and if yes,
> would it be possible for someone to implement it as an intrinsic feature
> of mpl backends?  (I am not competent to answer the feasibility part
> here, although the module Angus nicely provided on the list is an
> excellent example, even if it adds one more layer which may be avoidable).
>
> thanks for any input here!
> cheers
>
> Eric
>

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] basemap conversion to Google Earth?

2007-02-07 Thread Mark Bakker

Hello -

Can basemap help with a coversion to Google Earth coordinates and mabye even
a kmz file?

Thanks, Mark
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Native file format

2007-02-08 Thread Mark Bakker

Does anybody understand why CXX extensions don't pickle?
I have the same problem with my own CXX extensions, which I make with SWIG.
On the other hand, FORTRAN extensions using f2py pickle fine!
Mark

From: "John Hunter" <[EMAIL PROTECTED]>

Subject: Re: [Matplotlib-users] Native file format
To: "Edin Salkovic" <[EMAIL PROTECTED]>
Cc: Jan Strube <[EMAIL PROTECTED]>,
matplotlib-users@lists.sourceforge.net, Eric Firing
<[EMAIL PROTECTED]>
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 2/7/07, Edin Salkovic <[EMAIL PROTECTED]> wrote:

> Why can't mpl's figures be pickled?

The main thing is we need to add pickle support for all of mpl's extension
code

  http://docs.python.org/lib/node321.html

In earlier attempts people got stuck with trying to pickle the
CXX extension code, which was causing some problems, but these
problems may be fixed in more recent versions of CXX.  Todd Miller was
the last person to look at this in some detail, I think.

Other hinderances may come from the GUI layer, since figures store
pointers to their canvases which in some cases come from GUI extension
code that may not support pickling.  But we can fairly easy decouple
the figure from the canvas at pickle time and deal with pure mpl,
numpy and python objects.  The main work is to add pickle
serialization to the mpl extension code.

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] bug in axis('scaled') in version 0.90 and proposed fix

2007-02-14 Thread Mark Bakker

Eric -

I just installed version 0.90 on my windows machine and it seems that
axis('scaled') doesn't work properly yet.
I thought axis('scaled') will change the axes such that the aspect ratio is
equal WITHOUT changing the limits on the axes.
A simple example shows that this goes wrong (I thought this used to work):

from pylab import *
plot([1,2,3],[1,2,1])
axis([1,2,1,2])  # define new axis limits
axis('scaled')

And now Python comes back with (1.0, 3.0, 0.80004, 2.0), which
are the limits of the original plot command obtained using autoscale_view.
I think this is an easy fix in the axis function of axes.py.
Here you do an autoscale_view, which shouldn't be done in the 'scaled'
option.
I think you only need to change the indicated line below.

Thanks,

Mark

   def axis(self, *v, **kwargs):
   '''
   Convenience method for manipulating the x and y view limits
   and the aspect ratio of the plot.

   kwargs are passed on to set_xlim and set_ylim -- see their
docstrings for details
   '''
   if len(v)==1 and is_string_like(v[0]):
   s = v[0].lower()
   if s=='on': self.set_axis_on()
   elif s=='off': self.set_axis_off()
   elif s in ('equal', 'tight', 'scaled', 'normal', 'auto',
'image'):
   self.set_autoscale_on(True)
   self.set_aspect('auto')
   if s!= 'scaled': self.autoscale_view()  # THIS LINE WAS
CHANGED BY ADDING THE IF STATEMENT
   self.apply_aspect()
   if s=='equal':
   self.set_aspect('equal', adjustable='datalim')
   elif s == 'scaled':
   self.set_aspect('equal', adjustable='box', anchor='C')
   self.set_autoscale_on(False) # Req. by Mark Bakker
   elif s=='tight':
   self.autoscale_view(tight=True)
   self.set_autoscale_on(False)
   elif s == 'image':
   self.autoscale_view(tight=True)
   self.set_autoscale_on(False)
   self.set_aspect('equal', adjustable='box', anchor='C')
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] bug in axis('scaled') in version 0.90 and proposed fix

2007-02-14 Thread Mark Bakker

I have a follow-up on my previous emai.
I don't think we should do an autoscale_view() for axis('equal') either.
For axis('equal') only the limits of either the x or y axis are adjusted
(enlarged really) until the aspect ratio is equal.
Not sure about the others. Do we ever need to do it?

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] bug in axis('scaled') in version 0.90 and proposed fix

2007-02-15 Thread Mark Bakker

Eric -

Thanks for your reply.
Let me give you my idea about axis('scaled') and why I am asking for a
change (a new option would be fine as well).

What people I talked to do is, they plot some background (say roads) for a
large area; in interactive mode. Then they contour a small portion of that
area, for which they made a model, and zoom in. Then they realize: oh, I
haven't set the aspect ratio, so they do axis('scaled') and boom, they are
zoomed out again to the full extend of all the roads they have as a
background. This is a surprisingly common, and I see it a lot, also with
people using Matlab. It drives you bonkers. If you use axis('equal'), also
in Matlab, every time you add something to the plot, it zooms out to the
full extend again. And drives you up the wall. That's is why I made
axis('scaled'). I want to use the axis limits the user has specified and not
monckey with it. That works fine now (thanks!), except for the very first
time you do axis('scaled'), then it zooms out to the full extend. It doesn't
make much sense to me to do it the first time, but not any of the other
times.

I hope this makes some sense. So what to do next. My preference is to make
the change I suggested. My second choice is to define a new option that does
what I request, as I think this will get a lot of use. Then we would have to
come up with a new option name.

Let me know what you think,

Mark

On 2/14/07, Eric Firing <[EMAIL PROTECTED]> wrote:


Mark,

It sounds like what you want axis('scaled') to do is nothing other than

gca().set_aspect(1, adjustable='box')
draw_if_interactive()

I think this is a bit out of character with things like axis('equal').
Part of this character is that automatic things are turned on, so that
going back and forth between axis('equal') and axis('scaled') switches
back and forth between the same two plots; the result is not
history-dependent.

At your request (between the 0.87.7 and 0.90 releases), I put in a
little bit of history-dependence by making axis('scaled') call to
 self.set_autoscale_on(False) # Req. by Mark Bakker
after the set_aspect() call.  This means that you can get the behavior
you want simply by changing your example to

from pylab import *
plot([1,2,3],[1,2,1])
axis('scaled')
axis([1,2,1,2])  # define new axis limits

Is this good enough?  Do you really need to be able to set the axis
limits *before* the call to axis('scaled')?  If so, then I am inclined
to make this a separate option for the axis command, because I think the
present behavior of axis('scaled') is sensible in the context of the
other existing options.

Eric


Mark Bakker wrote:
> Eric -
>
> I just installed version 0.90 on my windows machine and it seems that
> axis('scaled') doesn't work properly yet.
> I thought axis('scaled') will change the axes such that the aspect ratio
> is equal WITHOUT changing the limits on the axes.
> A simple example shows that this goes wrong (I thought this used to
work):
>
> from pylab import *
> plot([1,2,3],[1,2,1])
> axis([1,2,1,2])  # define new axis limits
> axis('scaled')
>
> And now Python comes back with ( 1.0, 3.0, 0.80004, 2.0),
> which are the limits of the original plot command obtained using
> autoscale_view.
> I think this is an easy fix in the axis function of axes.py.
> Here you do an autoscale_view, which shouldn't be done in the 'scaled'
> option.
> I think you only need to change the indicated line below.
>
> Thanks,
>
> Mark
>
> def axis(self, *v, **kwargs):
> '''
> Convenience method for manipulating the x and y view limits
> and the aspect ratio of the plot.
>
> kwargs are passed on to set_xlim and set_ylim -- see their
> docstrings for details
> '''
> if len(v)==1 and is_string_like(v[0]):
> s = v[0].lower()
> if s=='on': self.set_axis_on()
> elif s=='off': self.set_axis_off()
> elif s in ('equal', 'tight', 'scaled', 'normal', 'auto',
> 'image'):
> self.set_autoscale_on(True)
> self.set_aspect('auto')
> if s!= 'scaled': self.autoscale_view()  # THIS LINE WAS
> CHANGED BY ADDING THE IF STATEMENT
> self.apply_aspect()
> if s=='equal':
> self.set_aspect('equal', adjustable='datalim')
> elif s == '

[Matplotlib-users] problem axis('scaled') with shared axis

2007-02-15 Thread Mark Bakker

Eric -

I found another problem that I cannot figure out.
I make an axis, and make it 'scaled'.
Then I make a second axis that shares the x-axis with the first axis.
But then the y limits of the first axis change upon creation, and the
'adjustable' attribute!
I know for sure this used to work, but am not sure when it got changed.
What it used to do is that you could zoom nicely into the first axis
(interactively), while the size of the shared axis changed with it. A thing
of beauty I thought, and I loved showing it off. Do you think we can get
that back?

Here's a small example of the error:


from pylab import *
ax = axes([.1,.5,.8,.4])
plot([1,2,3])

[]

axis('scaled')

(0.0, 2.0, 1.0, 3.0)

ax.get_adjustable()

'box'

ax2 = axes([.1,.1,.8,.3],sharex=ax)
ax.get_adjustable()  # GOT CHANGED!

'datalim'

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem axis('scaled') with shared axis

2007-02-15 Thread Mark Bakker

This is a good idea.
I had done something like that for the original axis('equal') and
axis('scaled') but I don't think it is in the example directory anymore.
Once we get it to work again, I will make sure to do make an example and put
it in the units directory.

And Yes, I realize testing this stuff in interactive mode is not easy.
Eric has done a very nice job rewriting my original stuff in an organized
and much more comprehensive fashion. These are just some last minor issues
that need to be fixed.

Mark

On 2/15/07, John Hunter <[EMAIL PROTECTED]> wrote:


On 2/15/07, Mark Bakker <[EMAIL PROTECTED]> wrote:
> I found another problem that I cannot figure out.
> I make an axis, and make it 'scaled'.

Unit testing graphics packages can be hard, especially interactive
stuff like this, but I am a fan of poor man's unit testing here.  When
you get something working like you like it, write an example that
generates several figures, and make the figure title an instruction to
the user, like: "zoom the image and the axes aspect should update" and
that way when other developers make changes down the road they can
make sure all the original features are preserved.

These scripts can be put into the units directory of the svn repository.

JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] New aspect function for pylab

2007-02-26 Thread Mark Bakker

Eric, list -

Here is the new aspect function for possible inclusion in pylab.
It works great and with the default values for the kwargs, it works exactly
the way I think it is useful for a combination of contouring and plotting.

What do you think, should we include this?

Mark

def aspect(*args, **kwargs):
   """
   Set/Get the aspect ratio (ylength/xlength) of the current axis

   Aspect ratio is defined as unit-length-along-y-axis /
unit-length-along-x-axis
   If no arguments are passed, the current aspect ratio is returned
   Aspect ratio may be met by changing size of axes while keeping data
limits fixed (called 'box'),
   or by changing data limits while keeping the lengths of the axes fixed
(called 'datalim')
   One point remains fixed, which is called the anchor, for example the
center (called 'C')
   Autoscaling may be turned on (limits may change upon next plotting
command)
   or off (limits will remain fixed)
   Keyword arguments:
   adjustable: 'box' (default), 'datalim'
   anchor: 'C' (default), 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'
   fixlim: True (default), False
   """

   ax = gca()
   if len(args)==0:
   aspect = ax.get_aspect()
   elif len(args)==1:
   aspect = args[0]
   adjustable = popd(kwargs,'adjustable','box')
   anchor = popd(kwargs,'anchor','C')
   fixlim = popd(kwargs,'fixlim',True)
   ax.set_aspect(aspect,adjustable,anchor)
   if fixlim:
   ax.set_autoscale_on(False)
   else:
   ax.set_autoscale_on(True)
   ax.autoscale_view()
   draw_if_interactive()
   return aspect
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread Mark Bakker

Thanks for the explanation, John.
I printed out the CODING_GUIDE (sorry, didn't know it existed).
The new function with the extra copy command is shown below.
Can we add this to pylab?
Thanks, Mark

def aspect(*args, **kwargs):
   """
   Set/Get the aspect ratio (ylength/xlength) of the current axis

   Aspect ratio is defined as unit-length-along-y-axis /
unit-length-along-x-axis
   If no arguments are passed, the current aspect ratio is returned
   Aspect ratio may be met by changing size of axes while keeping data
limits fixed (called 'box'),
   or by changing data limits while keeping the lengths of the axes fixed
(called 'datalim')
   One point remains fixed, which is called the anchor, for example the
center (called 'C')
   Autoscaling may be turned on (limits may change upon next plotting
command)
   or off (limits will remain fixed)
   Keyword arguments:
   adjustable: 'box' (default), 'datalim'
   anchor: 'C' (default), 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'
   fixlim: True (default), False
   """

   ax = gca()
   if len(args)==0:
   aspect = ax.get_aspect()
   elif len(args)==1:
   aspect = args[0]
   kwargs = kwargs.copy()
   adjustable = popd(kwargs,'adjustable','box')
   anchor = popd(kwargs,'anchor','C')
   fixlim = popd(kwargs,'fixlim',True)
   ax.set_aspect(aspect,adjustable,anchor)
   if fixlim:
   ax.set_autoscale_on(False)
   else:
   ax.set_autoscale_on(True)
   ax.autoscale_view()
   draw_if_interactive()
   return aspect

On 2/26/07, John Hunter <[EMAIL PROTECTED]> wrote:


On 2/26/07, Mark Bakker <[EMAIL PROTECTED]> wrote:

> ax = gca()
> if len(args)==0:
> aspect = ax.get_aspect()
> elif len(args)==1:
> aspect = args[0]
> adjustable = popd(kwargs,'adjustable','box')
> anchor = popd(kwargs,'anchor','C')
> fixlim = popd(kwargs,'fixlim',True)

Whenever you are mutating a kwargs dictionary, eg with popd, you
should first copy it.  The user may be creating, saving, and resuing a
kwarg dict

  myaspectprops = dict(adjustable='box', anchor='NW')
  # some code
  aspect(**myaspectprops)
  # some more code
  aspect(**myaspectprops)

This will fail if you pop off of the kwargs in the aspect function w/o
first copying it.  So always do

  kwargs = kwargs.copy()

before calling popd and friends.

This is covered in the "CODING_GUIDE" document in the svn repository.

JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread Mark Bakker

John -

Maybe I misunderstand you, but I thought the pylab interface
was invented to do very useful stuff (yet you want to prevent it
from doing something useful ??).

All the functionality is already in the API, but the calling sequence
is too lengthy and somewhat convoluted for interactive use.
The pylab interface is great for interactive use in my opinion.
The proposed aspect command falls right into that framework.
Eric suggested it a week or so ago, as he thought (and I agreed)
that the axis command in pylab was doing too many things already.

Mark


On 2/27/07, John Hunter <[EMAIL PROTECTED]> wrote:


On 2/27/07, Mark Bakker <[EMAIL PROTECTED]> wrote:
> Thanks for the explanation, John.
> I printed out the CODING_GUIDE (sorry, didn't know it existed).
> The new function with the extra copy command is shown below.
> Can we add this to pylab?

Since Eric has been developing and maintaining the aspect stuff of
late, I'll leave it to him to review and contribute.  My one comment
is I want to make pylab as thin a wrapper as possible and where
possible prevent it from doing anything useful.  That is, I'd like to
see all the functionality in the API, and the pylab calls simply make
the appropriate forwarding calls.  Is there a reason all of this
cannot be done in the relevant Axes methods, with the pylab call
simply forwarding on the *args and **kwargs?

Thanks,
JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour Plot of experimental data (Zack 24)

2007-03-07 Thread Mark Bakker

See the

  -

  Gridding irregularly spaced
data-
how to grid scattered data points in order to make a contour or image
  plot.

In the matplotlib cookbook.

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] troubles with plot_date

2007-03-16 Thread Mark Bakker

Hello -

I am trying to plot two sets of data on one graph, using plot_date.
But I get an error.
It is easy to replicate, by calling the plot_date function twice.
Is this supposed to work?

from pylab import *
plot_date(linspace(726468,726668,4),linspace(0,1,4))
plot_date(linspace(726468,726668,4),linspace(0,1,4))

And I get the error:

Traceback (most recent call last):
 File "", line 1, in ?
   plot_date(linspace(726468,726668,4),linspace(0,1,4))
 File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2064, in
plot_date
   ret =  gca().plot_date(*args, **kwargs)
 File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 2395, in
plot_date
   self.xaxis_date(tz)
 File "C:\Python24\lib\site-packages\matplotlib\axes.py", line 1564, in
xaxis_date
   formatter = AutoDateFormatter(locator)
UnboundLocalError: local variable 'locator' referenced before assignment

Any ideas?
Thanks, Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cumulative distribution function

2007-03-22 Thread Mark Bakker

This will give you a smooth line for your cumulative distribution function:

x = randn(1)
y = sort(x)
plot(y,linspace(0,1,1))


Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] what is the old default font?

2007-03-28 Thread Mark Bakker

Hello List -

A while back, the default font changed in the matplotlibrc file.
Does anybody recall what the old default font was?
I kinda liked it better than the current font, but I don't recall what it
was.

Thanks,

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matlab, idle, interactivity and teaching

2007-03-30 Thread Mark Bakker

Giorgio -

Thanks for starting this discussion and sorry for the late reply.
Use of Python with matplotlib in the classroom and by students in general is
a major objective of mine.

I use IDLE with numpy, scipy, and matplotlib.

The IDLE problem is really annoying though. Starting with -n is required (a
strange hack for many students), and then you cannot restart the
interpreter.
I keep hoping that the IDLE developers will be able to change the code such
that this is not necessary anymore.

Another difficulty is that it is cumbersome to change directories. In that
respect, it would be great if pylab had a change directory (cd) command.
That would make interactive use a lot easier. This could also be an IDLE
feature of course.

Another question I get from matlab users is why there isn't a 'whos' to
figure out all the variables that are used. This is really an interactive
issue, where the IDLE would be used as an interpreter (calculator really),
not as a means to develop serious code.

So to summarize, I think getting matlab users switched over, I see the
following three issues high on the list:
1. Get rid of the -n problem for running matplotlib interactively.
2. Make an easy cd command.
3. Make an who option.

On the bright side, I get quite a few people converted that don't want to go
back anymore

Mark

Message: 7

Date: Wed, 28 Mar 2007 16:58:42 +0200
From: Giorgio Luciano <[EMAIL PROTECTED]>
Subject: [Matplotlib-users] matlab, idle, interactivity and teaching
To: Discussion of Numerical Python ,
matplot ,   SciPy
Users List
<[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed

Hello to all,
I've thread that apperead some time ago on this list about matlab and
teaching.
I've discovered python recently  and translated part of the routine I
use in python (www.chemometrics.it).
Some of my collegue asked me if I could show them how to use python. For
matlab user I guess the first problem is to setup everything, but I just
fixed it preparing a directory with all the package I need and a
matplotlibrc file for interactive mode + a shortcut for idle -n use.
The second problem is that people now  wants some bells and whistles of
matlab that I have to admit sometime can be very helpful for saving
time. The bells and whistles are about the workspace.
It's difficult to cut and paste from gnumeric/excel (I generally use txt
file but it's no so immediate) and also there is no "visual" workspace.
I cannot succeed also in saving workspace (I know there is a function so
iosave.mat but I didn't manage easily hot to use it)
For overpass this problems I've tried to use QME-DEV which is in early
stage of development (alpha) but promise well.
What people like of python/matplot/scipy
-its free ;)
-they like a lot the plotting style and capabilities (they find the png
and svg file very clear and accurate)
-they like IDLE as editor (ehy it's has the same color of matlab ;) ! )

So my question is . Do you have a similar experience ?
How do you help people in moving the first step ?
do you use (and also does it exist) a more friendly environment than
IDLE except from QME-DEV.

I know that this question may look silly, but in my opinion also how
much is user friendly a software is very important for getting new users.
Cheers to all
Giorgio

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matlab, idle, interactivity and teaching

2007-03-30 Thread Mark Bakker

I always thought ipython didn't come with a good editor.
Am I mistaken?
Mark

On 3/30/07, Lou Pecora <[EMAIL PROTECTED]> wrote:


Have you looked at iPython?  I think it's a great way
to go.  Check it out.

--- Mark Bakker <[EMAIL PROTECTED]> wrote:

> Giorgio -
>
> Thanks for starting this discussion and sorry for
> the late reply.
> Use of Python with matplotlib in the classroom and
> by students in general is
> a major objective of mine.
>
> I use IDLE with numpy, scipy, and matplotlib.
>
> The IDLE problem is really annoying though.

[cut]



-- Lou Pecora,   my views are my own.
---
"I knew I was going to take the wrong train, so I left early."
--Yogi Berra





Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo!
Games.
http://videogames.yahoo.com/platform?platform=120121

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matlab, idle, interactivity and teaching

2007-04-02 Thread Mark Bakker

Dear List -

Thanks for the discussion on the issue of the real strength of the
Python/matplotlib/numpy/scipy combo.

I use Python for both development and teaching, but my biggest question
concerned teaching.

When I teach, I need something easy and powerful, but also something that is
easy to install and 'feels' like other Windows software.

Furthermore, I don't want to teach them matlab (too expensive and too
restrictive) or any of its clones (cheaper, but still too restrictive).

So I settled on Python with matplotlib and am very happy with it.
In class, we always use it in interactive mode.
I use IDLE because it has a nice Windows feel to it and it comes with an
editor, even though I understand that ipython is much more powerful.
It is my experience that one of the big hurdles of using the
Python/matplotlib/numpy/scipy combo is installation. Many people are just
not comfortable installing a whole bunch of packages to get something to
work. In that respect the Enthought edition has been super (my only request
to them would be to make a new version available more frequent, but I know
they do this all for free so I even feel bad asking).

Regarding the "don't confuse the newbie" comment, I disagree. Many people
that come with a small programming background or a matlab background don't
get confused with the current documentation. I think it is pretty well done.
Maybe we need separate docs for inexperienced and experienced programmers?

The changes I suggested were to get more inexperienced programmers to join
the Python/matplotlib/numpy/scipy world.

I was re-reading the documentation on numpy in the bus this morning, in
preperation for a workshop I got to give (to mostly matlab guys). And boy,
is numpy nice. I have given the workshop several times, but always with
Numeric. I got quite some converts to matplotlib (from matlab) just because
they like the graphical output much better.

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] numpy migration

2007-04-05 Thread Mark Bakker


On Wed, 4 Apr 2007, John Hunter apparently wrote:
> If anyone has any comments or objections to this plan, speak now.



I only switched a couple of months ago (basically because I was waiting for
numpy 1.0 and for scipy to switch) and numpy is so much nicer! (Not that I
didn't like Numeric; I couldn't have started without them!).
Starting the numpy jettison for MPL may encourage others to make the move.
They have to move eventually anyway. And I think they will be very happy in
the end.

+1 for me,

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] using IDLE with -n option HELP

2007-04-10 Thread Mark Bakker

Hello List -

I have been using IDLE with the -n option to run matplotlib interactively.

Now today I decided to install Python 2.4.4, using the win32 installer on
the python webpage.

Normally I use the Enthought edition (which I like a lot), but they haven't
released a new version with numpy 1.0.x yet, so I cannot use that.

OK, so I install Python 2.4.4 and try to edit the IDLE shortcut as usual
(right click and go to properties), but now I cannot anymore edit the
'target' and add the '-n' option!

Why oh why did somebody (at MS?) think it was a good idea to mess with this
so we cannot anymore change this.

Does anybody have a good idea of how to add the '-n' option to the shortcut?

Thanks for any help,

Mark
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] confusion about what part of numpy pylab imports

2007-04-24 Thread Mark Bakker

Hello list -

I am confused about the part of numpy that pylab imports.
Apparently, pylab imports 'zeros', but not the 'zeros' from numpy, as it
returns integers by default, rather than floats.
The same holds for 'ones' and 'empty'.
Example:

from pylab import *
zeros(3)

array([0, 0, 0])

from numpy import *
zeros(3)

array([ 0.,  0.,  0.])

Can this be fixed? Any explanation how this happens? Pylab just imports part
of numpy, doesn't it?

Thanks,

Mark
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] confusion about what part of numpy pylab imports

2007-04-25 Thread Mark Bakker

Well, if I can cast a vote, it would make a lot of sense if pylab functions
do the same thing as numpy functions. Right now it is exceedingly confusing
when I teach, that zeros() could be integers or floats. An rc parameter
where we would import straight from numpy would be most excellent. Can't
wait!
Thanks for the explanations,
Mark

On 4/24/07, Eric Firing <[EMAIL PROTECTED]> wrote:


Gary Ruben wrote:
> Hi Mark,
> this thread may help:
>
http://thread.gmane.org/gmane.comp.python.numeric.general/13399/focus=13421
>
> Essentially, pylab uses a compatibility layer to ease the task of
> supporting the three array packages - currently this uses the Numeric
> version of the ones and zeros functions giving the behaviour you observe
> - this will be fixed when pylab drops support for the older packages,
> which should be soon.

What we will do is drop the use of numerix internally, but the numerix
module will almost certainly remain, presumably with the Numeric and
numarray support removed; so numerix will still use numpy's own
"oldnumeric" compatibility layer, and I expect pylab will still import
from it--at least, by default.  The intention is to avoid breaking
things unnecessarily.  I can imagine possible variations, such as using
an rc param to tell pylab whether to import from plain numpy or from
oldnumeric, and splitting pylab into core pylab functions (figure, show,
etc.) versus the convenience all-in-one namespace (mostly from numpy);
but we will take one step at a time.

Eric

>
> Gary R.
>
> Mark Bakker wrote:
>> Hello list -
>>
>> I am confused about the part of numpy that pylab imports.
>> Apparently, pylab imports 'zeros', but not the 'zeros' from numpy, as
it
>> returns integers by default, rather than floats.
>> The same holds for 'ones' and 'empty'.
>> Example:
>>  >>> from pylab import *
>>  >>> zeros(3)
>> array([0, 0, 0])
>>  >>> from numpy import *
>>  >>> zeros(3)
>> array([ 0.,  0.,  0.])
>>
>> Can this be fixed? Any explanation how this happens? Pylab just imports
>> part of numpy, doesn't it?
>>
>> Thanks,
>>
>> Mark
>
>
>
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib-users Digest, Vol 12, Issue 1

2007-05-03 Thread Mark Bakker

A quick fix (since you need an exam, I guess) would be to make the label
with the 'text' command and put it where you want it.
I am interested in an elegant fix,
Mark

On 5/2/07, [EMAIL PROTECTED]



Date: Wed, 2 May 2007 11:39:03 -0500
From: "Ryan Krauss" <[EMAIL PROTECTED]>
Subject: [Matplotlib-users] creating a blank graph with room for hand
written tick labels.
To: matplotlib-users 
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

I am writing a final exam and I want my students to sketch a graph of
something and label the plot themselves.  So, I need to create an axis
with x and y labels, but with no tick marks.  This I can do, but
creating blank tick marks seems to get rid of the space where the
students would write in their own tick marks.  Playing with
xtick.major.pad doesn't seem to help.  What should I be doing?  This
is my code:

figure(20)
clf()
xlim([0,0.1])
ylim([-10,10])
xlabel('Time (sec)')

yticks(arange(-10,11,2))#,['']*10)

ylabel(r'$v_{out}(t)$')
grid(True)
fname='blank_time_plot.eps'
outdir='figs'

ylim([-5,5])
yticks(arange(-5,5.2),['']*10)
xticks(arange(1,10),['']*10)

and the result is attached (png).

Thanks,

Ryan
-- next part --
A non-text attachment was scrubbed...
Name: blank.png
Type: image/png
Size: 19059 bytes
Desc: not available

--

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


End of Matplotlib-users Digest, Vol 12, Issue 1
***

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] use of enthought Python for matplotlib/numpy

2007-05-10 Thread Mark Bakker

I noticed on your Web Lab website that you suggest to download the Enthouhht
edition. Although I suggest that to my students for class as well, we are
currently running into some problems as the latest Enthought edition still
includes an old numpy (version less than 1.0). Some important changes were
made just before the 1.0 release, so please be aware of that.

Now that we are on the topic, does anybody have good enough connections with
Enthought to convince them to update the distribution? I can toss-in a box
of donuts if that would help,

Mark
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use of enthought Python for matplotlib/numpy

2007-05-11 Thread Mark Bakker

I use Python/numpy/mpl/scipy to teach Computational methods for scientists
and engineers. Yeah, a mouthfull, but that's what it is.
We mainly solve problems of heat flow, groundwater flow, and diffusion-type
equations in the class. Both fun analytic solutions and finite difference
solutions. So the inclusion of contouring in mpl a while back was a big
break-through for us. And it works very nicely.
I have had no problems with the sourceforge mailing list, but I am not very
keen on how it handles threads. That could be much better, but it works ok
right now,
Mark

On 5/10/07, Yusdi Santoso <[EMAIL PROTECTED]> wrote:


Steve: Thanks for the link to the Portable SciPy. That opens up a lot of
new
ideas :)

Mark: Thanks for the info. I am not a very regular Enthoughy user so I am
not aware of that fact. Just out of curiosity, what kind of class are you
teaching? Programming or maths? I will be very interested if you could
tell
me about how Python/matplotlib/numpy are used in real life class
situation..perhaps I could glean some inspiration for WebLab.

Btw, has there been any problem with the sourceforge mailing list in the
last week or two?

Thanks,


Yusdi

_
Like the way Microsoft Office Outlook works? You'll love Windows Live
Hotmail.

http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_outlook_0507


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] All-in-one distribution of python/numpy/scipy/mpl for windows

2007-05-14 Thread Mark Bakker

Thanks for the pointer to the new egg installer of Enthought.
Nice app, which I will use.

But this is, IMHO, not what we need to move the python/numpy/scipy/mpl combo
into the more mainstream use.
Many potential users won't know what to do with the long list of packages
that they have never heard of.
I think it would be very useful to have one installer that gets a reasonable
distrubtion installed (like the old Enthought installer).
Isn't something like that in the works for the Mac?
We can even make a python/numpy/scipy/mpl and then a seperate one that also
includes ipython and wxpython, for example.

Or maybe a webpage where you can just select what eggs to install.
Would that be doable?
Anybody else think this is what we need?

Mark



Date: Fri, 11 May 2007 11:17:47 -0500

From: Robert Kern <[EMAIL PROTECTED]>
Subject: Re: [Matplotlib-users] use of enthought Python for
matplotlib/numpy
To: matplotlib-users@lists.sourceforge.net
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8

Giorgio Luciano wrote:
> I would add one box of donuts, since I'm trying to make my own
> distribution with numpy/scipy/matplotlib but with no success.
> and the problem is the same is for a classroom ;) If anyone knows also a
> portable distribution with this package I will add extra donuts ;)

While we at Enthought are not updating the all-in-one installer anymore,
we are
distributing up-to-date binaries as eggs.

  http://code.enthought.com/enstaller/

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma
that is made terrible by our own mad attempt to interpret it as though it
had
an underlying truth."
  -- Umberto Eco




--

Message: 8
Date: Fri, 11 May 2007 11:48:59 -0500
From: "John Hunter" <[EMAIL PROTECTED]>
Subject: Re: [Matplotlib-users] matplolib equivalent of gnuplot's
impulse
To: Emmanuel <[EMAIL PROTECTED]>
Cc: matplotlib-users@lists.sourceforge.net
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 5/3/07, Emmanuel <[EMAIL PROTECTED]> wrote:
> With gnuplot one can do a plot like that :
>
> http://www.deqnotes.net/gnuplot/images/impulses.png
>
> It is using option "with impulse".
>  Is there an equivalent in matplotlib?


In [5]: t = arange(0.0, 2.0, 0.05)

In [6]: s = sin(2*pi*t)

In [7]: vlines(t, 0, s)
Out[7]: 
Subject: Re: [Matplotlib-users] matplolib equivalent of gnuplot's
impulse
To: "John Hunter" <[EMAIL PROTECTED]>
Cc: Emmanuel <[EMAIL PROTECTED]>,
matplotlib-users@lists.sourceforge.net
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

2007/5/11, John Hunter <[EMAIL PROTECTED]>:
> On 5/3/07, Emmanuel <[EMAIL PROTECTED]> wrote:
> > With gnuplot one can do a plot like that :
> >
> > http://www.deqnotes.net/gnuplot/images/impulses.png
> >
> > It is using option "with impulse".
> >  Is there an equivalent in matplotlib?
>
>
> In [5]: t = arange(0.0, 2.0, 0.05)
>
> In [6]: s = sin(2*pi*t)
>
> In [7]: vlines(t, 0, s)
> Out[7]: 
Content-Type: text/plain; charset=ascii

Thanks everybody for the explanation of svg in Gimp.  That makes
sense.  Is there any vector based program that does what Gimp does?

> Did you try eps rather than ps?
>
> Eric

Yes, I tried eps.  Word won't recognize that neither.

As to the EMF format, I downloaded the package and attempted to apply the
patch.   Failed - probably because it's intended for 0.85 only.  I am
running 0.90 of MPL.  Has anybody added EMF support to MPL 0.90successfully?

Regards,



--
John Henry





--

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


End of Matplotlib-users Digest, Vol 12, Issue 20


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to start IDLE with -n option????

2007-05-14 Thread Mark Bakker

Hello list -

I want to run mpl interactively from IDLE on Windows XP.
For that I need to use the '-n' option when starting IDLE.

However, in the recent version of Python, when I select the IDLE icon and
right click to set the properties, the 'target' is now grey and cannot be
edited.
In the past I could edit the target and add the '-n' option.
Not anymore.

Any ideas how to change this?

Thanks,

Mark
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problem with FancyArrow overhang

2007-05-14 Thread Mark Bakker

Hello list -

I am trying to use FancyArrow to draw an arrow with given length.
The length I use is from 0 to 100.
I specify length_includes_head=True.
This works fine when I specify a width and length.
But when I specify an overhang, the length of the arrow becomes much longer
than 100.
Am I using overhang incorrectly?
Here's a script with the problem:

from pylab import *
from matplotlib.patches import FancyArrow
axis([0,120,0,100])
ax = gca()
a = FancyArrow( 0, 40, 100, 0, length_includes_head=True, head_width=5,
head_length=5)
ax.add_patch(a)
b = FancyArrow( 0, 60, 100, 0, length_includes_head=True, head_width=5,
head_length=5, overhang=5)
ax.add_patch(b)
draw_if_interactive()

Thanks, Mark
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] simple question: how to set the gap between label and axis

2007-05-15 Thread Mark Bakker

Sorry to bother you guys, but I cannot figure out how to set the gap between
the axis label and the axis.
I know it can be done.
Thanks,
Mark
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Prompt in MPL

2007-06-05 Thread Mark Bakker

I think a prompt could be very useful in MPL, just to build small little
GUI's that only need 1 or 2 boxes.
I also realize it is not easy, and for bigger jobs you want a full GUI
environment like wx or Tk anyway, so I understand it when developers set
other priorities.
Then again, I would really use it,
Mark


From: Matthias Michler <[EMAIL PROTECTED]>


Hello everybody,

Now my question is: Could a prompt be a useful part of matplotlib?

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Prompt in MPL

2007-06-05 Thread Mark Bakker

I notice the alignment problem.
But it looks like you are close.
On my machine (win32), the 'enter' key didn't work either. It works like a
backspace. That sounds like what Matthias reported.
Mark

On 6/5/07, John Hunter <[EMAIL PROTECTED]> wrote:


On 6/5/07, John Hunter <[EMAIL PROTECTED]> wrote:

> I worked on this some time ago, I never got to the point where I
> thought it was ready for production but it is  close.  There is a
> problem if usetex is enabled, because partial tex strings will cause
> errors.  But you can use it with regular text or plain text.

Typo: "plain text" was meant to be "math text"

Now I remember what really bothered me about this widget, and it
wasn't just the usetex problem.  The problem is that mpl has three
different vertical alignment methods for text: top, bottom and center.
None of them are right for a text box: you want baseline.  Try typing
"thinking" into the text box and watch what happens when you add and
remove the "g".  We do need to support baseline alignment for text, so
if someone has an interest in adding this it would be a very useful
feature, not just for a text box for for text alignment (eg tick
labels) in general.

See the image of the "g" at
http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-3.html
for a visual representation -- hwat I am calling the "baseline" they
refer to as the "origin" in that graph.  Our default alignment should
be "origin" or "baseline" but we don't have support for that.

JDH

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   >