Displaying multiples images

102 views
Skip to first unread message

jip

unread,
Mar 24, 2011, 11:49:51 AM3/24/11
to pythonvision
Is there a simple way to display multiple images of various size with
matplotlib ...or something else?
Jean-Pat

Luis Pedro Coelho

unread,
Mar 24, 2011, 12:37:15 PM3/24/11
to python...@googlegroups.com
Is subplot() not what you want?

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplot

HTH

--
Luis Pedro Coelho | Carnegie Mellon University | http://luispedro.org


jip

unread,
Mar 24, 2011, 5:00:12 PM3/24/11
to pythonvision


On 24 mar, 17:37, Luis Pedro Coelho <l...@luispedro.org> wrote:
> Is subplot() not what you want?
I'll try that way
thank you
>
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pypl...

Stéfan van der Walt

unread,
Mar 28, 2011, 7:27:50 AM3/28/11
to python...@googlegroups.com
Hi Jean-Pat

On Thu, Mar 24, 2011 at 5:49 PM, jip <jeanpatri...@gmail.com> wrote:
> Is there a simple way to display multiple images of various size with
> matplotlib ...or something else?

Do you want to display them as a montage or scroll through them individually?

Regards
Stéfan

jip

unread,
Mar 29, 2011, 5:33:17 AM3/29/11
to pythonvision
I try to make a montage. I have an example here:http://
dip4fish.blogspot.com/2011/03/trying-to-make-images-mosaic-with.html
I tried without success pylab.subplot (see the script), I try also to
understand how could I do with chaco. pygame might also be a
solution...
I am also interested in scrolling through for further classification
with scikit.learn/orange
Regards

Jean-Patrick

On 28 mar, 13:27, Stéfan van der Walt <ste...@sun.ac.za> wrote:
> Hi Jean-Pat
>

Stéfan van der Walt

unread,
Mar 29, 2011, 7:53:40 AM3/29/11
to python...@googlegroups.com
Hi Jean-Patrick

On Tue, Mar 29, 2011 at 11:33 AM, jip <jeanpatri...@gmail.com> wrote:
> I try to make a montage. I have an example here:http://
> dip4fish.blogspot.com/2011/03/trying-to-make-images-mosaic-with.html
> I tried without success pylab.subplot (see the script), I try also to
> understand how could I do with chaco. pygame might also be a
> solution...

I think a library that gives you access to a canvas may be useful.
The simplest method is to construct a large array of zeros, and to
then simply update the values to the different images, and plot it as
a single image. Another option would be to use something like Cairo
or Pyglet, and ask it to display the images at the appropriate
positions.

Regards
Stéfan

jip

unread,
Mar 31, 2011, 4:05:31 AM3/31/11
to pythonvision
I am trying to persist in using pylab.subplot(), but I don't know
something since subplot() didn't yield what I was waiting:
http://dip4fish.blogspot.com/2011/03/trying-to-make-images-mosaic-with.html

Regards
Jean-Patrick

On 29 mar, 13:53, Stéfan van der Walt <ste...@sun.ac.za> wrote:
> Hi Jean-Patrick
>

Jan Erik Solem

unread,
Mar 31, 2011, 11:16:13 AM3/31/11
to python...@googlegroups.com
Jean-Patrick: you are using subplot incorrectly. Perhaps you are
misunderstanding the first two arguments. If you want to do a 2*2 grid
you declare that as:

subplot(2,2,1)
imshow(upperleftimage)
subplot(2,2,2)
imshow(upperrightimage)
subplot(2,2,3)
imshow(lowerrleftimage)
subplot(2,2,4)
imshow(lowerrightimage)

In your case, you had subplot(2,1,3) where 3 is larger than the number
of subplots. This needs to be less or equal to the product of the
first two numbers 2*1=2.

Hope that helps.
/Jan Erik

--
phone:+1 415 601 2246 / skype:jesolem / twitter:jesolem

jip

unread,
Mar 31, 2011, 4:24:00 PM3/31/11
to pythonvision
Thank you, now I understand

Best regards

Jean-Patrick

On 31 mar, 17:16, Jan Erik Solem <jeso...@gmail.com> wrote:
> Jean-Patrick: you are using subplot incorrectly. Perhaps you are
> misunderstanding the first two arguments.
you're right
If you want to do a 2*2 grid
> you declare that as:
>
> subplot(2,2,1)
> imshow(upperleftimage)
> subplot(2,2,2)
> imshow(upperrightimage)
> subplot(2,2,3)
> imshow(lowerrleftimage)
> subplot(2,2,4)
> imshow(lowerrightimage)
>
> In your case, you had subplot(2,1,3) where 3 is larger than the number
> of subplots. This needs to be less or equal to the product of the
> first two numbers 2*1=2.
>
> Hope that helps.
> /Jan Erik
>
>
>
> On Thu, Mar 31, 2011 at 1:05 AM, jip <jeanpatrick.pomm...@gmail.com> wrote:
> > I am trying to persist in using pylab.subplot(), but I don't know
> > something since subplot() didn't yield what I was waiting:
> >http://dip4fish.blogspot.com/2011/03/trying-to-make-images-mosaic-wit...
Reply all
Reply to author
Forward
0 new messages