Re: [matplotlib-devel] is R wrong? (boxplot)

2014-02-15 Thread Thomas A Caswell
As a side note, adding jitter has been discussed before
(https://github.com/matplotlib/matplotlib/issues/2750) in a slightly
different context and the consensus was to _not_ add it to mpl (as it
is a non-deterministic data transformation).

Tom

On Sat, Feb 15, 2014 at 10:45 PM, Yaroslav Halchenko s...@onerussian.com 
wrote:

 On Sat, 15 Feb 2014, Paul Hobson wrote:
Those figures look great. Seaborn has some similar functionality (scroll
down a bit):

 [1]http://nbviewer.ipython.org/github/mwaskom/seaborn/blob/master/examples/plotting_distributions.ipynb#Comparing-distributions:-boxplot-and-violinplot

 right -- seaborn looks really nice and I am yet to take advantage of it.

 BUT that is why we are talking here, at matplotlib list:  seaborn (and
 few others) while aiming to provide high level convenience, specific to
 e.g. using pandas as the core datastructures, add improvements which
 could easily go into stock matplotlib and thus benefit all of the users.
 That is why I thought that improving boxplot itself could be of
 more generic benefit, while allowing all the dependent projects take
 advantage of it without requiring unnecessary fragmentation (e.g. use
 seaborn for paired plots, which could easily go straight into stock
 boxplot operating on arrays).

 Even violin plots could probably could be done in matplotlib with
 some basic density estimator (with parameter for a custom one) as an
 option within boxplot function itself.

The main point of the most recent overhaul of boxplots was to allow users
to just what you describe. The methods plt.boxplot and ax.boxplot now do
very little on their own. Input data are passed to
matplotlib.cbook.boxplot_stats, that function returns a list of
dictionaries of statistics, and then ax.bxp actually does the drawing. All
of this is to say that you can write your own function to modify
boxplot_stats' output or generate independently the list of dictionaries
expected by ax.bxp.
The keys of those dictionaries can include:
 - label  - tick label for the boxplot
 - mean - mean value (can plot as a line or point)
 - median - 50th percentile
 - q1 - first quartile (25th pctl)
 - q3 - third quartile (75 (pctl)
 - cilo - lower notch around the median
 - ciho - upper notch around the median
 - whislo - end of the lower whisker
 - whishi - end of the upper whisker
 - fliers - outliers
Basically, you can set the appropriate values to whatever you want to draw
boxplots however you wish (like open/close diagrams for pandas).
Also, the `whis` kwarg accepted by boxplot and cbook.boxplot_stats can
either be a float (1.5 by default), a list of integer percentiles (like 5,
95), or the strings 'range', 'limits', or 'min/max', all of which will
extend the whiskers to over all of the data.
Since you're running off of master, you should access to this new
functionality.

 ;-) usually I run off the releases and even more often from releases in
 Debian stable.  But yes -- I have the master and this new functionality
 looks neat -- thanks again.  But those few enhancements, such as

 - plot actual datapoints with the jitter
 - plot pairing lines across boxplots

 seems to be not there and I would consider them worthwhile enhancement

Feel free to hit me up with any other questions!

 sorry that I have hit with not really a question above ;-)
 --
 Yaroslav O. Halchenko, Ph.D.
 http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
 Senior Research Associate, Psychological and Brain Sciences Dept.
 Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
 Phone: +1 (603) 646-9834   Fax: +1 (603) 646-1419
 WWW:   http://www.linkedin.com/in/yarik

 --
 Android apps run on BlackBerry 10
 Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
 Now with support for Jelly Bean, Bluetooth, Mapview and more.
 Get your Android app in front of a whole new audience.  Start now.
 http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel



-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204

--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib

Re: [matplotlib-devel] MEP22 doc

2014-01-27 Thread Thomas A Caswell
I left some comments on the wiki (in []).  Not sure what the best way
to leave comments is.

On Mon, Jan 27, 2014 at 5:04 PM, Federico Ariza
ariza.feder...@gmail.com wrote:
 Hello everybody

 I just added  click_tool to simulate a click programatically.
 https://github.com/matplotlib/matplotlib/pull/2759

 Is there anything missing or that you want to change?
 I'm saturated so I don't see anything anymore.

 I would like to have some input specially in the `ToolbarBase` class.
 I am ready to start the implementation on the other backends, and this
 is the new class that have to be implemented for all the backends.
 `Navigation` is mostly copy paste from existing toolbar

 Thanks
 Federico

 On Mon, Jan 27, 2014 at 11:07 AM, Phil Elson pelson@gmail.com wrote:
 Hi Federico,

 I just wanted to say that I've been a little busy lately, but your MEP is
 really shaping up - I really like the concepts that are being proposed and
 think it will make a huge difference to people who want to implement custom
 UIs.

 Keep up the great work, and continue trying to get feedback from all of us
 on this!

 Thanks,

 Phil


 On 24 January 2014 18:43, Federico Ariza ariza.feder...@gmail.com wrote:

 Hello everybody

 I just added some documentation for the MEP22 new classes and methods.
 Please take a look https://github.com/matplotlib/matplotlib/pull/2759

 I ran into some problems, when trying to decide if some methods where
 public or not.

 If the method was used only for backend implementation pourposes I put
 it as private (name starts with underscore) but still documented them
 in the Notes section of the class.
 I don't know if this is the correct way to do it, but I couldn't decide.
 If you prefer any other way to do it, please let me know.

 Thank you
 Federico


 --
 Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

 -- Antonio Alducin --


 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel





 --
 Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

 -- Antonio Alducin --

 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.
 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel



-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Strange Error on Travis 2.6 build (can't find cbook)

2013-12-02 Thread Thomas A Caswell
That tends to mean you have something that fails to import (raises an
exception on import that get silently suppressed) so I would guess
something in there is non 2.6 compatible, but don't know enough to
tell you what.

On Mon, Dec 2, 2013 at 1:00 PM, Paul Hobson pmhob...@gmail.com wrote:
 Hey folks,

 I've got a branch going to refactor the boxplot function and address several
 issues that have cropped up lately.

 Currently, everything on my feature branch is working well except for
 Travis' Python 2.6 build.

 Here's a link directly the error on the build:
 https://travis-ci.org/phobson/matplotlib/jobs/14820842#L9502

 And here's a link to my current branch (still a work-in-progress)
 https://github.com/phobson/matplotlib/compare/wip2-boxplot-refactor

 Thanks,
 -paul



 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics
 Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] matplotlib Hangout today at 14:00 UTC (10:00am ET)

2013-10-25 Thread Thomas A Caswell
There needs to be layers to the interface.  At the bottom there is super
general stuff that will cover (we hope) 100% of use cases.  However, the
cost is a very verbose interface with lots of knobs.  To cope with this
there are higher level function which can deal with 90% of the use cases
and do so by hiding some of the knobs (compare making a 3x3 grid
`subplots(3, 3)` with using  `GridSpec` to figuring out where the axes
edges should go and using `add_subplot([t, l, w, h])` ).  I want to make an
analogy to projecting from a higher dimensional parameter space to a lower
one.

The 'proper' api to use is the simplest one that achieves your goal.  If
you just need a grid of evenly spaced equal size axes use `subplots`, if
you need a grid but with some axes that span columns/rows use `GridSpec`,
if you need 5 axes that partially overlap in the shape of your school logo,
use `add_subplot`.

The point of the high-level APIs is to be easy to use.  If that means
matching the MATLAB api to make it easier for people to switch, then fine.
 I am sympathetic to the notion that the state-machine interface is
confusing (because it maintains hidden state), but it is in fact very
convenient.


On Fri, Oct 25, 2013 at 10:26 AM, Daniele Nicolodi dani...@grinta.netwrote:

 On 25/10/2013 15:34, Benjamin Root wrote:

  This has already been done. We have the GridSpec API that everything
  else maps to, for compatibility. But most people still like
  add_subplot() and subplots() for some odd reason... I think the primary
  issue is one of documentation, and we are currently in the process of
  upgrading that. We always welcome contributions to that effort!

 Hello Benjamin,

 thanks for your comments.  I'm aware of the solutions you propose, but I
 maintain that the status quo is confusing for new users.

 The fact that there are multiple ways of doing the same thing, through
 apparently unrelated interfaces makes the API more difficult to learn
 and less discoverable that it needs to be.  This is probably a
 conseqence of the organic growth of the library with time.

 I agree that the primary issue is the documentation, but at the root of
 that I also feel there is the lack of well established best practices
 for the use of Matplotlib. For example you write that people still like
 add_subplot() and subplots() for odd reasons, which are the methods
 others in the lists pointed to. What would be the proper API to use in
 your opinion?  I believe convergence on best practices is paramount to
 the update of the documentation.

 I also don't really buy the argument that it is desirable to keep and
 promote APIs that try to emulate the Matlab interface.  Matplotlib is
 different enough to make a 1:1 translation difficult and the Matlab
 design is anyhow broken, IMHO.

 Best,
 Daniele

 PS: with a new job also came the possibility to finally drop Matlab and
 embrace Python as the main data analysis tool. This means that I can
 dedicate some (at the moment very few) spare cycles to contribute to
 Matplotlib. I would be happy to do so!



 --
 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=60135991iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204
--
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=60135991iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Gtk3 app that calls matplotlib

2013-10-11 Thread Thomas A Caswell
If you are embedding matplotlib, do not import `pyplot`.  `pyplot` sets up
a bunch of gui-magic (tm) in the background (as you found in
`figure_manager`).

Tom


On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza
ariza.feder...@gmail.comwrote:

 Hello everybody

 Working on one GTK3 app, that calls matplotlib to plot some figures, I
 found that closing all the figures from matplotlib kills my app also.
 The problem

 Gtk.main() is called only if there is no previous invocation, in my
 case, my Gtk3 app invokes main, so the mainloop won't call it again.

 #in backend_gtk3.py
 #
 class Show(ShowBase):
 def mainloop(self):
 if Gtk.main_level() == 0:
 Gtk.main()

 But in the destroy method of the figure manager calls Gtk.main_quit
 everytime that there are no more figures

 #in backend_gtk3.py inside destroy method of FigureManagerGTK3
 #
 if Gcf.get_num_fig_managers()==0 and \
not matplotlib.is_interactive() and \
Gtk.main_level() = 1:
 Gtk.main_quit()


 So basically we are not calling Gtk.main but we are Gtk.calling main_quit.
 Isn't it more natural to call Gtk.main the same amount of times that
 we are going to call Gtk.main_quit?

 Adding matplotlib.rcParams['interactive'] = True doesn't help

 Here is my little testing code

 ##
 #file myapp.py

 import matplotlib
 matplotlib.rcParams['interactive'] = True
 matplotlib.use('GTK3AGG')
 import matplotlib.pyplot as plt

 from gi.repository import Gtk

 class MyWindow(Gtk.Window):

 def __init__(self):
 Gtk.Window.__init__(self, title=Hello World)

 self.button = Gtk.Button(label=Click Here)
 self.button.connect(clicked, self.on_button_clicked)
 self.add(self.button)

 def on_button_clicked(self, widget):
 fig = plt.figure()
 ax = fig.add_subplot(111)
 ax.plot([1,2,3])
 plt.show()

 win = MyWindow()
 win.connect(delete-event, Gtk.main_quit)
 win.show_all()
 Gtk.main()
 #

 I know this is related to interactive mode, but running from console
  python myapp.py
 reproduces the problem

 Why hasattr(sys, 'ps1') is False? if I am running it from console? how
 do I change this?


 Thanks
 Federico

 P.S. Does anybody had the time to check my PR for multi-figure-manager?
 https://github.com/matplotlib/matplotlib/pull/2465

 --
 Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

 -- Antonio Alducin --


 --
 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=60134071iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204
--
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=60134071iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Gtk3 app that calls matplotlib

2013-10-11 Thread Thomas A Caswell
embedding vs launching is a distinction without a difference, you are
integrating matplotlib with your own gui application.

That said, it would be nice to re-factor the figure_manager classes so they
they make no reference to `Gcf` or anything associated with pylab and could
be easily re-used.

I think that would also help with the issues in
https://github.com/matplotlib/matplotlib/pull/2503

Tom


On Fri, Oct 11, 2013 at 12:14 PM, Federico Ariza
ariza.feder...@gmail.comwrote:

 Again

 In the example the plotting is inside the callback (just for
 simplicity), but in reality, the plotting is in another class,
 somewhere else that can be called standalone to produce the plots.

 Federico

 On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza
 ariza.feder...@gmail.com wrote:
  I am not embedding, just launching, as the example shows.
 
  Federico
 
  On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell tcasw...@uchicago.edu
 wrote:
  If you are embedding matplotlib, do not import `pyplot`.  `pyplot` sets
 up a
  bunch of gui-magic (tm) in the background (as you found in
  `figure_manager`).
 
  Tom
 
 
  On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza 
 ariza.feder...@gmail.com
  wrote:
 
  Hello everybody
 
  Working on one GTK3 app, that calls matplotlib to plot some figures, I
  found that closing all the figures from matplotlib kills my app also.
  The problem
 
  Gtk.main() is called only if there is no previous invocation, in my
  case, my Gtk3 app invokes main, so the mainloop won't call it again.
 
  #in backend_gtk3.py
  #
  class Show(ShowBase):
  def mainloop(self):
  if Gtk.main_level() == 0:
  Gtk.main()
 
  But in the destroy method of the figure manager calls Gtk.main_quit
  everytime that there are no more figures
 
  #in backend_gtk3.py inside destroy method of FigureManagerGTK3
  #
  if Gcf.get_num_fig_managers()==0 and \
 not matplotlib.is_interactive() and \
 Gtk.main_level() = 1:
  Gtk.main_quit()
 
 
  So basically we are not calling Gtk.main but we are Gtk.calling
 main_quit.
  Isn't it more natural to call Gtk.main the same amount of times that
  we are going to call Gtk.main_quit?
 
  Adding matplotlib.rcParams['interactive'] = True doesn't help
 
  Here is my little testing code
 
  ##
  #file myapp.py
 
  import matplotlib
  matplotlib.rcParams['interactive'] = True
  matplotlib.use('GTK3AGG')
  import matplotlib.pyplot as plt
 
  from gi.repository import Gtk
 
  class MyWindow(Gtk.Window):
 
  def __init__(self):
  Gtk.Window.__init__(self, title=Hello World)
 
  self.button = Gtk.Button(label=Click Here)
  self.button.connect(clicked, self.on_button_clicked)
  self.add(self.button)
 
  def on_button_clicked(self, widget):
  fig = plt.figure()
  ax = fig.add_subplot(111)
  ax.plot([1,2,3])
  plt.show()
 
  win = MyWindow()
  win.connect(delete-event, Gtk.main_quit)
  win.show_all()
  Gtk.main()
  #
 
  I know this is related to interactive mode, but running from console
   python myapp.py
  reproduces the problem
 
  Why hasattr(sys, 'ps1') is False? if I am running it from console? how
  do I change this?
 
 
  Thanks
  Federico
 
  P.S. Does anybody had the time to check my PR for multi-figure-manager?
  https://github.com/matplotlib/matplotlib/pull/2465
 
  --
  Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?
 
  -- Antonio Alducin --
 
 
 
 --
  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=60134071iu=/4140/ostg.clktrk
  ___
  Matplotlib-devel mailing list
  Matplotlib-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
 
 
 
 
  --
  Thomas A Caswell
  PhD Candidate University of Chicago
  Nagel and Gardel labs
  tcasw...@uchicago.edu
  jfi.uchicago.edu/~tcaswell
  o: 773.702.7204
 
 
 
  --
  Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?
 
  -- Antonio Alducin --



 --
 Y yo que culpa tengo de que ellas se crean todo lo que yo les digo?

 -- Antonio Alducin --




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204
--
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

Re: [matplotlib-devel] Gtk3 app that calls matplotlib

2013-10-11 Thread Thomas A Caswell
Please keep all emails in-band

I was commenting that the issue you are having with getting easy-to-use
pre-built figures in a non-interactive program without dragging pyplot in
is the same as what I think the root of 2503 is and the re-factor I
proposed to make your life easier would also help that case (I think).

The gui backends were (as I understand it, someone please correct me if I
am wrong) built to play nice with ipython to put together a MATLAB-like
interface.  The fact that you can then embed the gui-framework dependent
bits of matplotlib in other gui applications is a nice side-effect, but not
one of the initial design goals.  This is why the `figure_manager` code is
(too-)tightly coupled to _pylab_helpers.

See the examples at http://matplotlib.org/examples/user_interfaces/  making
a window with a canvas + tool bar is pretty easy.

A quick and dirty solution might be to just monkey patch the
figure_manager.destroy function when your app starts up to remove the check
that shuts down the main loop.

Tom


On Fri, Oct 11, 2013 at 1:40 PM, Federico Ariza ariza.feder...@gmail.comwrote:

 Sorry I don't get it.
 Are you suggesting to explain this little predicament in the PR to
 give another point of view? or
 You want me to check the PR and try to use the solutions proposed there?

 Federico

 On Fri, Oct 11, 2013 at 1:32 PM, Thomas A Caswell tcasw...@uchicago.edu
 wrote:
  embedding vs launching is a distinction without a difference, you are
  integrating matplotlib with your own gui application.
 
  That said, it would be nice to re-factor the figure_manager classes so
 they
  they make no reference to `Gcf` or anything associated with pylab and
 could
  be easily re-used.
 
  I think that would also help with the issues in
  https://github.com/matplotlib/matplotlib/pull/2503
 
  Tom
 
 
  On Fri, Oct 11, 2013 at 12:14 PM, Federico Ariza 
 ariza.feder...@gmail.com
  wrote:
 
  Again
 
  In the example the plotting is inside the callback (just for
  simplicity), but in reality, the plotting is in another class,
  somewhere else that can be called standalone to produce the plots.
 
  Federico
 
  On Fri, Oct 11, 2013 at 1:12 PM, Federico Ariza
  ariza.feder...@gmail.com wrote:
   I am not embedding, just launching, as the example shows.
  
   Federico
  
   On Fri, Oct 11, 2013 at 1:11 PM, Thomas A Caswell
   tcasw...@uchicago.edu wrote:
   If you are embedding matplotlib, do not import `pyplot`.  `pyplot`
 sets
   up a
   bunch of gui-magic (tm) in the background (as you found in
   `figure_manager`).
  
   Tom
  
  
   On Fri, Oct 11, 2013 at 11:57 AM, Federico Ariza
   ariza.feder...@gmail.com
   wrote:
  
   Hello everybody
  
   Working on one GTK3 app, that calls matplotlib to plot some
 figures, I
   found that closing all the figures from matplotlib kills my app
 also.
   The problem
  
   Gtk.main() is called only if there is no previous invocation, in my
   case, my Gtk3 app invokes main, so the mainloop won't call it again.
  
   #in backend_gtk3.py
   #
   class Show(ShowBase):
   def mainloop(self):
   if Gtk.main_level() == 0:
   Gtk.main()
  
   But in the destroy method of the figure manager calls
 Gtk.main_quit
   everytime that there are no more figures
  
   #in backend_gtk3.py inside destroy method of FigureManagerGTK3
   #
   if Gcf.get_num_fig_managers()==0 and \
  not matplotlib.is_interactive() and \
  Gtk.main_level() = 1:
   Gtk.main_quit()
  
  
   So basically we are not calling Gtk.main but we are Gtk.calling
   main_quit.
   Isn't it more natural to call Gtk.main the same amount of times that
   we are going to call Gtk.main_quit?
  
   Adding matplotlib.rcParams['interactive'] = True doesn't help
  
   Here is my little testing code
  
   ##
   #file myapp.py
  
   import matplotlib
   matplotlib.rcParams['interactive'] = True
   matplotlib.use('GTK3AGG')
   import matplotlib.pyplot as plt
  
   from gi.repository import Gtk
  
   class MyWindow(Gtk.Window):
  
   def __init__(self):
   Gtk.Window.__init__(self, title=Hello World)
  
   self.button = Gtk.Button(label=Click Here)
   self.button.connect(clicked, self.on_button_clicked)
   self.add(self.button)
  
   def on_button_clicked(self, widget):
   fig = plt.figure()
   ax = fig.add_subplot(111)
   ax.plot([1,2,3])
   plt.show()
  
   win = MyWindow()
   win.connect(delete-event, Gtk.main_quit)
   win.show_all()
   Gtk.main()
   #
  
   I know this is related to interactive mode, but running from console
python myapp.py
   reproduces the problem
  
   Why hasattr(sys, 'ps1') is False? if I am running it from console?
 how
   do I change this?
  
  
   Thanks
   Federico
  
   P.S. Does anybody had the time to check my PR for
   multi-figure-manager?
   https://github.com/matplotlib/matplotlib/pull/2465
  
   --
   Y

Re: [matplotlib-devel] Odd install error

2013-09-20 Thread Thomas A Caswell
This thread from h5py may be relevant (https://github.com/h5py/h5py/pull/356).


Tom


On Fri, Sep 20, 2013 at 9:41 AM, Benjamin Root ben.r...@ou.edu wrote:

 There is setup_requires, and from the documentation that I see, I wonder
 if listing NumPy in both build_requires and install_requires invokes a
 special handling to install setup requirements in the same place as install
 requirements?

 Ben




 --
 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=58041151iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204
--
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=58041151iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Bug in 1.3.0: AttributeError: 'NavigationToolbar2TkAgg' object has no attribute 'draw_idle'

2013-09-17 Thread Thomas A Caswell
This is addressed on the master branch via #2319, but the commit where the
problem was introduced is not included in 1.3.0, so I am not sure what is
going on.

Although, it does look like the fix should be cherry picked to the 1.3.x
branch.


On Tue, Sep 17, 2013 at 7:02 AM, Lorenzo Di Gregorio 
lorenzo.digrego...@gmail.com wrote:

 Hi,

 I've just installed matplotlib 1.3.0 and run into the following error when
 using the home button of a figure():

 Exception in Tkinter callback
 Traceback (most recent call last):
   File C:\Python27\lib\lib-tk\Tkinter.py, line 1410, in __call__
 return self.func(*args)
   File C:\Python27\lib\site-packages\matplotlib\backend_bases.py, line
 2745, in home
 self._update_view()
   File C:\Python27\lib\site-packages\matplotlib\backend_bases.py, line
 3149, in _update_view
 self.draw_idle()
 AttributeError: 'NavigationToolbar2TkAgg' object has no attribute
 'draw_idle'

 In fact NavigationToolbar2, inherited by NavigationToolbas2TkAgg, calls
 draw_idle(), in the update() method, but the definition of draw_idle() is
 missing, so this seems to be a bug.

 Best Regards,
 Lorenzo


 --
 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=58041151iu=/4140/ostg.clktrk
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204
--
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=58041151iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Reorganizing axes plot methods

2013-07-09 Thread Thomas A Caswell
@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204
--
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=48808831iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] SciPy 2013

2013-03-25 Thread Thomas A Caswell
I think there is something to be said for not starting from pylab.
Answering questions on SO, a good chunk of them (by volume) can be
traced back to not understanding the magic that pylab is doing for you
in the background or not even knowing magic is being done for you.
Starting from pylab makes easy stuff trivial, but slightly more
complicated things a much bigger lift to figure out how to do (as
compared to the conceptual difference in how hard they are).

A tutorial that starts from the POV of building the figure out of
parts sounds like a good idea to me.   At a minimum, a key with the
different parts of the figure labeled with what family of classes
control them would be great (or if something like that already exists
make it easier to find;))

Tom

On Mon, Mar 25, 2013 at 12:03 PM, Benjamin Root ben.r...@ou.edu wrote:

 On Mon, Mar 25, 2013 at 12:46 PM, Phil Elson pelson@gmail.com wrote:

 I am putting together a beginners tutorial proposal that I will submit
  soon

 That's great to hear! Are you planning on making the tutorial material
 part of mpl's docs or using the content that is already out there?



 It is all new stuff, but I have been taking inspirations from other
 tutorials I have seen and said to myself You are all teaching it wrong!
 :-P

 I am ignoring pylab (risky, I know), starting with a *very* basic NumPy
 primer, and then moving on to teach matplotlib from the perspective of here
 are what the parts of a plot are called and what they are for, and see what
 happens when we put those parts together.  It is an ingredients approach,
 essentially.

 Hopefully, aspects of it will be useful for the docs when it is finished.  I
 am also hoping that having a ipython notebook version of it will help others
 to improve it for future conferences (there should always be an intro to
 matplotlib tutorial at SciPy).

 Ben Root


 --
 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_mar
 ___
 Matplotlib-devel mailing list
 Matplotlib-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel




-- 
Thomas A Caswell
PhD Candidate University of Chicago
Nagel and Gardel labs
tcasw...@uchicago.edu
jfi.uchicago.edu/~tcaswell
o: 773.702.7204

--
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_mar
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel