[Matplotlib-users] Picking after a subplot geometry change

2011-09-23 Thread Søren Nielsen
Hi,

I have a canvas with two subplots on it and the user can pick curves on each
subplot (all lines are pickable). I have created the ability to hide one
subplot and only show one of the two. The remaining subplot is also enlarged
to fit the canvas. This is done using:

self.subplot1.set_visible(True)
self.subplot2.set_visible(False)

self.subplot1.change_geometry(1,1,1)
self.canvas.draw()

However, when I do that, its only possible to pick curves in the area where
the original subplot was located.. like it hasn't updated the geometry for
picking feature.

Is there a way for me to do this?

Thanks,
Soren
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error when plotting negative values on log scale

2011-03-11 Thread Søren Nielsen
Thanks for info Goyo and Ben!



2011/3/11 Benjamin Root ben.r...@ou.edu



 2011/3/10 Søren Nielsen soren.skou.niel...@gmail.com

 Hi,


 When I do an errorbar plot (a.errorbar(), a = axis) with negative values
 and then try to change the yscale to log (a.set_yscale('log')) matplotlib
 crashes with:

 Traceback (most recent call last):
   File
 /usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py, line
 14636, in lambda
 lambda event: event.callable(*event.args, **event.kw) )
   File /home/specuser/new_workspace/TestDriven/src/RAWPlot.py, line 371,
 in plotSASM
 line, ec, el = a.errorbar(sasm.q[q_min:q_max], sasm.i[q_min:q_max],
 sasm.err[q_min:q_max], picker = 3, label = legend_label, **kwargs)
   File /usr/lib64/python2.6/site-packages/matplotlib/axes.py, line 4872,
 in errorbar
 barcols.append( self.vlines(x, lower, upper, **lines_kw) )
   File /usr/lib64/python2.6/site-packages/matplotlib/axes.py, line 3302,
 in vlines
 self.autoscale_view()
   File /usr/lib64/python2.6/site-packages/matplotlib/axes.py, line 1627,
 in autoscale_view
 YL = self.yaxis.get_major_locator().view_limits(y0, y1)
   File /usr/lib64/python2.6/site-packages/matplotlib/ticker.py, line
 1119, in view_limits
 if not is_decade(vmin,self._base): vmin = decade_down(vmin,self._base)
   File /usr/lib64/python2.6/site-packages/matplotlib/ticker.py, line
 1030, in is_decade
 return lx==int(lx)
 OverflowError: cannot convert float infinity to integer
 Traceback (most recent call last):
   File
 /usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py, line
 14636, in lambda
 lambda event: event.callable(*event.args, **event.kw) )
   File /home/specuser/new_workspace/TestDriven/src/RAW.py, line 1953, in
 addItem
 newItem = ManipItemPanel(self.underpanel, sasm, font_colour =
 item_colour)
   File /home/specuser/new_workspace/TestDriven/src/RAW.py, line 2353, in
 __init__
 color = conv.to_rgb(self.sasm.line.get_mfc())
 AttributeError: 'NoneType' object has no attribute 'get_mfc'

 I don't think this should be the expected outcome.. rather it should not
 plot values that are illegal/negative (i.e. ignore them).

 Is there a way I can get around this without having to search through my
 data and remove points that are negative or NaN or INF when the yscale needs
 to be log? That would also show an incorrect curve since a line would be
 drawn across the points that were removed.. It should rather be gaps in the
 line.

 Thanks,
 Soren




 Soren,

 This is a bug I encountered recently in my investigations with log scales.
 While most projections are handling this properly, there are some cases
 where this problem sneaks in.  I have not been able to figure out how to
 permanently address this issue.

 For reference, the similiar issue is when zooming in on polar plots with
 the radial axis in log scale.

 Ben Root


--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Error when plotting negative values on log scale

2011-03-10 Thread Søren Nielsen
Hi,

When I do an errorbar plot (a.errorbar(), a = axis) with negative values and
then try to change the yscale to log (a.set_yscale('log')) matplotlib
crashes with:

Traceback (most recent call last):
  File /usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py,
line 14636, in lambda
lambda event: event.callable(*event.args, **event.kw) )
  File /home/specuser/new_workspace/TestDriven/src/RAWPlot.py, line 371,
in plotSASM
line, ec, el = a.errorbar(sasm.q[q_min:q_max], sasm.i[q_min:q_max],
sasm.err[q_min:q_max], picker = 3, label = legend_label, **kwargs)
  File /usr/lib64/python2.6/site-packages/matplotlib/axes.py, line 4872,
in errorbar
barcols.append( self.vlines(x, lower, upper, **lines_kw) )
  File /usr/lib64/python2.6/site-packages/matplotlib/axes.py, line 3302,
in vlines
self.autoscale_view()
  File /usr/lib64/python2.6/site-packages/matplotlib/axes.py, line 1627,
in autoscale_view
YL = self.yaxis.get_major_locator().view_limits(y0, y1)
  File /usr/lib64/python2.6/site-packages/matplotlib/ticker.py, line 1119,
in view_limits
if not is_decade(vmin,self._base): vmin = decade_down(vmin,self._base)
  File /usr/lib64/python2.6/site-packages/matplotlib/ticker.py, line 1030,
in is_decade
return lx==int(lx)
OverflowError: cannot convert float infinity to integer
Traceback (most recent call last):
  File /usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py,
line 14636, in lambda
lambda event: event.callable(*event.args, **event.kw) )
  File /home/specuser/new_workspace/TestDriven/src/RAW.py, line 1953, in
addItem
newItem = ManipItemPanel(self.underpanel, sasm, font_colour =
item_colour)
  File /home/specuser/new_workspace/TestDriven/src/RAW.py, line 2353, in
__init__
color = conv.to_rgb(self.sasm.line.get_mfc())
AttributeError: 'NoneType' object has no attribute 'get_mfc'

I don't think this should be the expected outcome.. rather it should not
plot values that are illegal/negative (i.e. ignore them).

Is there a way I can get around this without having to search through my
data and remove points that are negative or NaN or INF when the yscale needs
to be log? That would also show an incorrect curve since a line would be
drawn across the points that were removed.. It should rather be gaps in the
line.

Thanks,
Soren
--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Updating tick labels on animated plot

2010-12-11 Thread Søren Nielsen
Hi,

I have an animated plot and I'm having trouble updating the tick labels
after I blit new data to the canvas. I've looked through the documentation
and it's not clear to me how I can update the x and y axis ticks during an
animation. Anyone here know how to do this?

Best,
Soren
--
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] ft2font error on OSX 10.6 using py2app

2010-07-20 Thread Søren Nielsen
Hi,

I'm creating a stand alone program on my mac with OSX 10.4 and it seems to
work great on it. However, if I transfer my program to a snow leopard (10.6)
mac, I get the error:

  File /Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/__boot__.py,
line 158, in module
   _run('RAW.py')
  File /Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/__boot__.py,
line 134, in _run
execfile(path, globals(), globals())
  File /Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/RAW.py, line
23, in module
from pylab import setp
  File pylab.pyc, line 1, in module
  File
/Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/lib/python2.6/matplotlib/pylab.py,
line 206, in module
from matplotlib import mpl  # pulls in most modules
  File
/Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/lib/python2.6/matplotlib/mpl.py,
line 2, in module
from matplotlib import axis
  File
/Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/lib/python2.6/matplotlib/axis.py,
line 10, in module
import matplotlib.font_manager as font_manager
  File
/Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/lib/python2.6/matplotlib/font_manager.py,
line 52, in module
from matplotlib import ft2font
ImportError
:
dlopen(/Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/lib/python2.6/matplotlib/ft2font.so,
2): Symbol not found: _FT_Load_Glyph
  Referenced from:
/Volumes/KINGSTON/Mac/RAW.app/Contents/Resources/lib/python2.6/matplotlib/ft2font.so
 Expected in: dynamic lookup

A search on it came up with someone having the same problem (
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg14252.html),
but the cause doesn't seem to be exactly the same since as my ft2font.so is
linked correctly against  /usr/lib/libgcc_s.1.dylib ?

heres the otool info:

/opt/local/lib/libfreetype.6.dylib (compatibility version 11.0.0, current
version 11.0.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current
version 1.2.4)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 7.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 88.3.3)

/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
(compatibility version 1.0.0, current version 18.0.0)

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
(compatibility version 1.0.0, current version 22.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version
47.1.0)

I installed all packages and python 2.6 using Macports.  Does anyone see the
problem here?

Soren
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Nasty mouse event problem with wxPython

2010-05-03 Thread Søren Nielsen
Hi,

I've hit a problem when using the button_press_event to pop up a
wx.MessageBox. After the messagebox is loaded the mouse becomes completely
unresponsive (even outside the application) until the application is shut
down (by using ALT+F4). I'm making a feature where the user, after right
clicking on the figure (after doing some manipulations etc), are requested
to answer a question in a message box.

This problem seems only to occur on Linux..

Am I doing something wrong or is this a bug?

I've attached the source that demonstrates the problem.

Thanks,
Soren


unresponsive.py
Description: Binary data
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Work directory is changed when saving a plot

2009-02-27 Thread Søren Nielsen
Hi,

When I save a plot using the toolbar save function, and I save to a
different directory than the one where my program is, my program can no
longer locate the icons (used in my GUI) that I am using in my .\ressources
directory. So saving the plot changed the working directory of my program?

How do I change it back? Isn't this an error in matplotlib?

Thanks
Soren
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Legend grows in wrong direction

2009-02-26 Thread Søren Nielsen
Hi,

I've tried placing a legend using the loc = (x,y) .. and the legend is moved
where I want it. the problem is, when I add new lines to the plot.. the
legend grows, but upwards.. so the lower left point of the legend box is
constant.. but that's not the logical way for a legend box to grow..
shouldn't it grow downwards, just like when I use the standard loc = 1
(upper right position) .

Is there a way to change this behaviour?
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Legend grows in wrong direction

2009-02-26 Thread Søren Nielsen
Thanks JJ!

It does, and you are exactly right, letting the legend grow downward while
holding the value of the lower left corner doesn't make sense.. I tried
calculating an offset, but the patch is a much nicer fix!

Soren

On Thu, Feb 26, 2009 at 9:27 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote:

 On Thu, Feb 26, 2009 at 4:51 AM, Søren Nielsen
 soren.skou.niel...@gmail.com wrote:
  I've tried placing a legend using the loc = (x,y) .. and the legend is
 moved
  where I want it. the problem is, when I add new lines to the plot.. the
  legend grows, but upwards.. so the lower left point of the legend box is
  constant.. but that's not the logical way for a legend box to grow..
  shouldn't it grow downwards, just like when I use the standard loc = 1
  (upper right position) .

 Well, technically, legend never grows. Whenever you call legend(), a
 new legend instance is created and the old one is just destroyed.
 Anyhow, as far as I can tell, the (x,y) coordinates given to the *loc*
 parameter has been the coordinate of the lower left corner of the
 legend (but I don't think this is clearly specified in the
 documentation). Therefore, I don't think it is a good idea to make the
 legend grow(?) downward while you're supplying a fixed coordinate of
 the lower left corner. This is hardly possible and it seems to make
 little sense to me.

 Anyhow, I just submitted a patch to the svn that add an optional
 *bbox_to_anchor* argument for the legend class. This lets you specify
 the bbox that the legend will be anchored (the default is the bbox of
 the parent).

 For example,

 legend(loc=upper left, bbox_to_anchor=[0.0, 0.5])

 will create an legend with its upper left corner at (0.0, 0.5), and it
 will grow downward. Note that when len(bbox_to_anchor)==2, a bbox with
 zero width and zero height is created.

 I hope this suits your need.

 -JJ


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Hiding a subplot

2008-11-20 Thread Søren Nielsen
Hi,

I have a canvas with two subplot.. I want to be able to hide on of the
subplots by pushing a button and letting the remaining subplot fill the
entire canvas.

If I use the set_visible(True) parameter I correctly remove one of the
subplots.. but the remaining subplot does not fill the canvas.. Anyone have
an idea of how to do this?

Thanks,
Soren
-
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=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Using pan tool on log-log plot is very slow

2008-11-18 Thread Søren Nielsen
Hi,

Has anyone else noticed that using the pan tool is very slow when the data
is plotted on a double log scale, or single log scale for that matter.. it's
smooth as silk when the plots are in lin-lin.

Is there a way to make it faster or is it a bug?

Regards,
Soren
-
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=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Bug? Legend includes bar and cap lines when using errorbar

2008-11-18 Thread Søren Nielsen
Hi,

It seems that the Legend command doesnt function properly when using
errorbar to plot. It includes extra lines for the errorbars themselves.

I found out this is an old problem that have been fixed before??

http://osdir.com/ml/python.matplotlib.devel/2006-05/msg00038.html


Regards,
Soren
-
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=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Masking with patches

2008-10-29 Thread Søren Nielsen
Hi,

I'm making a masking function that can mask out certain areas of an image
using different types of masks, and display them using patches. I want to
add a function where a user can move a mask that has already been created.

I can use the picker = True to have it return the patch being clicked on..
but how do I know which mask was clicked on if I have two identical masks?
or even worse, if I have two identical masks almost lying ontop of each
other.. returning both patches at the same time?? I've tried different
things using == to compare.. but that didn't work.. any suggestions??

Soren
-
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=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Possible to add errorbars to existing line2D plots?

2008-08-19 Thread Søren Nielsen
Is it possible to add errorbars to existing line2D plots? I'd like the user
to be able to enable/disable errorbars by pushing a button.

Cheers,
Soren
-
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=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Moving legend with mouse?

2008-08-01 Thread Søren Nielsen
I'm using matplotlib 0.98 together with wxpython 2.8.8.0. It would be nice
to be able to click on the legend and move it with the mouse. Is that
possible? Is there a simple way to do this? Has anyone tried this or can
someone point in the direction?

Thanks,
Soren
-
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=100url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Missing lines after a axes scale change

2008-07-10 Thread Søren Nielsen
Hi,

When I change the xscale and yscale my plots go missing... i use
axes.set_xscale('linear'), axes.set_yscale('liner)  or
axes.set_xscale('log'), axes.set_yscale('log') ... I have a button that
changes between those two.. but a change removes the 2D lines i have on
them... do I need to change something in the line objects too?

Regards,
Soren
-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Picker line selection after axes scale change.. possible bug?

2008-07-10 Thread Søren Nielsen
If I do some 2D line plots, I can activate the picker event on each line..
but if I change the scale of the axes using axes.set_xscale('log') /
axes.set_yscale('log') and then try to pick the lines, nothing happens. I
can't select them on the plot with the log scales, but if I click in the
area where they used to be on the linear scale the picker event is triggered
correctly...

I guess this is a bug?

Cheers,
Soren
-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Inserting slider in figure under wxpython

2008-05-14 Thread Søren Nielsen
Hi,

I'm trying to insert a slider into my figure like the on in the example
slider_demo.py.

from the slider_demo i have:

axcolor = 'lightgoldenrodyellow'
axfreq = axes([0.25, 0.1, 0.65, 0.03])
sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit = f0)

i have a figure with an axes where i displayed an image using imshow. Like:

a = self.fig.gca()
a.imshow(img)

I've tried different stuff, but i get an assertion error when I try:

self.fig.add_axes(axfreq)

Has anyone here tried doing the slider_demo under wxpython?

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


[Matplotlib-users] Disable zoom on toolbar

2008-05-13 Thread Søren Nielsen
Hi,

I want to be able to disable the zoom tool (when it has been selected) when
I press another button on the toolbar, and disable the same button when I
click the zoom tool... anyone know how to do this??

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


[Matplotlib-users] Easiest way of drawing a circle?

2008-05-08 Thread Søren Nielsen
Hi,

I'm using wxpython with matplotlib, I now have a figurecanvas embedded in my
program and I can plot stuff using:

a = self.fig.gca()
a.plot(x,y)

But what is the easiest and fastest way to draw a circle? I saw that the
artist class has a draw_arc function.. but I don't know how to use the
artist class with my figure canvas.. Like I can't do a.draw_arc() for
instance ...

Can anyone point me in the right direction?

Thanks,
Soren
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Possible to disable wxAgg's smoothing of an image?

2008-05-08 Thread Søren Nielsen
Hi,

I have a displayed an image with imshow() under wxPython, and it looks great
with the WxAgg figure canvas.. but sometimes I want to actually see pixels
when I zoom.. and not just a nice smoothed image. Is it possible to disable
the smoothing? The way it is now, I will never see square pixels no matter
how close i zoom in..

Also, if I want to use matplotlib.patches on a canvas where I can actually
see individual pixels, is it possible to only draw on the available pixels
showing, and not just make a nice high resolution line that is plotted on
top of my image?

Thanks,
Soren
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Possible to disable wxAgg's smoothing of an image?

2008-05-08 Thread Søren Nielsen
On Thu, May 8, 2008 at 3:52 PM, Michael Droettboom [EMAIL PROTECTED] wrote:

 You can pass an interpolation parameter to imshow, or set a default in
 image.interpolation in your matplotlibrc.  From the imshow docstring:

 * interpolation is one of:

   'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36',
   'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
   'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc',
   'lanczos', 'blackman'

   if interpolation is None, default to rc
   image.interpolation.  See also th the filternorm and
   filterrad parameters

 'nearest' is the one you want if you want to see sharp square pixels.


Thanks mike, thats exactly what I needed :)



 Søren Nielsen wrote:

 Also, if I want to use matplotlib.patches on a canvas where I can actually
 see individual pixels, is it possible to only draw on the available pixels
 showing, and not just make a nice high resolution line that is plotted on
 top of my image?

 I'm not sure I understand the question.  You mean to draw a line using
 large pixels, rather than as a vector?  I don't think there's an easy way on
 that one -- but maybe someone else here can think of a creative way to do
 it.


Yes you understod it correctly, I guess I could figure out what pixels are
involved in a line or a circle for instance, and then do a scatter plot on
those pixels to form the shape.. but it sounds really computationally
heavy.. and I need something that works fast, (the user should be able to
mask a circle in an image using the pixels available in the image) Also the
circle should be shown as it is created (like choosing a center and moving
the mouse enlarges the circle).

Maybe someone tried this? masking stuff in an image seems like a fairly
common thing :)

Thanks for the help!
Soren





 Cheers,
 Mike


 Thanks,
 Soren


 

 -
 This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't
 miss this year's exciting event. There's still time to save $100. Use
 priority code J8TL2D2.
 http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
 

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



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


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Possible to optimize canvas update speed?

2008-05-07 Thread Søren Nielsen
Hi,

I'm plotting lines on top of an image using the plot command, trying to make
polygons. I click one point on an image and another point, and a line is
drawn between them. I'm also showing a guide line, so that the user can see
the line before pressing the mouse button.. All i'm doing is taking the last
point that the user clicked on and plot a line between that point and the
current point under the mouse cursor. New chosen points are appended to
nPolygonPointsX and Y. This works ok, but it's a bit slow.

my update connected to the motion_notify_event looks like this:

--
def onCursorUpdate(self, event)

x, y = event.xdata, event.ydata

a = self.fig.gca()

if len(self.nPolygonPointsX = 1):
 guideLineX = [self.nPolygonPointsX[-1], x]
 guideLineY = [self.nPolygonPointsY[-1], y]

 # To avoid keeping guide lines when the cursor is moved:
 if len(a.lines)  1:
 del(a.lines[-1])

 # Plot the guide line and update
 a.plot(guideLineX, guideLineY)
 self.canvas.draw()

--

Btw i'm running matplotlib with wxpython. So is there a faster way to update
this line plot? ..

Thanks!
Soren
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Polygon masking possible?

2008-01-22 Thread Søren Nielsen
Hi,

I'm looking for a way to do masking of an Image.. I need to be able to make
a circle / box or a user made polygon on an image using the mouse and
retrieve the pixellocations of all pixels inside the masked area.. (which
will then be processed later) Has anyone tried this? What is the easiest way
to start? I'm using wxpython for the GUI.

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


[Matplotlib-users] possible to expand the current Colorcycle?

2007-12-05 Thread Søren Nielsen
Hi,

Is it possible to expand the colorcycle that matplotlib uses by default?

in axes.py, class _process_plot_var_args, def _clear_color_cycle(self) It
seems that self.colors are hardcoded to be self.colors =
['b','g','r','c','m','y','k'] ... is there a way to extend this? (Without
changing the matplotlib code directly) I want to be able to extend it by ex.
dashed lines or others.. i sometimes have a large number of plots to do, and
the 7 default plot colors are not enough...

I know I could manually make a handler in my program to handle the colors
when I plot... but it would seem nicer if I could just pass a list of plot
colors to matplotlib.

Regards,
Soren
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users