How to overlay an image on a multi plot?

Hi All,

I used the
http://matplotlib.sourceforge.net/examples/pylab_examples/scatter_hist.html
scatter_hist example from the Gallery to create the following
visualization:

http://old.nabble.com/file/p28111498/Full5%2B8%2B2_vs_Bulk1%2B2.png

What I would like to do is overlay some
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR sparklines
so in one visualization I can see
     - The correlation between two variables
     - The marginal densities of the variables
     - A quick idea of what the variables did in time

I found some Python code for generating sparklines at M
http://www.perrygeo.net/wordpress/?p=64 atthew Perry's blog . The code works
great for my purposes, and the sparklines are dumped out as PNG files, like
this one

http://old.nabble.com/file/p28111498/spark_x.png

But, all of the examples and forum discussions I can find pertain to using
an image as the background for a set of axes, and then plotting or
contouring over the image. I simply want to overlay a PNG on an existing set
of multiple axes. I know I can use something like Adobe Illustrator to do
this outside of matplotlib, but is there a way to do this programmatically?

Thanks!

···

-----
Josh Hemann
Statistical Advisor
http://www.vni.com/ Visual Numerics
jhemann at vni dizzot com


View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28111498.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

http://agile.unisonis.com/proj/sparkplot/sparkplot.py

fwiw,
Alan Isaac

···

On 4/1/2010 1:26 PM, Josh Hemann wrote:

What I would like to do is overlay some
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR sparklines
so in one visualization I can see
      - The correlation between two variables
      - The marginal densities of the variables
      - A quick idea of what the variables did in time

Alan,

Thanks much for that link. I started playing with this code and after some
hacking I might get what I need. If I cobble this together successfully I'll
post the results and the code.

Josh

···

-----
Josh Hemann
Statistical Advisor
http://www.vni.com/ Visual Numerics
jhemann at vni dizzot com


View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28143553.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

OK, I am in business. I read through the code that Alan linked to which
helped me understand what to do, which does not involve overlaying any
images. So, this thread is a dead end with respect to the original question.
Here is the new graphic.

http://old.nabble.com/file/p28144782/Full5%2B8%2B2_vs_Bulk1%2B2.png

In a publication I think I would need to mention the date range for the
sparklines. I like this, it is visually dense (marginal time series
behavior, marginal density, and relationship between two variables) but does
not seem cluttered. I'll post code tonight...

···

-----
Josh Hemann
Statistical Advisor
http://www.vni.com/ Visual Numerics
jhemann at vni dizzot com


View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28144782.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Nice.
You might want to see http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR
if you have not already.

Alan Isaac

···

On 4/5/2010 5:08 PM, Josh Hemann wrote:

Here is the new graphic.

http://old.nabble.com/file/p28144782/Full5%2B8%2B2_vs_Bulk1%2B2.png

AlanIsaac wrote:

Nice.
You might want to see
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR
if you have not already.

Alan Isaac

Thanks again Alan. I know I am abusing the term "sparkline" because I am not
embedding the visualization within text, but I am not sure what else to call
it. I do think that showing the time series not bound within a set of axes,
without labels, underscores that the time series is a "quick hit", just like
the histograms are. The main focus should be on the scatter plot, with the
marginal visualizations there to aid in quick assessment of distribution and
behavior over time. For true sparklines, here is
http://bitworking.org/news/Sparklines_in_data_URIs_in_Python another nice
example in Python .

···

-----
Josh Hemann
Statistical Advisor
http://www.vni.com/ Visual Numerics
jhemann at vni dizzot com


View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28147118.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Thanks!
Alan

···

On 4/5/2010 11:19 PM, Josh Hemann wrote:

For true sparklines, here is
http://bitworking.org/news/Sparklines_in_data_URIs_in_Python another nice
example in Python .

OK, I am finally posting some code. The graphic it will produce is similar to
above. I mocked up some time series data and fit one of the regression lines
using PyIMSL Studio (Scipy for the other one). Full disclosure: I am on the
PyIMSL Studio team at Rogue Wave Software. You can use PyIMSL Studio for
free for noncommercial use, and you can choose to install just the
math/stat/data libraries under site-packages like any other Python package.
But, as for the matplotlib calls themselves, hopefully the code is clear and
a useful example.

Cheers.

http://old.nabble.com/file/p28272259/matplotlib_gallery_scatter.py
matplotlib_gallery_scatter.py

···

-----
Josh Hemann
Statistical Advisor
http://www.roguewave.com//" Rogue Wave Software
jhemann at vni dizzot com


View this message in context: http://old.nabble.com/How-to-overlay-an-image-on-a-multi-plot--tp28111498p28272259.html
Sent from the matplotlib - users mailing list archive at Nabble.com.