Re: [Matplotlib-users] Format date tick labels

2012-10-08 Thread Jianbao Tao
Thanks, Ben.

Your fix works when the view interval is greater than 1 minute, but not so
much when the view interval is less than one minute.

BTW, what I am trying to accomplish is to use matplotlib to plot
time-series data that can be as long as several days and as short as a few
milliseconds. So, do you think I am better off to handle the format
manually by myself instead of deriving the format from auto locator? I am
skeptical about the auto locator now because it doesn't seem to be designed
for intervals less than 1 second.

Cheers,
Jianbao

On Mon, Oct 8, 2012 at 6:16 AM, Benjamin Root ben.r...@ou.edu wrote:



 On Sun, Oct 7, 2012 at 6:47 PM, Jianbao Tao jianbao@gmail.com wrote:

 fig = figure()
 tsta = num2epoch(date2num(datetime.datetime.now()))
 tarr = tsta + arange(0, 60*60*0.5, 0.1)# half hour, dt =
 0.1 sec
 x = np.array(num2date(epoch2num(tarr)))
 nt = len(tarr)
 y = randn(nt)

 ax = fig.add_subplot(111)
 ax.plot(x, y)
 fig.canvas.draw()

 # Make a formatter instance.
 locator = mpl.dates.AutoDateLocator()
 formatter = mpl.dates.AutoDateFormatter(locator)

 # Customize the scaling.
 formatter.scaled = {
 365.0 : '%Y',   # view interval  356 days
 30. : '%b %Y', # view interval  30 days but less than
 365 days
 1.0 : '%b %d', # view interval  1 day but less than 30
 days
 1./24. : '%H:%M',# view interval  1 hour but less than 24
 hours
 1./24./60. : '%M:%S',  # view interval  1 min but less than 1 hour
 1./24./60./60. : '%S',   # view interval  1 min
 }

 # Apply the formatter and redraw the plot.
 ax.get_xaxis().set_major_formatter(formatter)
 fig.canvas.draw()


 Confirmed.  It seems like that code fell out of maintenance a bit
 somehow.  Luckily, there is a quick fix to get your code working again.
 Just add the following two lines after you set the major formatter, but
 before your final draw:

 locator.set_axis(ax.xaxis)
 locator.refresh()

 Note, if you zoom in and out after that call, I doubt it will re-adjust
 your formatter.  Could you file a bug report, please?

 Cheers!
 Ben Root


--
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] But report: Date axis formatter problem

2012-10-08 Thread Jianbao Tao
Problem: The autodatelocator and autodateformatter don't seem to work
properly. One, the formatter doesn't seem to work immediately after being
applied to an axis. A manual call to the locator seems necessary. Two, the
autodatelocator doesn't seem to be able to handle view intervals less than
1 second, i.e., the tick labels don't show digits beyond second. You can
see this by zooming the example figure from the code below to a level
shorter than one second.

1. Operating system: OS X 10.8.2
2. matplotlib version: 1.2.0rc2
3. I installed matplotlib via:

pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev

4. Backend: TkAgg, but I don't think the problem depends on the backend.
5. Code:
#- code
-
# Running in ipython --pylab mode.
fig = figure()
tsta = num2epoch(date2num(datetime.datetime.now()))
tarr = tsta + arange(0, 60*30., 0.01) # half hour, dt = 0.01 sec
x = np.array(num2date(epoch2num(tarr)))
nt = len(tarr)
y = randn(nt)

ax = fig.add_subplot(111)
ax.plot(x, y)
fig.canvas.draw()  # Show an overall view of the data


locator = mpl.dates.AutoDateLocator()
formatter = mpl.dates.AutoDateFormatter(locator)

formatter.scaled = {
365.0 : '%Y',
30. : '%b %Y',
1.0 : '%b %d',
1./24. : '%H:%M',
1./24./60. : '%M:%S',
1./24./60./60. : '%S',
}
ax.get_xaxis().set_major_formatter(formatter)  # Won't work immediately.
locator.set_axis(ax.xaxis) # Have to manually make this call and the one
below.
locator.refresh()   # Another manual call.
fig.canvas.draw()
# end of code

--
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


Re: [Matplotlib-users] But report: Date axis formatter problem

2012-10-08 Thread Jianbao Tao
Bug to the bug report: In the subject, it should be 'Bug report', rather
than 'But report'. Oops :-(

Jianbao

On Mon, Oct 8, 2012 at 9:37 AM, Jianbao Tao jianbao@gmail.com wrote:

 Problem: The autodatelocator and autodateformatter don't seem to work
 properly. One, the formatter doesn't seem to work immediately after being
 applied to an axis. A manual call to the locator seems necessary. Two, the
 autodatelocator doesn't seem to be able to handle view intervals less than
 1 second, i.e., the tick labels don't show digits beyond second. You can
 see this by zooming the example figure from the code below to a level
 shorter than one second.

 1. Operating system: OS X 10.8.2
 2. matplotlib version: 1.2.0rc2
 3. I installed matplotlib via:

 pip install 
 git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev

 4. Backend: TkAgg, but I don't think the problem depends on the backend.
 5. Code:
 #- code
 -
 # Running in ipython --pylab mode.
 fig = figure()
 tsta = num2epoch(date2num(datetime.datetime.now()))
 tarr = tsta + arange(0, 60*30., 0.01) # half hour, dt = 0.01 sec
 x = np.array(num2date(epoch2num(tarr)))
 nt = len(tarr)
 y = randn(nt)

 ax = fig.add_subplot(111)
 ax.plot(x, y)
 fig.canvas.draw()  # Show an overall view of the data


 locator = mpl.dates.AutoDateLocator()
 formatter = mpl.dates.AutoDateFormatter(locator)

 formatter.scaled = {
 365.0 : '%Y',
 30. : '%b %Y',
 1.0 : '%b %d',
 1./24. : '%H:%M',
 1./24./60. : '%M:%S',
 1./24./60./60. : '%S',
 }
 ax.get_xaxis().set_major_formatter(formatter)  # Won't work immediately.
 locator.set_axis(ax.xaxis) # Have to manually make this call and the one
 below.
 locator.refresh()   # Another manual call.
 fig.canvas.draw()
 # end of code
 


--
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] Options for speeding up matplotlib, spectrogram with log scale axis, etc.

2012-10-08 Thread Jianbao Tao
Hi all,

A little background: I am from the space physics field where a lot of
people watch/analyze satellite data for a living. This is a field currently
dominated by IDL in terms of visualization/analysis software. I was a happy
IDL user until I saw those very, very, I mean, seriously, very, very pretty
matplotlib plots a couple of weeks ago. Although I was happy with IDL most
of the time, I always hated the feel of IDL plots on screen.

So, I decided to make my move from IDL to python + numpy + scipy +
matplotlib. However, this is not a trivial move. One major thing that makes
me stick to IDL in the first place is the Tplot package (bundled into
THEMIS Data Analysis Software, a.k.a.,
TDAShttp://themis.ssl.berkeley.edu/software.shtml)
developed at my own lab, the Space Sciences Lab at UC Berkeley. I must have
something equivalent to Tplot to work efficiently on the python platform.
In order to do that, there are two problems to solve. First, a utility
module is required to load data that are in NASA CDF format. Second, a 2D
plotting application is required with the following features: 1) Able to
handle large amount vector data, 2) able to display spectrogram with log
scale axis quickly, and 3) convenient toolbar to navigate the data.

I have written a module that can quickly load data in CDF files in cython,
with help from the cython and the numpy communities. I have also gotten the
third plotting feature working with a customized navigation toolbar, thanks
to the help I received in this mailing list. However, I haven't figured out
how to get the first two plotting features. Matplotlib is known for its
slow speed when it comes to large data sets. However, it seems some other
packages can plot large data sets very fast, although not as pretty as
matplotlib. So, I am wondering what makes matplotlib so slow. Is it because
the anti-aliasing engine? If so, is it possible to turn it on or off
flexibly to compromise between performance and quality? Also, is it
possible to convert the bottle-neck bit of the code into cython to speed up
matplotlib? As for spectrograms with log scale axis, I found a working
solution from Stack
Overflowhttp://stackoverflow.com/questions/10812189/creating-a-log-frequency-axis-spectrogram-using-specgram-in-matplotlib,
but it is simply too slow. So, again, why is it so slow?

So, for my purposes, my real problem now is the slow speed of matplotlib. I
tried other packages, such as pyqtgraph, pyqwt, and Chaco/Traits. They seem
to be faster, but they have serious problems too. Pyqtgraph seems very
promising, but it seems to be in an infant stage for now with serious bugs.
For example, I can't get it working together with matplotlib. PyQwt/guiqwt
is reasonably robust, but it has too many dependencies in my opinion, and
doesn't seem to have a wide user base. Chaco/Traits seems another viable
possibility, especially considering the fact that it is actually supported
by a company, but I didn't get a chance to see their performance and
quality because I can't install Enable, a necessary bit for Chaco, on my
mac. (But the fact that Chaco/Traits is supported by a real company is a
real plus to me. If I can't eventually speed up matplotlib, I will probably
give it another shot.)

I have one idea to speed up line plots in matplotlib on screen, which is
basically down-sampling the data before plotting. Basically, my idea is to
down-sample the data into a level that one pixel only corresponds to one
data point. Apparently, one must have enough information to determine the
mapping between the data and the pixels on screen. However, such an
overhead is just to maintain some house-keeping information, which I
suppose is minimal.

I have no idea how to speed up the log-scale spectrogram plot at the
moment. :-(

So, the bottom line: What are the options to speed up matplotlib? Your
comments and insights are very much appreciated. :-)

Thank you for reading.

Cheers,
Jianbao
--
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


Re: [Matplotlib-users] Options for speeding up matplotlib, spectrogram with log scale axis, etc.

2012-10-08 Thread Jianbao Tao
Hi Andre,

Thanks for your message. I like it. :-)

I do have a .edu email. I didn't try to install Chaco with EPD because I
tend to be skeptical when it comes to a bundled package with a lot of
stuff. I like it to be as simple as possible. But it seems that I am
probably better off to install EPD as a whole.

Cheers,
Jianbao

On Mon, Oct 8, 2012 at 11:17 AM, Andre' Walker-Loud walksl...@gmail.comwrote:

 Hi Jianbao,

 One option for getting Chaco is to install the Enthought python
 disctribution

 http://www.enthought.com/

 you can see from their package index, they install Chaco (and all needed
 libraries to make it work)

 http://www.enthought.com/products/epdlibraries.php

 If you have an email ending in .edu you can automatically get their
 academic version (fully functioning version - you just have to verify you
 are doing academic research).  Since you mentioned you were at UC Berkeley,
 I assume you have .edu.
 Their python installation works nicely, and installs itself in
 /Library/Frameworks/Python.framework/ so it plays nicely with the Mac GUI
 environment.  Also, it will not overwrite any other installation you have -
 it makes its own install dir.

 UNFORTUNATELY - at the moment, it appears they are writing their new
 academic software licenses, so you can not download it right now.  But
 there message promises it will soon be available again.

 I have found the Enthought installation to be MUCH more reliable than FINK
 or MacPorts  (Enthought is also a private company - hence the quality
 installers etc, and they like to support academic work).


 Cheers,

 Andre






 On Oct 8, 2012, at 10:55 AM, Jianbao Tao wrote:

  Hi all,
 
  A little background: I am from the space physics field where a lot of
 people watch/analyze satellite data for a living. This is a field currently
 dominated by IDL in terms of visualization/analysis software. I was a happy
 IDL user until I saw those very, very, I mean, seriously, very, very pretty
 matplotlib plots a couple of weeks ago. Although I was happy with IDL most
 of the time, I always hated the feel of IDL plots on screen.
 
  So, I decided to make my move from IDL to python + numpy + scipy +
 matplotlib. However, this is not a trivial move. One major thing that makes
 me stick to IDL in the first place is the Tplot package (bundled into
 THEMIS Data Analysis Software, a.k.a., TDAS) developed at my own lab, the
 Space Sciences Lab at UC Berkeley. I must have something equivalent to
 Tplot to work efficiently on the python platform. In order to do that,
 there are two problems to solve. First, a utility module is required to
 load data that are in NASA CDF format. Second, a 2D plotting application is
 required with the following features: 1) Able to handle large amount vector
 data, 2) able to display spectrogram with log scale axis quickly, and 3)
 convenient toolbar to navigate the data.
 
  I have written a module that can quickly load data in CDF files in
 cython, with help from the cython and the numpy communities. I have also
 gotten the third plotting feature working with a customized navigation
 toolbar, thanks to the help I received in this mailing list. However, I
 haven't figured out how to get the first two plotting features. Matplotlib
 is known for its slow speed when it comes to large data sets. However, it
 seems some other packages can plot large data sets very fast, although not
 as pretty as matplotlib. So, I am wondering what makes matplotlib so slow.
 Is it because the anti-aliasing engine? If so, is it possible to turn it on
 or off flexibly to compromise between performance and quality? Also, is it
 possible to convert the bottle-neck bit of the code into cython to speed up
 matplotlib? As for spectrograms with log scale axis, I found a working
 solution from Stack Overflow, but it is simply too slow. So, again, why is
 it so slow?
 
  So, for my purposes, my real problem now is the slow speed of
 matplotlib. I tried other packages, such as pyqtgraph, pyqwt, and
 Chaco/Traits. They seem to be faster, but they have serious problems too.
 Pyqtgraph seems very promising, but it seems to be in an infant stage for
 now with serious bugs. For example, I can't get it working together with
 matplotlib. PyQwt/guiqwt is reasonably robust, but it has too many
 dependencies in my opinion, and doesn't seem to have a wide user base.
 Chaco/Traits seems another viable possibility, especially considering the
 fact that it is actually supported by a company, but I didn't get a chance
 to see their performance and quality because I can't install Enable, a
 necessary bit for Chaco, on my mac. (But the fact that Chaco/Traits is
 supported by a real company is a real plus to me. If I can't eventually
 speed up matplotlib, I will probably give it another shot.)
 
  I have one idea to speed up line plots in matplotlib on screen, which is
 basically down-sampling the data before plotting. Basically, my idea is to
 down-sample the data into a level

[Matplotlib-users] Format date tick labels

2012-10-07 Thread Jianbao Tao
Hi,

I am having trouble to customize the format of date axis tick labels. Below
is a snippet to demonstrate my problem:
#- code

# Make an example plot.
fig = figure()
tsta = num2epoch(date2num(datetime.datetime.now()))
tarr = tsta + arange(0, 60*60*0.5, 0.1)# half hour, dt =
0.1 sec
x = np.array(num2date(epoch2num(tarr)))
nt = len(tarr)
y = randn(nt)

ax = fig.add_subplot(111)
ax.plot(x, y)
fig.canvas.draw()

# Make a formatter instance.
locator = mpl.dates.AutoDateLocator()
formatter = mpl.dates.AutoDateFormatter(locator)

# Customize the scaling.
formatter.scaled = {
365.0 : '%Y',   # view interval  356 days
30. : '%b %Y', # view interval  30 days but less than 365
days
1.0 : '%b %d', # view interval  1 day but less than 30 days
1./24. : '%H:%M',# view interval  1 hour but less than 24 hours
1./24./60. : '%M:%S',  # view interval  1 min but less than 1 hour
1./24./60./60. : '%S',   # view interval  1 min
}

# Apply the formatter and redraw the plot.
ax.get_xaxis().set_major_formatter(formatter)
fig.canvas.draw()
#-- end of code
-

I listed my expectation about the new scaling above. However, what I got
was simply '%Y' after I applied the formatter. So, how can I make the new
formatter work, please? Thank you very much.

Jianbao
--
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


Re: [Matplotlib-users] Matplotlib produced plots in academic journal articles

2012-10-05 Thread Jianbao Tao
I think that is a great idea. I think it is worthwhile to put a highlighted
spot, or whatever, that shows matplotlib plots in academic publications.
Additionally, it is good for enlarging the matplotlib user base to ask
people to acknowledge matplotlib in their papers if they use matplotlib to
make plots, and share links of their publications. Of course,
matplotlib.orgshould provide some sort of platform for people to share
that kind of
information, such as a public email address. Such acknowledgement is not a
hard thing to do, and I think most people, if not all, that benefit from
matplotlib would be more than happy to do so. :-)

Jianbao

Message: 4
 Date: Thu, 4 Oct 2012 22:31:34 -0600
 From: G?khan Sever gokhanse...@gmail.com
 Subject: [Matplotlib-users] Matplotlib produced plots in academic
 journal articles
 To: matplotlib-users@lists.sourceforge.net
 Message-ID:
 CAE5kuyh17jsDcaejwx=
 xekryyys9kf5zw9q7yigziaketio...@mail.gmail.com
 Content-Type: text/plain; charset=utf-8

 Hello,

 Is there any collection of articles that shows academic articles using
 matplotlib produced plots? I have come across a few recent articles in my
 field with plots produced by matplotlib. Though, the mpl page shows some
 nice examples of publication quality plots, it would be nice to have a
 discipline specific collection of academic paper citations/links (hopefully
 mostly open-access titles) to raise awareness of mpl usage in academia by
 attracting other language users.

 What do you think?

 --
 G?khan

--
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] Problem with shared axis

2012-10-05 Thread Jianbao Tao
Hi,

I am working on a time-series data browser based on matplotlib. In general,
it shows a N_row x 1_col stack of axes, which share the x axis, the time
axis. It is nice that matplotlib offers the sharex option so that the data
can be zoomed simultaneously in time. However, one problem with the sharex
option is that it not only shares the axis range (or limits, if you will),
but also the axis appearance, which is not always desirable. In my case, I
want the tick labels to be shown only on the bottom subplot. However, that
doesn't seem to be achievable with sharex.

The follow snippet demonstrates my example:
#- code 
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212, sharex=ax1)

ax1.get_xaxis().set_ticklabels([]) # This also suppresses x tick labels of
ax2.
fig.canvas.draw()
#-- end of code 

Is there a workaround, hopefully simple and straightforward, to share range
(or limits) only among axes? Better yet, can this feature be added, like a
keyword sharexrange, in the future, if it is not already there? Of course,
the situation should be similar for y axis, too.

Thank you very much.

Jianbao
--
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] Development advice needed

2012-10-03 Thread Jianbao Tao
Dear all,

As some of you might have noticed, I am asking questions frequently
recently, most of which are naive ones. The reason for this is that I
recently decided to develop a  satellite data viewer with matplotlib, and I
am new to both python and matplotlib.

Here is a little background of this decision. I am a postdoc in the space
physics field, where a lot of people watch and analyze satellite data for a
living. The data are time-series data by nature. As for now, a lot of
people use packages based on IDL to navigate their data. I myself is one of
them too. For now. :-) One big problem with IDL is that it is very
expensive because it doesn't have a broad enough user base to drive their
cost down. Another big problem is that the company that is developing IDL
doesn't seem to work in the right direction. For example, more than 99% of
the time of more than 99% of the IDL users use the so-called direct
graphics system in IDL, but IDL hasn't upgraded this system since, I don't
know, maybe early 90s. Compared to what matplotlib can offer, the on-screen
graphics quality of the IDL direct graphics is simply ugly, which is a
big reason why I want to switch to matplotlib. There are also some other
frequently-used nice features in matplotlib that IDL doesn't have.

After reading the matplotlib documents and trying out several little
examples for a few days, I now have a feeling that matplotlib at least has
most of the infrastructure ready for my purposes. One thing that bothers me
a little bit is that the plotting speed seems to be a little slow. But IDL
had the same problem in the first place too. As computers became faster and
faster, that problem just became less and less important. I expect the same
thing will happen to matplotlib too.

Now let me turn to technical stuff. What I want is a time-series plotting
system like the following. First, it manages all the figure windows it
generates, including the positions and looks of the figure windows. A
common use case for such a system would be that the user is also analyzing
the data while watching the time-series data,and hence the user likely
needs to plot some temporary results, such as a snapshot of particle
distribution function, but doesn't want to screw up the time-series plot.
Therefore, it will be nice that the plotting windows of the time-series
data are managed particularly. Second, it should come with a navigation
toolbar that facilitates the data navigation. The current navigation
toolbar widget is nice and probably suit more than 50% percent of my needs,
but it's not sufficient. Third, the system should have minimal dependencies
for the sake of portability and installation easiness. As for now, I don't
want any dependencies beyond numpy, scipy, and matplotlib. Ipython would be
a highly recommended tool, but the system should be just fine without it.

After weighing all the options, I sense that I will probably be better off
to use the matplotlib library directly, rather than the convenient
utilities provided by pyplot. However, I am having a hard time to find good
instructions for using the matplotlib infrastructure. So, I would like to
hear some references on that. I also would like to hear general advice
about how to construct such a system so that its structure is consistent
with matplotlib conventions. Other comments and advice are warmly welcome
too. :-)

Thank you very much for reading this far.

Jianbao
--
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


Re: [Matplotlib-users] Development advice needed

2012-10-03 Thread Jianbao Tao
Dear Anthony,

Thank you so much for your advice. I embedded my response below.

Jianbao

On Wed, Oct 3, 2012 at 10:49 AM, Anthony Floyd anthonyfl...@gmail.comwrote:

 Hi Jianbao,

 First some context: at the company I work for, we've been using
 matplotlib to do much of what you want to do for the past 4 years. We
 have created our own application for plotting, interrogating, and
 manipulating time-series data coming from both simulations and
 measurements, although from a completely different domain (in our case
 it's virtual manufacturing of composite materials). In the past two
 years, we've also been using matplotlib to plot in more-or-less
 realtime data from a cloud industrial sensors (temperature, pressure,
 etc).

Do you have any references, such as screen shots, gallery, examples, or
whatever?  I am very curious to see what people can do with matplotlib.


  After reading the matplotlib documents and trying out several little
  examples for a few days, I now have a feeling that matplotlib at least
 has
  most of the infrastructure ready for my purposes. One thing that bothers
 me
  a little bit is that the plotting speed seems to be a little slow. But
 IDL
  had the same problem in the first place too. As computers became faster
 and
  faster, that problem just became less and less important. I expect the
 same
  thing will happen to matplotlib too.

 This is true, matplotlib can be slow, particularly for large data sets
 and many data sets. The trick is to downsample (and use tiling if
 you're going to be panning around a lot) what you're actually plotting
 before handing it off to the plot. I think more recent versions of
 matplotlib handle some of this for you, but we've found that it's
 faster to do the downsampling ourselves.

As a matter of fact, I considered writing intermediate routines to handle
downsampling before feeding data in matplotlib. However, you will have to
do anti-alias filtering for that. So, I wasn't sure downsampling would
boost the speed anyway. But based on your experience, this is probably a
good idea. :-)


  Now let me turn to technical stuff. What I want is a time-series plotting
 [...]
  sufficient. Third, the system should have minimal dependencies for the
 sake
  of portability and installation easiness. As for now, I don't want any
  dependencies beyond numpy, scipy, and matplotlib. Ipython would be a
 highly
  recommended tool, but the system should be just fine without it.

 You're going to need more than that. At the very least you're going to
 need a widget framework like wxPython, pyQT, pyGTK, or some such.
 These will provide you with all the window management, widget
 controls, and so on. Our preference is wxPython but YMMV.

One of my concerns about third-party widget framework is that sometimes it
is difficult to install them. In fact, I tried to install wxPython on my
Mac (10.8 OS X) last night, but didn't succeed. Another concern of mine is
that I don't know how efficient or how easy to interact with a thrid-party
widget framework from a python interpreter. However, again, based on your
reply, it doesn't seem to be a big issue after all.


  After weighing all the options, I sense that I will probably be better
 off
  to use the matplotlib library directly, rather than the convenient
 utilities
  provided by pyplot. However, I am having a hard time to find good
  instructions for using the matplotlib infrastructure. So, I would like to
  hear some references on that. I also would like to hear general advice
 about
  how to construct such a system so that its structure is consistent with
  matplotlib conventions. Other comments and advice are warmly welcome too.

 Absolutely, you'll want to use the API rather than the utility
 functions. The best reference for that is the online documentation at
 matplotlib.org. In the past we've found the source code documentation
 (or, say, that generated by doxygen) more helpful than the Sphinx
 documentation, but frankly our matplotlib bits are pretty stable now
 and we haven't had to use the documentation for a while (perhaps it's
 better now).

 Good luck! We've been very happy with our design choices, and get
 nothing but positive feedback on how our plots look and feel.
 matplotlib and the amazing active community around it have everything
 to do with that.

I am very glad to hear that. :-)


 Anthony.

--
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


Re: [Matplotlib-users] Development advice needed

2012-10-03 Thread Jianbao Tao
Thank you so much, Anthony. After weighing the options, I decided to go for
Tkinter. The major reason for this is portability. BTW, I checked out your
website. Those screenshots are quite impressive. :-)

Jianbao

On Wed, Oct 3, 2012 at 3:27 PM, Anthony Floyd anthonyfl...@gmail.comwrote:

 Hi Jianbao,

  Do you have any references, such as screen shots, gallery, examples, or
  whatever?  I am very curious to see what people can do with matplotlib.

 If you can find a Windows machine (or a Windows VM) and stomach a 60
 MB download, visit
 http://www.convergent.ca/products/raven/downloads.html and grab the
 RAVEN Viewer and Demo RAVEN Workspace. When starting the program
 for the first time, don't worry about selecting a license, select
 Viewer Only. Open the demo file. All plotting, annotating, legends,
 etc are handled by matplotlib. wxPython provides the rest of the GUI
 elements. The entirety of the program except for the engineering
 backend (which isn't exposed in the viewer anyway) is written in
 Python.

 If you can't get to a Windows box, then just visit
 http://www.convergent.ca/raven to get a sense of the application.

 Cheers,
 Anthony.

--
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] How to modify the navigation toolbar easily in a matplotlib figure window?

2012-10-02 Thread Jianbao Tao
Is it possible to do something like the following to modify the navigation
toolbar in matplotlib?

   1. Generate a figure window, such as by *fig = figure()*
   2. Get a reference of the navigation toolbar, such as by *tbar =
   fig.get_navigation_toolbar()* or better yet, just by *tbar = fig.navtbar*
   3. Modify the toolbar through the reference *tbar*, such as
   delete/add/edit a button by something like this: *tbar.add_button()*,
*tbar.remove_button(a reference to a button)*,  *tbar.edit_button(a
   reference to a button)*.
   4. Update the figure by *fig.canvas.draw()*

Thank you very much.
--
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] Create a figure window without navigation toolbar

2012-10-02 Thread Jianbao Tao
Hi,

I know one can make a figure window without toolbar by doing
mpl.rcParams['toolbar'] = 'None'

However, this approach is kind of annoying if one just wants to remove the
toolbar for one figure window and to keep the default behavior to be with a
toolbar. So, I am wondering if it is possible to do something like:
fig = figure(toolbar=False) # Create a new figure window with no toolbar.

If it is not possible now, I am wondering if the matplotlib team has any
intention to implement that feature. I would think it is not hard to do so,
since it is so easy to achieve that goal by setting a parameter. But I
could very much be wrong, as I know nothing about how things work under the
hood for matplotlib.

Anyway, I am mostly just curious, since I have already got a workaround for
that. But it would be nice to know other's people's approaches/ideas. :-)

Thank you very much.

Jianbao
--
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] Control the position of a figure window

2012-10-02 Thread Jianbao Tao
Hi,

Is it possible to specify the position of a figure window when one is
created? This will be a killing feature if one wants to put the figure
window at the right place in the screen automatically. It is annoying if
ones has to drag a new figure to a comfortable place in the screen every
time a new figure is created.

Jianbao
--
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