[matplotlib-devel] [Fwd: [Matplotlib-users] imshow without resampling]

2009-04-04 Thread Eric Firing

Jouni, Darren,

I'm not sure who the SVG expert is, and I presume the attached message 
applies to pdf as well as ps.  I'm bringing it to your attention because 
it is suggesting what would seem to be significant improvements in some 
backends by taking better advantage of their native image support.  I 
know nothing about this; would either of you (or anyone else) like to 
comment?


Eric
--- Begin Message ---
Hello,

I am using matplotlib to create postscript and SVG files. I am  
currently using imshow to show the contents of an array, but this  
means that when saving vector graphics files, matplotlib resamples the  
image/array onto a finer grid. What I would like, is for code such as  
this:

import matplotlib
matplotlib.use('PS')
from matplotlib.pyplot import *

import numpy as np

image = np.random.random((10,10))

fig = figure(figsize=(4,4))
ax = fig.add_subplot(111)
ax.imshow(image)
fig.savefig('example1.ps')

fig = figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.imshow(image)
fig.savefig('example2.ps')

to produce files that are the roughly the same size, rather than  
different by a factor of 4. In addition, both files should be very  
small since they should only contain a 10x10 bitmap in addition to the  
axes+labels. Postscript and SVG (as languages) both allow a bitmap of  
an arbitrary resolution to be scaled, translated, and rotated without  
resampling.

I have come across the figimage method which is meant to place an  
array in a plot without resampling, but I cannot figure out how to use  
it like imshow, i.e. to show the image inside the axes as before. I've  
also tried the pcolor functions, but it seems like they define each  
pixel as an individual polygon, which is inefficient.

I was wondering if anyone had a solution to this, or if there are  
plans to make matplotlib behave like this in future?

Thanks,

Thomas

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


Re: [matplotlib-devel] OpenGL backend and pyglet expertiments

2009-04-04 Thread Christopher Barker

Eric Bruning wrote:
> The idea of a shell with inline plots is a fascinating one -

Then check out reinteract -- very cool:

http://www.reinteract.org/trac/

(though no opengl)

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov

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


[matplotlib-devel] including AxesGrid in main mpl source?

2009-04-04 Thread Jae-Joon Lee
John,

About a week ago, I introduced my own mpl toolkit
(http://dl.getdropbox.com/u/178748/AxesGrid/htdocs/index.html) in the
mpl dev-list. And I wonder if this package can be included in the main
matplotlib source.

As a matter of fact, I was a bit reluctant to do this because the
package is poorly documented at this moment. However, other people
(Matthew Turk and Jeff Oishi) showed their interests in this package
going into the main matplotlib source, and they're willing to help me
to improve the documentation (and other aspects).

I couldn't find any policy (or similar thing) about mpl_toolkits.
Currently, my package is consist of several pure python modules, so
including this in the main source would be straight forward.

Regards,

-JJ

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