SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S

1
(2)
2
(32)
3
(26)
4
(29)
5
(41)
6
(2)
7
(1)
8
(13)
9
(15)
10
(23)
11
(23)
12
(16)
13
(6)
14
(15)
15
(4)
16
(18)
17
(28)
18
(17)
19
(11)
20
(6)
21
(2)
22
(4)
23
(1)
24
25
26
(1)
27
(2)
28
(2)
29
(3)
30
(10)
31
(2)



Showing results of 32

1 2 > >> (Page 1 of 2)
From: Damon M. <dam...@gm...> - 2012年10月02日 20:15:58
On Tue, Oct 2, 2012 at 9:09 PM, Eric Firing <ef...@ha...> wrote:
> On 2012年10月02日 9:21 AM, Michael Aye wrote:
>>>>>>>>
>>>>>>> How nice of you to ask! ;)
>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>> shown with some white overhead area around, e.g. for an image of 100
>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>> and let imshow instead use the exact image extent. I believe that the
>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>> range and not try to beautify the plot?
>>>>>>>
>>>>>>> Michael
>>>>>>>
>>>>>>
>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>>
>>>>>
>>>>> No, because it needs detail. I was looking for a boolean switch that
>>> basically says: Respect the data, not beauty.
>>>>
>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>> that doesn't do what you want?
>>>>
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>>
>>>
>>> Which version of matplotlib are you using? Also, are you on a 32-bit
>>> machine or a 64-bit machine. This might be related to a bug we have
>>> seen recently.
>>
>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>>
>> Thanks for the effort Damon. I should have been starting with an
>> example script from the beginning.
>> I believe the problem appears only for subplots in the case of sharex
>> =sharey = True:
>
> Aha! This is a real bug. It may take a bit of work to track it down.
> Would you enter it, with this test script, as a github issue, please?
>
> Thank you.
>
> Eric
>
>>
>> from matplotlib.pyplot import show, subplots
>> from numpy import arange, array
>>
>> arr = arange(10000).reshape(100,100)
>> l = [arr,arr,arr,arr]
>> narr = array(l)
>>
>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>>
>> for ax,im in zip(axes.flatten(),narr):
>> ax.imshow(im)
>>
>> show()
>>
>> One can see that all the 4 axes show the array with an extent of
>> [-10,110, 0, 100] here.
>>
>> Michael
>>
>>
>>>
>>> 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
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
The extent keyword is something I put in as second nature. You'll need
it if your x-range or y-range is something other than the the number
of pixels in each dimension. In this case, it can safely be removed,
yes. Thanks for pointing that out.
If you want to share axes, that is still possible:
import matplotlib.pyplot as plt
from numpy import arange, array
arr = arange(10000).reshape(100,100)
l = [arr,arr,arr,arr]
narr = array(l)
axes = []
fig = plt.figure()
for i in range(4):
 if i == 0:
 axes.append(fig.add_subplot(2, 2, i))
 if i > 0:
 axes.append(fig.add_subplot(2, 2, i, sharex=axes[0], sharey=axes[0]))
for ax, im in zip(axes, narr):
 ax.imshow(im, extent=[0,100,0,100])
plt.show()
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Eric F. <ef...@ha...> - 2012年10月02日 20:09:47
On 2012年10月02日 9:21 AM, Michael Aye wrote:
>>>>>>>
>>>>>> How nice of you to ask! ;)
>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>> shown with some white overhead area around, e.g. for an image of 100
>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>> -10 to 110. I was looking for a simple way to suppress that behavior
>> and let imshow instead use the exact image extent. I believe that the
>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>> range and not try to beautify the plot?
>>>>>>
>>>>>> Michael
>>>>>>
>>>>>
>>>>> Is the 'extent' keyword what you're looking for?
>>>>>
>>>>
>>>> No, because it needs detail. I was looking for a boolean switch that
>> basically says: Respect the data, not beauty.
>>>
>>> I don't understand what you mean by 'beauty'. If your image is 100
>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>> that doesn't do what you want?
>>>
>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>
>>
>> Which version of matplotlib are you using? Also, are you on a 32-bit
>> machine or a 64-bit machine. This might be related to a bug we have
>> seen recently.
>
> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>
> Thanks for the effort Damon. I should have been starting with an
> example script from the beginning.
> I believe the problem appears only for subplots in the case of sharex
> =sharey = True:
Aha! This is a real bug. It may take a bit of work to track it down. 
Would you enter it, with this test script, as a github issue, please?
Thank you.
Eric
>
> from matplotlib.pyplot import show, subplots
> from numpy import arange, array
>
> arr = arange(10000).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
>
> fig, axes = subplots(2,2,sharex=True,sharey=True)
>
> for ax,im in zip(axes.flatten(),narr):
> ax.imshow(im)
>
> show()
>
> One can see that all the 4 axes show the array with an extent of
> [-10,110, 0, 100] here.
>
> Michael
>
>
>>
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Michael A. <kmi...@gm...> - 2012年10月02日 20:09:30
On 2012年10月02日 19:49:16 +0000, Damon McDougall said:
> On Tue, Oct 2, 2012 at 8:33 PM, Michael Aye 
> <kmi...@gm...> wrote:
>>>>>>>>>> 
>>>>>>>>> How nice of you to ask! ;)
>>>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>>>>>>>> shown with some white overhead area around, e.g. for an image of 100
>>>>>>>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>>>>>>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>>>>>>>> and let imshow instead use the exact image extent. I believe that the
>>>>>>>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>>>>>>>> range and not try to beautify the plot?
>>>>>>>>> 
>>>>>>>>> Michael
>>>>>>>> 
>>>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>>>> 
>>>>>>> 
>>>>>>> No, because it needs detail. I was looking for a boolean switch that
>>>>>>> basically says: Respect the data, not beauty.
>>>>>> 
>>>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>>>> that doesn't do what you want?
>>>>>> 
>>>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>>>> 
>>>>> 
>>>> 
>>>> The following script works for me:
>>>> 
>>>> import numpy as np
>>>> import matplotlib.pyplot as plt
>>>> 
>>>> image = np.random.random((100,50))
>>>> 
>>>> fig = plt.figure()
>>>> ax = fig.add_subplot(1, 1, 1)
>>>> ax.imshow(image, extent=[0,100,0,50])
>>>> plt.show()
>>>> 
>>>> 
>>> 
>>> I think the problem is that Michael is using ImageGrid, and apparently
>>> it is not using the tight autoscaling that imshow normally uses by default.
>> 
>> I might have confused where I had the problem as I was trying out many
>> a'things yesterday, so today I only can reproduce it with subplots. Can
>> I activate tight autoscaling somehow? tight_layout only influences the
>> axes towards each-other not the imshows itself.
>> 
>> 
>>> 
>>> Eric
>>> 
>>> ------------------------------------------------------------------------------
>>> 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
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> 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
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> I think you may have encountered a bug, as Ben pointed out. Here's a 
> workaround:
> 
> import matplotlib
> matplotlib.use('macosx')
> import matplotlib.pyplot as plt
> from numpy import arange, array
> 
> arr = arange(10000).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
> 
> axes = []
> fig = plt.figure()
> for i in range(4):
> axes.append(fig.add_subplot(2, 2, i))
> 
> for ax, im in zip(axes, narr):
> ax.imshow(im, extent=[0,100,0,100])
> 
> plt.show()
Interestingly, providing the extent does not help using subplots.
And your way of creating the subplots does not have the bug in the 
first place. Removing the extent parameter from this still plots fine.
Hello List,
Apparently, it is not straightforward to make an animation of contour plots.
I found a discussion (and work-around solution including punching ducks) on
the list through this link: punch the QuadContourSet until it behaves like
an Artist<http://old.nabble.com/Matplotlib-1.1.0-animation-vs.-contour-plots-td32835814.html>
Has there been a fix since then? It would be nice if contours work with
animations like the other plots.
If not, no big deal.
Thanks,
Mark
From: Damon M. <dam...@gm...> - 2012年10月02日 19:49:25
On Tue, Oct 2, 2012 at 8:33 PM, Michael Aye <kmi...@gm...> wrote:
>>>>>>>>>
>>>>>>>> How nice of you to ask! ;)
>>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>>>>>>> shown with some white overhead area around, e.g. for an image of 100
>>>>>>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>>>>>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>>>>>>> and let imshow instead use the exact image extent. I believe that the
>>>>>>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>>>>>>> range and not try to beautify the plot?
>>>>>>>>
>>>>>>>> Michael
>>>>>>>
>>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>>>
>>>>>>
>>>>>> No, because it needs detail. I was looking for a boolean switch that
>>>>>> basically says: Respect the data, not beauty.
>>>>>
>>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>>> that doesn't do what you want?
>>>>>
>>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>>>
>>>>
>>>
>>> The following script works for me:
>>>
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>>
>>> image = np.random.random((100,50))
>>>
>>> fig = plt.figure()
>>> ax = fig.add_subplot(1, 1, 1)
>>> ax.imshow(image, extent=[0,100,0,50])
>>> plt.show()
>>>
>>>
>>
>> I think the problem is that Michael is using ImageGrid, and apparently
>> it is not using the tight autoscaling that imshow normally uses by default.
>
> I might have confused where I had the problem as I was trying out many
> a'things yesterday, so today I only can reproduce it with subplots. Can
> I activate tight autoscaling somehow? tight_layout only influences the
> axes towards each-other not the imshows itself.
>
>
>>
>> Eric
>>
>> ------------------------------------------------------------------------------
>> 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
>
>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I think you may have encountered a bug, as Ben pointed out. Here's a workaround:
import matplotlib
matplotlib.use('macosx')
import matplotlib.pyplot as plt
from numpy import arange, array
arr = arange(10000).reshape(100,100)
l = [arr,arr,arr,arr]
narr = array(l)
axes = []
fig = plt.figure()
for i in range(4):
 axes.append(fig.add_subplot(2, 2, i))
for ax, im in zip(axes, narr):
 ax.imshow(im, extent=[0,100,0,100])
plt.show()
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Michael A. <kmi...@gm...> - 2012年10月02日 19:34:43
>>>>>>>> 
>>>>>>> How nice of you to ask! ;)
>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where 
>>>>>>> shown with some white overhead area around, e.g. for an image of 100 
>>>>>>> pixels on the x-axis, the imshow resulted in an x-axis that went from 
>>>>>>> -10 to 110. I was looking for a simple way to suppress that behavior 
>>>>>>> and let imshow instead use the exact image extent. I believe that the 
>>>>>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
>>>>>>> range and not try to beautify the plot?
>>>>>>> 
>>>>>>> Michael
>>>>>> 
>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>> 
>>>>> 
>>>>> No, because it needs detail. I was looking for a boolean switch that 
>>>>> basically says: Respect the data, not beauty.
>>>> 
>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>> that doesn't do what you want?
>>>> 
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>> 
>>> 
>> 
>> The following script works for me:
>> 
>> import numpy as np
>> import matplotlib.pyplot as plt
>> 
>> image = np.random.random((100,50))
>> 
>> fig = plt.figure()
>> ax = fig.add_subplot(1, 1, 1)
>> ax.imshow(image, extent=[0,100,0,50])
>> plt.show()
>> 
>> 
> 
> I think the problem is that Michael is using ImageGrid, and apparently
> it is not using the tight autoscaling that imshow normally uses by default.
I might have confused where I had the problem as I was trying out many 
a'things yesterday, so today I only can reproduce it with subplots. Can 
I activate tight autoscaling somehow? tight_layout only influences the 
axes towards each-other not the imshows itself.
> 
> Eric
> 
> ------------------------------------------------------------------------------
> 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
From: Michael A. <kmi...@gm...> - 2012年10月02日 19:22:25
> >>>>>
> >>>> How nice of you to ask! ;)
> >>>> Indeed: I had the case that image arrays inside an ImageGrid where 
> shown with some white overhead area around, e.g. for an image of 100 
> pixels on the x-axis, the imshow resulted in an x-axis that went from 
> -10 to 110. I was looking for a simple way to suppress that behavior 
> and let imshow instead use the exact image extent. I believe that the 
> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
> range and not try to beautify the plot?
> >>>>
> >>>> Michael
> >>>>
> >>>
> >>> Is the 'extent' keyword what you're looking for?
> >>>
> >>
> >> No, because it needs detail. I was looking for a boolean switch that 
> basically says: Respect the data, not beauty.
> >
> > I don't understand what you mean by 'beauty'. If your image is 100
> > pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> > that doesn't do what you want?
> >
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
> 
> 
> Which version of matplotlib are you using? Also, are you on a 32-bit 
> machine or a 64-bit machine. This might be related to a bug we have 
> seen recently.
I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
Thanks for the effort Damon. I should have been starting with an 
example script from the beginning.
I believe the problem appears only for subplots in the case of sharex 
=sharey = True:
from matplotlib.pyplot import show, subplots
from numpy import arange, array
arr = arange(10000).reshape(100,100)
l = [arr,arr,arr,arr]
narr = array(l)
fig, axes = subplots(2,2,sharex=True,sharey=True)
for ax,im in zip(axes.flatten(),narr):
 ax.imshow(im)
show()
One can see that all the 4 axes show the array with an extent of 
[-10,110, 0, 100] here.
Michael
> 
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Eric F. <ef...@ha...> - 2012年10月02日 19:19:29
On 2012年10月02日 9:11 AM, Damon McDougall wrote:
> On Tue, Oct 2, 2012 at 8:07 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>
>> On Oct 2, 2012, at 12:06 PM, Damon McDougall <dam...@gm...> wrote:
>>
>>> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>>>
>>>> On Oct 2, 2012, at 11:09 AM, Damon McDougall <dam...@gm...> wrote:
>>>>
>>>>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>>>>>
>>>>>>
>>>>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall <dam...@gm...> wrote:
>>>>>>
>>>>>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...> wrote:
>>>>>>>>>
>>>>>>>>> Hi!
>>>>>>>>>
>>>>>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>>>>>> So what is it for?
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Michael
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>>>>>>>> have no recollection of this parameter, so it might be from before my time.
>>>>>>>>
>>>>>>>> Ben Root
>>>>>>>
>>>>>>> Is there some functionality you were looking for or were you just
>>>>>>> exploring the codebase?
>>>>>>>
>>>>>> How nice of you to ask! ;)
>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where shown with some white overhead area around, e.g. for an image of 100 pixels on the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I was looking for a simple way to suppress that behavior and let imshow instead use the exact image extent. I believe that the plot command has such a flag, hasn't it? (I.e. to use the exact xdata range and not try to beautify the plot?
>>>>>>
>>>>>> Michael
>>>>>>
>>>>>>
>>>>>>> --
>>>>>>> Damon McDougall
>>>>>>> http://www.damon-is-a-geek.com
>>>>>>> B2.39
>>>>>>> Mathematics Institute
>>>>>>> University of Warwick
>>>>>>> Coventry
>>>>>>> West Midlands
>>>>>>> CV4 7AL
>>>>>>> United Kingdom
>>>>>
>>>>> Is the 'extent' keyword what you're looking for?
>>>>>
>>>>
>>>> No, because it needs detail. I was looking for a boolean switch that basically says: Respect the data, not beauty.
>>>
>>> I don't understand what you mean by 'beauty'. If your image is 100
>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>> that doesn't do what you want?
>>>
>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>
>>
>>> --
>>> Damon McDougall
>>> http://www.damon-is-a-geek.com
>>> B2.39
>>> Mathematics Institute
>>> University of Warwick
>>> Coventry
>>> West Midlands
>>> CV4 7AL
>>> United Kingdom
>>
>
> The following script works for me:
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> image = np.random.random((100,50))
>
> fig = plt.figure()
> ax = fig.add_subplot(1, 1, 1)
> ax.imshow(image, extent=[0,100,0,50])
> plt.show()
>
>
I think the problem is that Michael is using ImageGrid, and apparently 
it is not using the tight autoscaling that imshow normally uses by default.
Eric
From: Benjamin R. <ben...@ou...> - 2012年10月02日 19:14:28
On Tue, Oct 2, 2012 at 3:07 PM, K.-Michael Aye <kmi...@gm...>wrote:
>
> On Oct 2, 2012, at 12:06 PM, Damon McDougall <dam...@gm...>
> wrote:
>
> > On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye <kmi...@gm...>
> wrote:
> >>
> >> On Oct 2, 2012, at 11:09 AM, Damon McDougall <dam...@gm...>
> wrote:
> >>
> >>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye <kmi...@gm...>
> wrote:
> >>>>
> >>>>
> >>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall <
> dam...@gm...> wrote:
> >>>>
> >>>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...>
> wrote:
> >>>>>>
> >>>>>>
> >>>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...>
> wrote:
> >>>>>>>
> >>>>>>> Hi!
> >>>>>>>
> >>>>>>> I see that the function ax.imshow takes the parameter 'imlim' but
> in
> >>>>>>> the source (status: EPD 7.3-2) it is not being used?
> >>>>>>> So what is it for?
> >>>>>>>
> >>>>>>> Best regards,
> >>>>>>> Michael
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>> Confirmed. I don't see imlim anywhere except in the imshow()
> signature. I
> >>>>>> have no recollection of this parameter, so it might be from before
> my time.
> >>>>>>
> >>>>>> Ben Root
> >>>>>
> >>>>> Is there some functionality you were looking for or were you just
> >>>>> exploring the codebase?
> >>>>>
> >>>> How nice of you to ask! ;)
> >>>> Indeed: I had the case that image arrays inside an ImageGrid where
> shown with some white overhead area around, e.g. for an image of 100 pixels
> on the x-axis, the imshow resulted in an x-axis that went from -10 to 110.
> I was looking for a simple way to suppress that behavior and let imshow
> instead use the exact image extent. I believe that the plot command has
> such a flag, hasn't it? (I.e. to use the exact xdata range and not try to
> beautify the plot?
> >>>>
> >>>> Michael
> >>>>
> >>>>
> >>>>> --
> >>>>> Damon McDougall
> >>>>> http://www.damon-is-a-geek.com
> >>>>> B2.39
> >>>>> Mathematics Institute
> >>>>> University of Warwick
> >>>>> Coventry
> >>>>> West Midlands
> >>>>> CV4 7AL
> >>>>> United Kingdom
> >>>
> >>> Is the 'extent' keyword what you're looking for?
> >>>
> >>
> >> No, because it needs detail. I was looking for a boolean switch that
> basically says: Respect the data, not beauty.
> >
> > I don't understand what you mean by 'beauty'. If your image is 100
> > pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> > that doesn't do what you want?
> >
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>
>
>
Which version of matplotlib are you using? Also, are you on a 32-bit
machine or a 64-bit machine. This might be related to a bug we have seen
recently.
Ben Root
From: Damon M. <dam...@gm...> - 2012年10月02日 19:11:37
On Tue, Oct 2, 2012 at 8:07 PM, K.-Michael Aye <kmi...@gm...> wrote:
>
> On Oct 2, 2012, at 12:06 PM, Damon McDougall <dam...@gm...> wrote:
>
>> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>>
>>> On Oct 2, 2012, at 11:09 AM, Damon McDougall <dam...@gm...> wrote:
>>>
>>>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>>>>
>>>>>
>>>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall <dam...@gm...> wrote:
>>>>>
>>>>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...> wrote:
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...> wrote:
>>>>>>>>
>>>>>>>> Hi!
>>>>>>>>
>>>>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>>>>> So what is it for?
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Michael
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>>>>>>> have no recollection of this parameter, so it might be from before my time.
>>>>>>>
>>>>>>> Ben Root
>>>>>>
>>>>>> Is there some functionality you were looking for or were you just
>>>>>> exploring the codebase?
>>>>>>
>>>>> How nice of you to ask! ;)
>>>>> Indeed: I had the case that image arrays inside an ImageGrid where shown with some white overhead area around, e.g. for an image of 100 pixels on the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I was looking for a simple way to suppress that behavior and let imshow instead use the exact image extent. I believe that the plot command has such a flag, hasn't it? (I.e. to use the exact xdata range and not try to beautify the plot?
>>>>>
>>>>> Michael
>>>>>
>>>>>
>>>>>> --
>>>>>> Damon McDougall
>>>>>> http://www.damon-is-a-geek.com
>>>>>> B2.39
>>>>>> Mathematics Institute
>>>>>> University of Warwick
>>>>>> Coventry
>>>>>> West Midlands
>>>>>> CV4 7AL
>>>>>> United Kingdom
>>>>
>>>> Is the 'extent' keyword what you're looking for?
>>>>
>>>
>>> No, because it needs detail. I was looking for a boolean switch that basically says: Respect the data, not beauty.
>>
>> I don't understand what you mean by 'beauty'. If your image is 100
>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>> that doesn't do what you want?
>>
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>
>
>> --
>> Damon McDougall
>> http://www.damon-is-a-geek.com
>> B2.39
>> Mathematics Institute
>> University of Warwick
>> Coventry
>> West Midlands
>> CV4 7AL
>> United Kingdom
>
The following script works for me:
import numpy as np
import matplotlib.pyplot as plt
image = np.random.random((100,50))
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.imshow(image, extent=[0,100,0,50])
plt.show()
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: K.-Michael A. <kmi...@gm...> - 2012年10月02日 19:07:50
On Oct 2, 2012, at 12:06 PM, Damon McDougall <dam...@gm...> wrote:
> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye <kmi...@gm...> wrote:
>> 
>> On Oct 2, 2012, at 11:09 AM, Damon McDougall <dam...@gm...> wrote:
>> 
>>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>>> 
>>>> 
>>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall <dam...@gm...> wrote:
>>>> 
>>>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...> wrote:
>>>>>> 
>>>>>> 
>>>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...> wrote:
>>>>>>> 
>>>>>>> Hi!
>>>>>>> 
>>>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>>>> So what is it for?
>>>>>>> 
>>>>>>> Best regards,
>>>>>>> Michael
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>>>>>> have no recollection of this parameter, so it might be from before my time.
>>>>>> 
>>>>>> Ben Root
>>>>> 
>>>>> Is there some functionality you were looking for or were you just
>>>>> exploring the codebase?
>>>>> 
>>>> How nice of you to ask! ;)
>>>> Indeed: I had the case that image arrays inside an ImageGrid where shown with some white overhead area around, e.g. for an image of 100 pixels on the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I was looking for a simple way to suppress that behavior and let imshow instead use the exact image extent. I believe that the plot command has such a flag, hasn't it? (I.e. to use the exact xdata range and not try to beautify the plot?
>>>> 
>>>> Michael
>>>> 
>>>> 
>>>>> --
>>>>> Damon McDougall
>>>>> http://www.damon-is-a-geek.com
>>>>> B2.39
>>>>> Mathematics Institute
>>>>> University of Warwick
>>>>> Coventry
>>>>> West Midlands
>>>>> CV4 7AL
>>>>> United Kingdom
>>> 
>>> Is the 'extent' keyword what you're looking for?
>>> 
>> 
>> No, because it needs detail. I was looking for a boolean switch that basically says: Respect the data, not beauty.
> 
> I don't understand what you mean by 'beauty'. If your image is 100
> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> that doesn't do what you want?
> 
As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
> -- 
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
From: Damon M. <dam...@gm...> - 2012年10月02日 19:06:42
On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye <kmi...@gm...> wrote:
>
> On Oct 2, 2012, at 11:09 AM, Damon McDougall <dam...@gm...> wrote:
>
>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye <kmi...@gm...> wrote:
>>>
>>>
>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall <dam...@gm...> wrote:
>>>
>>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...> wrote:
>>>>>
>>>>>
>>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...> wrote:
>>>>>>
>>>>>> Hi!
>>>>>>
>>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>>> So what is it for?
>>>>>>
>>>>>> Best regards,
>>>>>> Michael
>>>>>>
>>>>>>
>>>>>
>>>>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>>>>> have no recollection of this parameter, so it might be from before my time.
>>>>>
>>>>> Ben Root
>>>>
>>>> Is there some functionality you were looking for or were you just
>>>> exploring the codebase?
>>>>
>>> How nice of you to ask! ;)
>>> Indeed: I had the case that image arrays inside an ImageGrid where shown with some white overhead area around, e.g. for an image of 100 pixels on the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I was looking for a simple way to suppress that behavior and let imshow instead use the exact image extent. I believe that the plot command has such a flag, hasn't it? (I.e. to use the exact xdata range and not try to beautify the plot?
>>>
>>> Michael
>>>
>>>
>>>> --
>>>> Damon McDougall
>>>> http://www.damon-is-a-geek.com
>>>> B2.39
>>>> Mathematics Institute
>>>> University of Warwick
>>>> Coventry
>>>> West Midlands
>>>> CV4 7AL
>>>> United Kingdom
>>
>> Is the 'extent' keyword what you're looking for?
>>
>
> No, because it needs detail. I was looking for a boolean switch that basically says: Respect the data, not beauty.
I don't understand what you mean by 'beauty'. If your image is 100
pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
that doesn't do what you want?
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Michael A. <kmi...@gm...> - 2012年10月02日 19:05:00
On 2012年10月02日 18:10:01 +0000, Damon McDougall said:
> Forgot to reply all. Sorry.
> 
> 
> ---------- Forwarded message ----------
> From: Damon McDougall <dam...@gm...>
> Date: Tue, Oct 2, 2012 at 7:09 PM
> Subject: Re: [Matplotlib-users] imlim in ax.imshow
> To: "K.-Michael Aye" <kmi...@gm...>
> 
> 
> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye 
> <kmi...@gm...> wrote:
>> 
>> 
>> On Oct 2, 2012, at 6:33 AM, Damon McDougall 
>> <dam...@gm...> wrote:
>> 
>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root 
>>> <ben...@ou...> wrote:
>>>> 
>>>> 
>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye 
>>>> <kmi...@gm...> wrote:
>>>>> 
>>>>> Hi!
>>>>> 
>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>> So what is it for?
>>>>> 
>>>>> Best regards,
>>>>> Michael
>>>>> 
>>>>> 
>>>> 
>>>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>>>> have no recollection of this parameter, so it might be from before my time.
>>>> 
>>>> Ben Root
>>> 
>>> Is there some functionality you were looking for or were you just
>>> exploring the codebase?
>>> 
>> How nice of you to ask! ;)
>> Indeed: I had the case that image arrays inside an ImageGrid where 
>> shown with some white overhead area around, e.g. for an image of 100 
>> pixels on the x-axis, the imshow resulted in an x-axis that went from 
>> -10 to 110. I was looking for a simple way to suppress that behavior 
>> and let imshow instead use the exact image extent. I believe that the 
>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
>> range and not try to beautify the plot?
>> 
>> Michael
>> 
>> 
>>> --
>>> Damon McDougall
>>> http://www.damon-is-a-geek.com
>>> B2.39
>>> Mathematics Institute
>>> University of Warwick
>>> Coventry
>>> West Midlands
>>> CV4 7AL
>>> United Kingdom
> 
> Is the 'extent' keyword what you're looking for?
No, because it requires input. I am looking for a boolean switch that 
says something along the lines: Respect the data, not beauty. Show 
exactly like the data is.
> 
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
On Tue, Oct 2, 2012 at 2:34 PM, Eric Firing <ef...@ha...> wrote:
> On 2012年10月02日 8:08 AM, Jianbao Tao wrote:
> > 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()*
>
> No, this sort of flexibility has been at least on the mental wish-list
> for a long time, but it is not available. It would require substantial
> work on all of the gui backends.
>
> Eric
>
>
Note, however, code has been improved for the 1.2.0 release to make it
easier to modify the set of buttons that are used. In backend_bases.py,
look for the NavigationToolbar2 class.
Cheers!
Ben Root
On 2012年10月02日 8:08 AM, Jianbao Tao wrote:
> 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()*
No, this sort of flexibility has been at least on the mental wish-list 
for a long time, but it is not available. It would require substantial 
work on all of the gui backends.
Eric
>
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Damon M. <dam...@gm...> - 2012年10月02日 18:14:35
On Tue, Oct 2, 2012 at 6:07 PM, Eric Firing <ef...@ha...> wrote:
> On 2012年10月02日 4:12 AM, Mic wrote:
>> Hi Eric,
>> I have a dataset which contains about 4600 values.
>>
>> Is it possible to display 4600 values with a bar char and labels?
>>
>> Thank you in advance.
>
> Mic,
>
> I don't think so, as a practical matter. A screen doesn't even have
> that many pixels of width.
>
> Eric
>
>>
>>
>>
>> On Tue, Oct 2, 2012 at 4:04 PM, Eric Firing <ef...@ha...
>> <mailto:ef...@ha...>> wrote:
>>
>> On 2012年10月01日 7:28 PM, Mic wrote:
>> > Hi,
>> >
>> > I have got the following error with the following code:
>> > /$ python mpl.py/ <http://mpl.py/>
>> > /Traceback (most recent call last):/
>> > / File
>> >
>> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
>> > line 398, in expose_event/
>> > / self._render_figure(self._pixmap, w, h)/
>> > / File
>> >
>> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
>> > line 75, in _render_figure/
>> > / FigureCanvasAgg.draw(self)/
>> > / File
>> >
>> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
>> > line 416, in draw/
>> > / self.renderer = self.get_renderer()/
>> > / File
>> >
>> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
>> > line 435, in get_renderer/
>> > / self.renderer = RendererAgg(w, h, self.figure.dpi)/
>> > / File
>> >
>> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
>> > line 72, in __init__/
>> > / self._renderer = _RendererAgg(int(width), int(height), dpi,
>> > debug=False)/
>> > /ValueError: width and height must each be below 32768/
>> > /The program 'mpl.py' received an X Window System error./
>> > /This probably reflects a bug in the program./
>> > /The error was 'BadAlloc (insufficient resources for operation)'./
>> > / (Details: serial 486 error_code 11 request_code 53 minor_code 0)/
>> > / (Note to programmers: normally, X errors are reported
>> asynchronously;/
>> > / that is, you will receive the error a while after causing it./
>> > / To debug your program, run it with the --sync command line/
>> > / option to change this behavior. You can then get a meaningful/
>> > / backtrace from your debugger if you break on the gdk_x_error()
>> > function.)/
>> >
>> > With the following code:
>> > /import random /
>> > /import matplotlib.pyplot as plt /
>> > //
>> > /coverages = [random.randint(1,10)*2] * 4605 /
>> > /contig_names = ['AAB0008r'] * len(coverages) /
>> > /# Set the figure size /
>> > /#fig = plt.figure(1, [20, 2]) /
>> > /fig = plt.figure(figsize=(int(len(coverages)*0.1), 4)) /
>> > //
>> > /ax = fig.add_subplot(111) /
>> > //
>> > /# Set the x-axis limit /
>> > /#ax.set_xlim(-1,100) /
>> > /ax.set_xlim(0,len(coverages)) /
>> > /#ax.set_ylim(0,3) /
>> > /ax.yaxis.grid(True, linestyle='-', which='major', color='grey',
>> > alpha=0.5) /
>> > //
>> > /ind = range(len(coverages)) /
>> > /rects = ax.bar(ind, coverages, width=0.1, align='center',
>> > color='thistle') /
>> > /ax.set_xticks(ind) /
>> > /#ax.set_xticklabels(contig_names)/
>> > /#ax.tick_params(axis='both', which='major', labelsize=10)/
>> > /#ax.tick_params(axis='both', which='minor', labelsize=8)/
>> > /
>> > /
>> > /
>> > /
>> > /#function to auto-rotate the x axis labels/
>> > /fig.autofmt_xdate()/
>> > /plt.setp(ax.get_xticklabels(), fontsize=8, rotation='vertical')/
>> > /plt.show()/
>> >
>> > How is it possible to get big charts?
>>
>> It looks like you are trying to make a figure that is 460 inches by 4
>> inches. How do you expect to display or print it? I think displaying
>> it is out of the question, so you would need to use a non-interactive
>> backend. I don't know whether ps or pdf can handle those sorts of
>> dimensions.
>>
>> Eric
>>
>> >
>> > Thank you in advance.
If you have that much data, a bar chart is probably not the way to go.
Maybe try taking the height of what would be each bar and using that
as a y-coordinate array then call plt.plot(y)? You'll get a line plot,
and the x axis may not make a huge amount of sense, but at least
you'll see all your data.
Or, perhaps even a histogram?
It's hard to advise without knowing your application, but that should
help at least a little. Good luck!
Best wishes,
Damon
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Damon M. <dam...@gm...> - 2012年10月02日 18:10:12
Forgot to reply all. Sorry.
---------- Forwarded message ----------
From: Damon McDougall <dam...@gm...>
Date: Tue, Oct 2, 2012 at 7:09 PM
Subject: Re: [Matplotlib-users] imlim in ax.imshow
To: "K.-Michael Aye" <kmi...@gm...>
On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye <kmi...@gm...> wrote:
>
>
> On Oct 2, 2012, at 6:33 AM, Damon McDougall <dam...@gm...> wrote:
>
>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...> wrote:
>>>
>>>
>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...> wrote:
>>>>
>>>> Hi!
>>>>
>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>> the source (status: EPD 7.3-2) it is not being used?
>>>> So what is it for?
>>>>
>>>> Best regards,
>>>> Michael
>>>>
>>>>
>>>
>>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>>> have no recollection of this parameter, so it might be from before my time.
>>>
>>> Ben Root
>>
>> Is there some functionality you were looking for or were you just
>> exploring the codebase?
>>
> How nice of you to ask! ;)
> Indeed: I had the case that image arrays inside an ImageGrid where shown with some white overhead area around, e.g. for an image of 100 pixels on the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I was looking for a simple way to suppress that behavior and let imshow instead use the exact image extent. I believe that the plot command has such a flag, hasn't it? (I.e. to use the exact xdata range and not try to beautify the plot?
>
> Michael
>
>
>> --
>> Damon McDougall
>> http://www.damon-is-a-geek.com
>> B2.39
>> Mathematics Institute
>> University of Warwick
>> Coventry
>> West Midlands
>> CV4 7AL
>> United Kingdom
Is the 'extent' keyword what you're looking for?
--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Jianbao T. <jia...@gm...> - 2012年10月02日 18:08:56
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.
From: Eric F. <ef...@ha...> - 2012年10月02日 17:07:56
On 2012年10月02日 4:12 AM, Mic wrote:
> Hi Eric,
> I have a dataset which contains about 4600 values.
>
> Is it possible to display 4600 values with a bar char and labels?
>
> Thank you in advance.
Mic,
I don't think so, as a practical matter. A screen doesn't even have 
that many pixels of width.
Eric
>
>
>
> On Tue, Oct 2, 2012 at 4:04 PM, Eric Firing <ef...@ha...
> <mailto:ef...@ha...>> wrote:
>
> On 2012年10月01日 7:28 PM, Mic wrote:
> > Hi,
> >
> > I have got the following error with the following code:
> > /$ python mpl.py/ <http://mpl.py/>
> > /Traceback (most recent call last):/
> > / File
> >
> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
> > line 398, in expose_event/
> > / self._render_figure(self._pixmap, w, h)/
> > / File
> >
> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
> > line 75, in _render_figure/
> > / FigureCanvasAgg.draw(self)/
> > / File
> >
> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
> > line 416, in draw/
> > / self.renderer = self.get_renderer()/
> > / File
> >
> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
> > line 435, in get_renderer/
> > / self.renderer = RendererAgg(w, h, self.figure.dpi)/
> > / File
> >
> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
> > line 72, in __init__/
> > / self._renderer = _RendererAgg(int(width), int(height), dpi,
> > debug=False)/
> > /ValueError: width and height must each be below 32768/
> > /The program 'mpl.py' received an X Window System error./
> > /This probably reflects a bug in the program./
> > /The error was 'BadAlloc (insufficient resources for operation)'./
> > / (Details: serial 486 error_code 11 request_code 53 minor_code 0)/
> > / (Note to programmers: normally, X errors are reported
> asynchronously;/
> > / that is, you will receive the error a while after causing it./
> > / To debug your program, run it with the --sync command line/
> > / option to change this behavior. You can then get a meaningful/
> > / backtrace from your debugger if you break on the gdk_x_error()
> > function.)/
> >
> > With the following code:
> > /import random /
> > /import matplotlib.pyplot as plt /
> > //
> > /coverages = [random.randint(1,10)*2] * 4605 /
> > /contig_names = ['AAB0008r'] * len(coverages) /
> > /# Set the figure size /
> > /#fig = plt.figure(1, [20, 2]) /
> > /fig = plt.figure(figsize=(int(len(coverages)*0.1), 4)) /
> > //
> > /ax = fig.add_subplot(111) /
> > //
> > /# Set the x-axis limit /
> > /#ax.set_xlim(-1,100) /
> > /ax.set_xlim(0,len(coverages)) /
> > /#ax.set_ylim(0,3) /
> > /ax.yaxis.grid(True, linestyle='-', which='major', color='grey',
> > alpha=0.5) /
> > //
> > /ind = range(len(coverages)) /
> > /rects = ax.bar(ind, coverages, width=0.1, align='center',
> > color='thistle') /
> > /ax.set_xticks(ind) /
> > /#ax.set_xticklabels(contig_names)/
> > /#ax.tick_params(axis='both', which='major', labelsize=10)/
> > /#ax.tick_params(axis='both', which='minor', labelsize=8)/
> > /
> > /
> > /
> > /
> > /#function to auto-rotate the x axis labels/
> > /fig.autofmt_xdate()/
> > /plt.setp(ax.get_xticklabels(), fontsize=8, rotation='vertical')/
> > /plt.show()/
> >
> > How is it possible to get big charts?
>
> It looks like you are trying to make a figure that is 460 inches by 4
> inches. How do you expect to display or print it? I think displaying
> it is out of the question, so you would need to use a non-interactive
> backend. I don't know whether ps or pdf can handle those sorts of
> dimensions.
>
> Eric
>
> >
> > Thank you in advance.
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > Mat...@li...
> <mailto:Mat...@li...>
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jonathan S. <js...@cf...> - 2012年10月02日 17:01:07
Hi all,
I'm trying to make a plot with several lines, each with a different
grayscale color. I thought I could do something like 
clrs = ['0.125', '0.25', '0.375', '0.5', '0.625', '0.75', '0.875',
'1.0']
and then either set the color cycle using clrs or just use the
color=clrs[i] argument in a loop that draws the lines. This kind of
works, but it seems that there's some autoscaling going on. If I use
values ranging from 0 to 1, the curve with 0 doesn't show up at all
(which I would expect) and the curve with 1 is black. If I use values
ranging from 0.5 to 1, the curve with 0.5 doesn't show up and the curve
with 1 is gray instead of black. What gives? How can I get a set of
curves with gray values ranging from medium gray to black?
As a simple demo if I do:
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm as cmap
x = np.linspace(0,1.,num=10)
y1 = 0.5*x
y2 = 0.4*x
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.plot(x,y1,color='0.5')
ax.plot(x,y2,color='1.0')
ax.legend(['y1','y2'])
plt.show()
I get a single visible line that is a sort of medium gray.
Jon
-- 
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
 cell: (781) 363-0035 USA
______________________________________________________________
From: K.-Michael A. <kmi...@gm...> - 2012年10月02日 16:50:59
On Oct 2, 2012, at 6:33 AM, Damon McDougall <dam...@gm...> wrote:
> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root <ben...@ou...> wrote:
>> 
>> 
>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye <kmi...@gm...> wrote:
>>> 
>>> Hi!
>>> 
>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>> the source (status: EPD 7.3-2) it is not being used?
>>> So what is it for?
>>> 
>>> Best regards,
>>> Michael
>>> 
>>> 
>> 
>> Confirmed. I don't see imlim anywhere except in the imshow() signature. I
>> have no recollection of this parameter, so it might be from before my time.
>> 
>> Ben Root
> 
> Is there some functionality you were looking for or were you just
> exploring the codebase?
> 
How nice of you to ask! ;)
Indeed: I had the case that image arrays inside an ImageGrid where shown with some white overhead area around, e.g. for an image of 100 pixels on the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I was looking for a simple way to suppress that behavior and let imshow instead use the exact image extent. I believe that the plot command has such a flag, hasn't it? (I.e. to use the exact xdata range and not try to beautify the plot?
Michael
> -- 
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
From: Jonathan S. <js...@cf...> - 2012年10月02日 16:47:14
D'oh! Caught my mistake. I was thinking of the grayscale backwards.
color = '1.0' is white not black! Got it working now.
Jon
-- 
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
 cell: (781) 363-0035 USA
______________________________________________________________
From: Tony Yu <ts...@gm...> - 2012年10月02日 15:38:41
On Tue, Oct 2, 2012 at 11:04 AM, Benjamin Root <ben...@ou...> wrote:
>
>
> On Tue, Oct 2, 2012 at 8:31 AM, William Furnass <wi...@th...>wrote:
>
>> Did anything ever come of the MPL black and white mode mentioned in
>> the following? I rarely want to produce colour plots and having an
>> inbuilt mechanism for cycling through line styles that can be
>> activated with a keyword argument would be very handy.
>>
>>
>> http://www.mail-archive.com/mat...@li.../msg00367.html
>>
>> Cheers,
>>
>> Will
>>
>>
> Perhap's Tony Yu's mpltools might be the closest we have gotten to this
> goal. There has been a number of technical hurdles that I have not had the
> time or resources to iron out. Hopefully, it will be helpful to you.
>
> http://tonysyu.github.com/mpltools/getting_started.html
>
> Cheers!
> Ben Root
>
Thanks for the advertisement Ben ;)
Will: If you're just interested in grayscale plotting, here's a direct link
to the example:
http://tonysyu.github.com/mpltools/auto_examples/style/plot_grayscale.html
The discussion that you link to talks specifically about line styles. In
the past there's been discussion of adding a linestyle cycle rc param, but
I don't think there's been progress on that front.
BTW, Ben: are you still thinking about some sort of hierarchical
configuration management? I think it'd make a great MEP, if you find the
time.
Best,
-Tony
From: Benjamin R. <ben...@ou...> - 2012年10月02日 15:05:23
On Tue, Oct 2, 2012 at 8:31 AM, William Furnass <wi...@th...> wrote:
> Did anything ever come of the MPL black and white mode mentioned in
> the following? I rarely want to produce colour plots and having an
> inbuilt mechanism for cycling through line styles that can be
> activated with a keyword argument would be very handy.
>
>
> http://www.mail-archive.com/mat...@li.../msg00367.html
>
> Cheers,
>
> Will
>
>
Perhap's Tony Yu's mpltools might be the closest we have gotten to this
goal. There has been a number of technical hurdles that I have not had the
time or resources to iron out. Hopefully, it will be helpful to you.
http://tonysyu.github.com/mpltools/getting_started.html
Cheers!
Ben Root
From: Mic <mic...@gm...> - 2012年10月02日 14:12:52
Hi Eric,
I have a dataset which contains about 4600 values.
Is it possible to display 4600 values with a bar char and labels?
Thank you in advance.
On Tue, Oct 2, 2012 at 4:04 PM, Eric Firing <ef...@ha...> wrote:
> On 2012年10月01日 7:28 PM, Mic wrote:
> > Hi,
> >
> > I have got the following error with the following code:
> > /$ python mpl.py/
> > /Traceback (most recent call last):/
> > / File
> > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtk.py",
> > line 398, in expose_event/
> > / self._render_figure(self._pixmap, w, h)/
> > / File
> >
> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py",
> > line 75, in _render_figure/
> > / FigureCanvasAgg.draw(self)/
> > / File
> > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
> > line 416, in draw/
> > / self.renderer = self.get_renderer()/
> > / File
> > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
> > line 435, in get_renderer/
> > / self.renderer = RendererAgg(w, h, self.figure.dpi)/
> > / File
> > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py",
> > line 72, in __init__/
> > / self._renderer = _RendererAgg(int(width), int(height), dpi,
> > debug=False)/
> > /ValueError: width and height must each be below 32768/
> > /The program 'mpl.py' received an X Window System error./
> > /This probably reflects a bug in the program./
> > /The error was 'BadAlloc (insufficient resources for operation)'./
> > / (Details: serial 486 error_code 11 request_code 53 minor_code 0)/
> > / (Note to programmers: normally, X errors are reported asynchronously;/
> > / that is, you will receive the error a while after causing it./
> > / To debug your program, run it with the --sync command line/
> > / option to change this behavior. You can then get a meaningful/
> > / backtrace from your debugger if you break on the gdk_x_error()
> > function.)/
> >
> > With the following code:
> > /import random /
> > /import matplotlib.pyplot as plt /
> > //
> > /coverages = [random.randint(1,10)*2] * 4605 /
> > /contig_names = ['AAB0008r'] * len(coverages) /
> > /# Set the figure size /
> > /#fig = plt.figure(1, [20, 2]) /
> > /fig = plt.figure(figsize=(int(len(coverages)*0.1), 4)) /
> > //
> > /ax = fig.add_subplot(111) /
> > //
> > /# Set the x-axis limit /
> > /#ax.set_xlim(-1,100) /
> > /ax.set_xlim(0,len(coverages)) /
> > /#ax.set_ylim(0,3) /
> > /ax.yaxis.grid(True, linestyle='-', which='major', color='grey',
> > alpha=0.5) /
> > //
> > /ind = range(len(coverages)) /
> > /rects = ax.bar(ind, coverages, width=0.1, align='center',
> > color='thistle') /
> > /ax.set_xticks(ind) /
> > /#ax.set_xticklabels(contig_names)/
> > /#ax.tick_params(axis='both', which='major', labelsize=10)/
> > /#ax.tick_params(axis='both', which='minor', labelsize=8)/
> > /
> > /
> > /
> > /
> > /#function to auto-rotate the x axis labels/
> > /fig.autofmt_xdate()/
> > /plt.setp(ax.get_xticklabels(), fontsize=8, rotation='vertical')/
> > /plt.show()/
> >
> > How is it possible to get big charts?
>
> It looks like you are trying to make a figure that is 460 inches by 4
> inches. How do you expect to display or print it? I think displaying
> it is out of the question, so you would need to use a non-interactive
> backend. I don't know whether ps or pdf can handle those sorts of
> dimensions.
>
> Eric
>
> >
> > Thank you in advance.
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

Showing results of 32

1 2 > >> (Page 1 of 2)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /