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
(27)
2
(15)
3
(2)
4
(4)
5
(5)
6
(9)
7
(15)
8
(24)
9
(19)
10
(7)
11
(13)
12
(26)
13
(27)
14
(17)
15
(14)
16
(12)
17
(9)
18
(12)
19
(17)
20
(19)
21
(5)
22
(5)
23
(7)
24
(4)
25
(1)
26
(9)
27
(20)
28
(5)
29
(10)
30
(12)
31
(6)

Showing results of 368

1 2 3 .. 15 > >> (Page 1 of 15)
From: Eric F. <ef...@ha...> - 2012年03月31日 17:53:34
On 03/31/2012 04:02 AM, Magician wrote:
> Alexis& Eric
>
>
> Thanks for your advices.
> I've been trying, but I still have some problems.
>
> I tried matplotlib.matplotlib_fname() and I found my silly mistake.
> Python answered '/usr/local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc'
> My RC file was named ".matplotlibrc".
> When the prefixed dot removed, it works perfectly.
>
> And I found to change the backends by using matplotlib.use() command.
> I tried all of them, but nothing worked (with errors).
>
> When using matplotlib.get_backend() on pre-installed python2.6,
> it said 'GTKAgg' and matplotlib.pyplot.show() exactly worked.
> So I tried to install PyGTK from source code, but it's fairly complicated.
>
> Is there an easy way to install backends for additionally installed Python?
> My python is v2.7.2.
Can you find CentOS packages for any of the gui toolkits for your python 
version? pygtk, pyqt4, tkinter, wxpython--any of them? If so, you 
should be just about set. Only pygtk and tkinter would even require 
rebuilding mpl; pyqt4 and wxpython don't require any mpl extension code.
Eric
>
>
> Magician
>
>
> On 2012年03月27日, at 23:04, Alexis Praga wrote:
>
>> You can check you are editing the correct configuration file with (in
>> the Python shell) :
>>>>> import matplotlib
>>>>> matplotlib.matplotlib_fname()
>>
>> You can also try other backends. For a list, see :
>> http://matplotlib.sourceforge.net/faq/usage_faq.html#what-is-a-backend
>>
>> On Tue, Mar 27, 2012 at 2:46 PM, Magician<f_m...@ma...> wrote:
>>> Thank you, Alexis.
>>>
>>> I try to install PyQt4 and set Qt4Agg just now, but nothing displayed.
>>> Ummm...what's wrong...??
>>>
>>>
>>> Magician
>>>
>>>
>>> On 2012年03月27日, at 17:05, Alexis Praga wrote:
>>>
>>>> I had the same problem on Debian.
>>>> Editing the matplotlibrc (should be installed somewhere in your
>>>> systeme) and changing the "backend" variable to Qt4Agg did the trick.
>>>>
>>>>
>>>>
>>>> On Tue, Mar 27, 2012 at 12:14 AM, Magician<f_m...@ma...> wrote:
>>>>> Hi.
>>>>>
>>>>> I want to install Matplotlib from source code on CentOS.
>>>>> I've been using Matplotlib for a year.
>>>>> But this is the first time for me to install CentOS by myself.
>>>>>
>>>>> I installed CentOS 6.2 in basic install option.
>>>>> Next, I installed NumPy and Matplotlib.
>>>>> .matplotlibrc isn't set.
>>>>>
>>>>> It looks successfully installed, but when I type show() command,
>>>>> nothing appears.
>>>>> I can export PNG image by using savefig() command, so maybe
>>>>> I'm using invalid backend.
>>>>>
>>>>> How can I display plots with show() command?
>>>>>
>>>>>
>>>>> Magician
>>>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Marston <she...@gm...> - 2012年03月31日 17:26:09
Hi,
I'm trying to create a plot, with subplots where each row of x plots have a
common colorbar beneath it. Only the the top row will have titles. I've
tried creating a function to do this but I only achieve partial success.
Here is an image created in another program that I want to duplicate:
http://old.nabble.com/file/p33544950/fig.jpeg 
 
I made several functions to do this. Here's one of them:
def Plot(self,title,plist):
 for k in np.sort(self.vdic.keys()): 
 plt.subplot(5,13,self.window) 
 cs = plt.contourf(22,22,np.squeeze(self.vdic[k]),plist['levels'], 
 cmap=cm.get_cmap('jet',len(plist['levels'])-1)) 
 plt.axis('off') 
 if title: plt.title(k,fontsize=tsize) 
 window += 1 
 cbar = plt.colorbar(cax=plist['cax'],orientation='h') 
 
I've given up in getting the text on the left because every attempt using
text fails.
Now if this is a horrible way and you have a better idea, please feel free
to share.
I'm new at matplotlib and this is a great way to see how things can be done
better
and in different ways. 
-- 
View this message in context: http://old.nabble.com/Subplot-array-and-colorbar-tp33544950p33544950.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Paul H. <pmh...@gm...> - 2012年03月31日 16:34:38
How did you install Python 2.7? None of my windows machines have ever
hand any problem finding it when I installed from the official
binaries found at python.org.
-paul
On Fri, Mar 30, 2012 at 9:56 AM, Mateusz J Burgunder
<mbu...@we...> wrote:
> Hello,
>
> I am trying to download matplot (matplotlib-1.1.0) but at the start of the
> download I get a screen that says "Python version 2.7 required, which was
> not found in the registry."
> I have python 2.7. Where exactly should I save mathplotlib so that it can
> find python for the installation?
>
> Many thanks,
> Matt.
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Tony Yu <ts...@gm...> - 2012年03月31日 16:33:43
On Fri, Mar 30, 2012 at 12:25 PM, eoj <jos...@gm...> wrote:
>
> Basically the problem is like this. I have a relatively expensive (time
> wise)
> figure to create, specifically a map with lots of detail in it. On top of
> that, I'm making an inset set of axes to highlight some regions. I'm
> having
> to recreate the base of the map, which is static, every time I want to make
> an inset for a different region which is taking forever. What I want to do
> is something like this:
>
> fig = figure()
>
> #do stuff that makes the expensive figure
>
> for region in regions:
> fig2 = copy.copy(fig)
> ax2 = fig.add_axes([0.1, 0.15, 0.25, 0.25])
> ax2.fill(x1,y1)
> savefig(region_name)
> close()
>
>
>
> The problem is that the clf() clear figure function seems to clear the base
> of the map off, even if I try to make a copy of it inside a loop that is
> generating the insets. Also, close() seems to close fig and not fig2. Does
> this rambling make any sense, and if so, any suggestions?
>
>
If all your additions are confined to the inset axes, you can use
`fig.delaxes` to remove the axes from the figure (see example below). If
you want to save and restore, as you describe above, you should (in
principal) be able to do so with `canvas.copy_from_bbox` and
`canvas.restore_region`, but I couldn't get it to work (see bottom of the
animation cookbook <http://www.scipy.org/Cookbook/Matplotlib/Animations>).
Cheers,
-Tony
# ~~~ example
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.imshow(np.random.uniform(size=(10, 10)))
ax_inset = fig.add_axes([0.3, 0.3, 0.2, 0.2])
ax_inset.plot([0, 1])
plt.savefig('plot0')
fig.delaxes(ax_inset)
ax_inset = fig.add_axes([0.5, 0.5, 0.2, 0.2])
ax_inset.plot([1, 0])
plt.savefig('plot1')
# ~~~
From: Magician <f_m...@ma...> - 2012年03月31日 14:02:48
Alexis & Eric
Thanks for your advices.
I've been trying, but I still have some problems.
I tried matplotlib.matplotlib_fname() and I found my silly mistake.
Python answered '/usr/local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc'
My RC file was named ".matplotlibrc".
When the prefixed dot removed, it works perfectly.
And I found to change the backends by using matplotlib.use() command.
I tried all of them, but nothing worked (with errors).
When using matplotlib.get_backend() on pre-installed python2.6,
it said 'GTKAgg' and matplotlib.pyplot.show() exactly worked.
So I tried to install PyGTK from source code, but it's fairly complicated.
Is there an easy way to install backends for additionally installed Python?
My python is v2.7.2.
Magician
On 2012年03月27日, at 23:04, Alexis Praga wrote:
> You can check you are editing the correct configuration file with (in
> the Python shell) :
>>>> import matplotlib
>>>> matplotlib.matplotlib_fname()
> 
> You can also try other backends. For a list, see :
> http://matplotlib.sourceforge.net/faq/usage_faq.html#what-is-a-backend
> 
> On Tue, Mar 27, 2012 at 2:46 PM, Magician <f_m...@ma...> wrote:
>> Thank you, Alexis.
>> 
>> I try to install PyQt4 and set Qt4Agg just now, but nothing displayed.
>> Ummm...what's wrong...??
>> 
>> 
>> Magician
>> 
>> 
>> On 2012年03月27日, at 17:05, Alexis Praga wrote:
>> 
>>> I had the same problem on Debian.
>>> Editing the matplotlibrc (should be installed somewhere in your
>>> systeme) and changing the "backend" variable to Qt4Agg did the trick.
>>> 
>>> 
>>> 
>>> On Tue, Mar 27, 2012 at 12:14 AM, Magician <f_m...@ma...> wrote:
>>>> Hi.
>>>> 
>>>> I want to install Matplotlib from source code on CentOS.
>>>> I've been using Matplotlib for a year.
>>>> But this is the first time for me to install CentOS by myself.
>>>> 
>>>> I installed CentOS 6.2 in basic install option.
>>>> Next, I installed NumPy and Matplotlib.
>>>> .matplotlibrc isn't set.
>>>> 
>>>> It looks successfully installed, but when I type show() command,
>>>> nothing appears.
>>>> I can export PNG image by using savefig() command, so maybe
>>>> I'm using invalid backend.
>>>> 
>>>> How can I display plots with show() command?
>>>> 
>>>> 
>>>> Magician
>> 
From: David C. <dcd...@gm...> - 2012年03月31日 11:48:16
Hi, I previously installed basemap by using the yum command. This installed
version 0.99.4. I want to install the latest version so I can use shaded
relief etc. This may be more of a linux problem but as I am more familiar
with python than linux I thought someone here may be able to help.
Following the website instructions (
http://matplotlib.github.com/basemap/users/installing.html) I downloaded
the latest version and untarred it. Then in the basemap directory (which
contains geos-3.2.0) I try to set the environment variable GEOS_DIR to
point to the location of libgeos_c and geos_c.h.
I use the find command to locate the files,
*find / -name geos_c.h* returns the location of that file as *
/usr/lib/basemap-1.0.1/geos-3.2.0/capi/geos_c.h*
and
*find / -name libgeos**
returns
*/libgeos_c_la-geos_c.Plo
/usr/lib/libgeos-3.3.1.so
/usr/lib/libgeos_c.so.1.7.1
/usr/lib/libgeos_c.so.1*
so I set GEOS_DIR to /usr/lib (not sure if this is correct).
I then cd to the basemap directory and run,
python setup.py install
[davcra@David basemap-1.0.1]$ sudo python setup.py install
[sudo] password for davcra:
checking for GEOS lib in /root ....
checking for GEOS lib in /usr ....
checking for GEOS lib in /usr/local ....
checking for GEOS lib in /sw ....
checking for GEOS lib in /opt ....
checking for GEOS lib in /opt/local ....
Can't find geos library . Please set the
environment variable GEOS_DIR to point to the location
where geos is installed (for example, if geos_c.h
is in /usr/local/include, and libgeos_c is in /usr/local/lib,
set GEOS_DIR to /usr/local), or edit the setup.py script
manually and set the variable GEOS_dir (right after the line
that says "set GEOS_dir manually here".
The problem seems to be with GEOS_DIR but I am not sure what I should set
it to.
Thanks
D
From: Emmanuel M. <ema...@ya...> - 2012年03月30日 23:23:43
Hello all,
I can create a figure
and get the corresponding axes/plots 
for examples:
1/
fig = Figure(figsize=(width, height), dpi=dpi)
ax = gif.add_subplot(111)
2/
fig, ax = plt.subplots()
but I would like to create my plot independently from the figure and assign it to a figure
I code I would like to do something like this
my_ax = Axes(...)
my_ax.plot(x,y)
ax = my_ax
or 
my_ax.set_figure(fig)
How can I create the axes/plot object independently from the figure?
Better yet, how can I assign an axe to a figure?
--
Emmanuel
From: Skipper S. <jss...@gm...> - 2012年03月30日 21:52:34
On Fri, Mar 30, 2012 at 5:45 PM, Tony Yu <ts...@gm...> wrote:
>
> On Fri, Mar 30, 2012 at 4:40 PM, Eric Firing <ef...@ha...> wrote:
>>
>> On 03/30/2012 08:47 AM, Skipper Seabold wrote:
>> > There is probably a simple answer to this, but I don't see it. How can
>> > I pad the axis limits automatically? For instance, in the below
>> > example, the x axis limits are the data points and the y limit is
>> > close. I want to have a function that pads the axis limit at least, by
>> > say, 10% of the range of x past the last data point without having to
>> > take my x values and calculate some sensible x limit. Is this
>> > possible?
>>
>> Does the margins() function or method do what you want?
>>
>>
>> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.margins
>>
>>
>> http://matplotlib.sourceforge.net/api/axes_api.html?highlight=margins#matplotlib.axes.Axes.margins
>>
>> Eric
>>
> Thanks for the tip, Eric. I'm continually surprised by all the useful stuff
> that's nestled in the corners of matplotlib.
>
Indeed. Both solutions are nice. I've never noticed margins before,
even though this is a common issue for me. The documentation isn't all
the clear, what exactly to do with it, but set_xmargin and set_ymargin
cleared that up. Thanks.
Skipper
From: Tony Yu <ts...@gm...> - 2012年03月30日 21:45:34
On Fri, Mar 30, 2012 at 4:40 PM, Eric Firing <ef...@ha...> wrote:
> On 03/30/2012 08:47 AM, Skipper Seabold wrote:
> > There is probably a simple answer to this, but I don't see it. How can
> > I pad the axis limits automatically? For instance, in the below
> > example, the x axis limits are the data points and the y limit is
> > close. I want to have a function that pads the axis limit at least, by
> > say, 10% of the range of x past the last data point without having to
> > take my x values and calculate some sensible x limit. Is this
> > possible?
>
> Does the margins() function or method do what you want?
>
>
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.margins
>
>
> http://matplotlib.sourceforge.net/api/axes_api.html?highlight=margins#matplotlib.axes.Axes.margins
>
> Eric
>
> Thanks for the tip, Eric. I'm continually surprised by all the useful
stuff that's nestled in the corners of matplotlib.
Hmm, it looks like `margins` doesn't support log scales, though. Maybe I'll
submit a PR on this later.
Best,
-Tony
From: Eric F. <ef...@ha...> - 2012年03月30日 20:40:33
On 03/30/2012 08:47 AM, Skipper Seabold wrote:
> There is probably a simple answer to this, but I don't see it. How can
> I pad the axis limits automatically? For instance, in the below
> example, the x axis limits are the data points and the y limit is
> close. I want to have a function that pads the axis limit at least, by
> say, 10% of the range of x past the last data point without having to
> take my x values and calculate some sensible x limit. Is this
> possible?
Does the margins() function or method do what you want?
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.margins
http://matplotlib.sourceforge.net/api/axes_api.html?highlight=margins#matplotlib.axes.Axes.margins
Eric
>
>
> import matplotlib.pyplot as plt
> fig = plt.figure()
> ax = fig.add_subplot(111)
> x = [1,2,3]
> y = [8125, 9754, 10855]
> ax.plot(x,y,marker='D',ms=12)
> plt.show()
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Tony Yu <ts...@gm...> - 2012年03月30日 20:26:52
On Fri, Mar 30, 2012 at 2:47 PM, Skipper Seabold <jss...@gm...>wrote:
> There is probably a simple answer to this, but I don't see it. How can
> I pad the axis limits automatically? For instance, in the below
> example, the x axis limits are the data points and the y limit is
> close. I want to have a function that pads the axis limit at least, by
> say, 10% of the range of x past the last data point without having to
> take my x values and calculate some sensible x limit. Is this
> possible?
>
>
> import matplotlib.pyplot as plt
> fig = plt.figure()
> ax = fig.add_subplot(111)
> x = [1,2,3]
> y = [8125, 9754, 10855]
> ax.plot(x,y,marker='D',ms=12)
> plt.show()
>
>
A similar issue<http://old.nabble.com/Why-are-bars,-errorbars...-clipped-td33525497.html>came
up recently on the list:
http://old.nabble.com/Why-are-bars,-errorbars...-clipped-td33525497.html
I posted a snippet of
code<http://old.nabble.com/Re%3A-Why-are-bars%2C-errorbars...-clipped-p33526197.html>there.
Ben Root also mentioned `padx` and `pady` parameters, but I was not
able to find them.
Best,
-Tony
From: Skipper S. <jss...@gm...> - 2012年03月30日 18:48:17
There is probably a simple answer to this, but I don't see it. How can
I pad the axis limits automatically? For instance, in the below
example, the x axis limits are the data points and the y limit is
close. I want to have a function that pads the axis limit at least, by
say, 10% of the range of x past the last data point without having to
take my x values and calculate some sensible x limit. Is this
possible?
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
x = [1,2,3]
y = [8125, 9754, 10855]
ax.plot(x,y,marker='D',ms=12)
plt.show()
From: Mateusz J B. <mbu...@we...> - 2012年03月30日 17:19:12
Hello,
I am trying to download matplot (matplotlib-1.1.0) but at the start of the
download I get a screen that says "Python version 2.7 required, which was
not found in the registry."
I have python 2.7. Where exactly should I save mathplotlib so that it can
find python for the installation?
Many thanks,
Matt.
From: eoj <jos...@gm...> - 2012年03月30日 16:26:03
Basically the problem is like this. I have a relatively expensive (time wise)
figure to create, specifically a map with lots of detail in it. On top of
that, I'm making an inset set of axes to highlight some regions. I'm having
to recreate the base of the map, which is static, every time I want to make
an inset for a different region which is taking forever. What I want to do
is something like this: 
fig = figure()
#do stuff that makes the expensive figure
for region in regions:
 fig2 = copy.copy(fig)
 ax2 = fig.add_axes([0.1, 0.15, 0.25, 0.25])
 ax2.fill(x1,y1)
 savefig(region_name)
 close()
The problem is that the clf() clear figure function seems to clear the base
of the map off, even if I try to make a copy of it inside a loop that is
generating the insets. Also, close() seems to close fig and not fig2. Does
this rambling make any sense, and if so, any suggestions? 
-- 
View this message in context: http://old.nabble.com/Copying-a-figure-instance--tp33544918p33544918.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Francesco M. <fra...@go...> - 2012年03月30日 12:46:06
Dear Dorm,
Il 30 marzo 2012 14:17, Dorm Eight <dor...@ya...> ha scritto:
> Dear Francesco,
> Yes, I just tried it, it can be save perfectly.
so might be a problem with the backend.
Give a look to this page:
http://stackoverflow.com/questions/2512225/matplotlib-not-showing-up-in-mac-osx
and try to change the backend.
I think that I cannot help much more here. Does anyone else has an
idea if there might be any other problem?
Cheers,
Francesco
>
> ________________________________
> From: Francesco Montesano <fra...@go...>
> To: Dorm Eight <dor...@ya...>; mat...@li...
> Sent: Friday, March 30, 2012 8:01 PM
>
> Subject: Re: [Matplotlib-users] (no subject)
>
>> ________________________________
>> From: Francesco Montesano <fra...@go...>
>> To: Dorm Eight <dor...@ya...>
>> Cc: "mat...@li..."
>> <mat...@li...>
>> Sent: Tuesday, March 27, 2012 3:38 PM
>> Subject: Re: [Matplotlib-users] (no subject)
>>
>> Il 27 marzo 2012 05:08, Dorm Eight <dor...@ya...> ha scritto:
>>> hi, everybody!
>>>
>>> when I run my script, why there is no figure show up? I downloaded the
>>> demos
>>> from matplotlib gallery and it didn't work either.
>>>>>>
>>>>>> x=np.arange(100)
>>>>>> y=x**2+3*x-1
>>>>>> pl.plot(x,y)
>>> [<matplotlib.lines.Line2D object at 0x2581050>]
>>>>>> pl.show()
>>>>>>
>>> there is no error, no figure pop-up!
>>>
>>> Thank you for any answer!
>>>
>>
>> Hi Dorm
>> If you can send more info about the operating system and matplotlib
>> version, it's easier to help you
>> (for the latter do
>> import matplotlib
>> print matplotlib.__version__
>> )
>>
>> Cheers,
>> Francesco
>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF email is sponsosred by:
>>> Try Windows Azure free for 90 days Click Here
>>> http://p.sf.net/sfu/sfd2d-msazure
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>>Il 30 marzo 2012 13:23, Dorm Eight <dor...@ya...> ha scritto:
>
> Dear Dorm,
>
> please reply to all the list.
>> My system is Fedora 3.3.0-4.fc16.x86_64, after I recently updated the
>> system with 'yum update', the problem appeared.
>> the Matplotlib version is 1.10. I have no idea at all now.
>
> I've tested your small example on python 2.6, matplotlib 1.0.0 with
> MacOSX backend and on Kubuntu 11.04, python 2.7, matplotlib 1.1, with
> TkAgg and Qt4Agg backends and the small code works for me. In all
> cases I have set "plt.ion()"
>
> If you save the figure instead of showing, does it work?
> Which backend are you using: the name is stored in
> "matplotlib.backends.backend"
>
> Cheers
> Francesco
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Dorm E. <dor...@ya...> - 2012年03月30日 12:17:13
DearFrancesco,
Yes, I just tried it, it can be save perfectly.
________________________________
 From: Francesco Montesano <fra...@go...>
To: Dorm Eight <dor...@ya...>; mat...@li... 
Sent: Friday, March 30, 2012 8:01 PM
Subject: Re: [Matplotlib-users] (no subject)
 
> ________________________________
> From: Francesco Montesano <fra...@go...>
> To: Dorm Eight <dor...@ya...>
> Cc: "mat...@li..."
> <mat...@li...>
> Sent: Tuesday, March 27, 2012 3:38 PM
> Subject: Re: [Matplotlib-users] (no subject)
>
> Il 27 marzo 2012 05:08, Dorm Eight <dor...@ya...> ha scritto:
>> hi, everybody!
>>
>> when I run my script, why there is no figure show up? I downloaded the
>> demos
>> from matplotlib gallery and it didn't work either.
>>>>>
>>>>> x=np.arange(100)
>>>>> y=x**2+3*x-1
>>>>> pl.plot(x,y)
>> [<matplotlib.lines.Line2D object at 0x2581050>]
>>>>> pl.show()
>>>>>
>> there is no error, no figure pop-up!
>>
>> Thank you for any answer!
>>
>
> Hi Dorm
> If you can send more info about the operating system and matplotlib
> version, it's easier to help you
> (for the latter do
> import matplotlib
> print matplotlib.__version__
> )
>
> Cheers,
> Francesco
>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>Il 30 marzo 2012 13:23, Dorm Eight <dor...@ya...> ha scritto:
Dear Dorm,
please reply to all the list.
> My system is Fedora 3.3.0-4.fc16.x86_64, after I recently updated the
> system with 'yum update', the problem appeared.
> the Matplotlib version is 1.10. I have no idea at all now.
I've tested your small example on python 2.6, matplotlib 1.0.0 with
MacOSX backend and on Kubuntu 11.04, python 2.7, matplotlib 1.1, with
TkAgg and Qt4Agg backends and the small code works for me. In all
cases I have set "plt.ion()"
If you save the figure instead of showing, does it work?
Which backend are you using: the name is stored in "matplotlib.backends.backend"
Cheers
Francesco
From: Francesco M. <fra...@go...> - 2012年03月30日 12:02:23
> ________________________________
> From: Francesco Montesano <fra...@go...>
> To: Dorm Eight <dor...@ya...>
> Cc: "mat...@li..."
> <mat...@li...>
> Sent: Tuesday, March 27, 2012 3:38 PM
> Subject: Re: [Matplotlib-users] (no subject)
>
> Il 27 marzo 2012 05:08, Dorm Eight <dor...@ya...> ha scritto:
>> hi, everybody!
>>
>> when I run my script, why there is no figure show up? I downloaded the
>> demos
>> from matplotlib gallery and it didn't work either.
>>>>>
>>>>> x=np.arange(100)
>>>>> y=x**2+3*x-1
>>>>> pl.plot(x,y)
>> [<matplotlib.lines.Line2D object at 0x2581050>]
>>>>> pl.show()
>>>>>
>> there is no error, no figure pop-up!
>>
>> Thank you for any answer!
>>
>
> Hi Dorm
> If you can send more info about the operating system and matplotlib
> version, it's easier to help you
> (for the latter do
> import matplotlib
> print matplotlib.__version__
> )
>
> Cheers,
> Francesco
>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>Il 30 marzo 2012 13:23, Dorm Eight <dor...@ya...> ha scritto:
Dear Dorm,
please reply to all the list.
> My system is Fedora 3.3.0-4.fc16.x86_64, after I recently updated the
> system with 'yum update', the problem appeared.
> the Matplotlib version is 1.10. I have no idea at all now.
I've tested your small example on python 2.6, matplotlib 1.0.0 with
MacOSX backend and on Kubuntu 11.04, python 2.7, matplotlib 1.1, with
TkAgg and Qt4Agg backends and the small code works for me. In all
cases I have set "plt.ion()"
If you save the figure instead of showing, does it work?
Which backend are you using: the name is stored in "matplotlib.backends.backend"
Cheers
Francesco
From: Chao Y. <cha...@gm...> - 2012年03月30日 08:10:15
Hi Tony,
thanks! the first one works but not lambda x : 1-x. The function might be
useful while it needs a little bit knowledge of colors.
cheers,
Chao
2012年3月29日 Tony Yu <ts...@gm...>
>
>
> On Thu, Mar 29, 2012 at 1:31 PM, Chao YUE <cha...@gm...> wrote:
>
>> Dear all,
>>
>> here in cookbook it says "Ever wanted to reverse a colormap, or to
>> desaturate one ? Here is a routine to apply a function to the look up table
>> of a colormap: "
>> http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations
>>
>> but I don't know how to use cmap_map function as in the link to reverse,
>> for example, the cm.jet colormap?
>>
>
>
> If all you want is the reversed colormap, you can call `cm.jet_r` (all the
> default colormaps have a `_r` version). From a *quick* look at the example
> you link to, it seems that you can pass `lambda x: 1 - x` as the function
> to `cmap_xmap`.
>
> Cheers,
> -Tony
>
> (Chao: Sorry for the duplicate. Forgot to reply-all)
>
>
>> thanks,
>>
>> Chao
>> --
>>
>> ***********************************************************************************
>> Chao YUE
>> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
>> UMR 1572 CEA-CNRS-UVSQ
>> Batiment 712 - Pe 119
>> 91191 GIF Sur YVETTE Cedex
>> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>>
>> ************************************************************************************
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
From: Emmanuel M. <ema...@ya...> - 2012年03月29日 23:24:47
Turns out this is what I was looking for !
http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_demo.html#pylab-examples-subplots-demo
f, axarr = plt.subplots(2, 2)
axarr[0,0].plot(x, y)
axarr[0,0].set_title('Axis [0,0]')
axarr[0,1].scatter(x, y)
axarr[0,1].set_title('Axis [0,1]')
axarr[1,0].plot(x, y**2)
axarr[1,0].set_title('Axis [1,0]')
axarr[1,1].scatter(x, y**2)
axarr[1,1].set_title('Axis [1,1]')
--
Emmanuel
________________________________
 From: Emmanuel Mayssat <ema...@ya...>
To: matplotlib <mat...@li...> 
Cc: "mat...@li..." <mat...@li...> 
Sent: Thursday, March 29, 2012 9:57 AM
Subject: [Matplotlib-users] Plot object
 
Hello,
I am programming using POO (object programming)
I cannot find a way to create a plot as an object
In concept, I would like to do something like
"""
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
self.figure = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0))
self.figureCanvas = FigureCanvas(self.figure)
for i in range(2):
  plots.append(create_axis())  <-- create plot object in a list
self.plots[1].xlabel = 'X1'
self.plots[2].xlabel = 'X2'
for plot in self.plots:
  self.figure.add_plots(plot)
self.figure.show()
self.plots[1].xlabel = 'XX1'
self.figure.updateDisplay()
"""
Is it possible?
If so, how?
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users 
From: Brad M. <bra...@gm...> - 2012年03月29日 21:05:31
Paul,
That fixes my problem perfectly. Thanks for the solution!
Best,
Brad
On Thu, Mar 29, 2012 at 1:59 PM, Paul Hobson <pmh...@gm...> wrote:
> Brad,
>
> Matplotlib axes objects have set_xticklabels methods. It's brute
> force, but this will work:
> ax = gca()
> ax.set_xticks([0., 0.015, 0.03])
> ax.set_xticklabels(['0', '0.015', '0.03'])
>
> Hope that helps,
> -paul
>
>
> On Thu, Mar 29, 2012 at 1:13 PM, Brad Malone <bra...@gm...>
> wrote:
> > Hello,
> >
> > I am working on a plot in which I need to modify the value of the
> xticks. A
> > snippet of my code is attached below:
> >
> >> fig=figure()
> >>
> >> gs=matplotlib.gridspec.GridSpec(1,2,width_ratios=[3,1])
> >> gs.update(wspace=0.1)
> >> ax=subplot(gs[0])
> >> ylabel('Frequency (cm'+r'$^{-1}$'+')')
> >> for i in range(0,len(ydata)):
> >> plot(xdata[i],ydata[i],'r-',linewidth=1.5)
> >> plot(xdata[0],[0.0]*len(xdata[0]),'k:')
> >>
> >>
> pos=[0,49.9856985699,99.9713971397,170.661849982,212.979781775,283.67023461\
> >> 7,333.655933187,375.97386498]
> >>
> >>
> locs,labels=xticks(pos,[r'$\Gamma$','X','M',r'$\Gamma$','Z','A','R','X'])
> >> for i in range(0,len(pos)):
> >> plt.axvline(x=pos[i],linewidth=0.5,color='k',alpha=0.5)
> >> axis([0,375.98,0,300])
> >> ax2=subplot(gs[1])
> >> plot(dosydata,dosxdata,'r-',linewidth=1.5)
> >> a=gca()
> >> b=a.get_xticks()
> >> print b
> >> a.xaxis.set_ticks([0.0, 0.015, 0.03])
> >> a.tick_params(axis='x',labelsize=14)
> >> a.set_xlim([0,0.03])
> >> a.set_ylim([0,300])
> >> ax.label_outer()
> >> ax2.label_outer()
> >> show()
> >
> >
> > It's a plot with two subplots. Anyway, the issue I'm running into
> concerns
> > the x-axis on the second subplot. As you can see I have set it explicitly
> > with "a.xaxis.set_ticks([0.0, 0.015, 0.03])". However, when I do this it
> > shows up as (0.000, 0.015,0.030) which I would really like it to look
> like
> > (0,0.015,0.03). In other words, I don't want extra zeros because they are
> > unnecessary and make the text run into my other subplot. So I need to be
> > able to format them somehow. How would I achieve this selective
> formatting
> > (because of course I want 0.015 to show up that way and not 0.01).
> >
> > Thanks so much in advance for the help!
> >
> > Best,
> > Brad
> >
> >
> ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
From: Paul H. <pmh...@gm...> - 2012年03月29日 20:59:25
Brad,
Matplotlib axes objects have set_xticklabels methods. It's brute
force, but this will work:
ax = gca()
ax.set_xticks([0., 0.015, 0.03])
ax.set_xticklabels(['0', '0.015', '0.03'])
Hope that helps,
-paul
On Thu, Mar 29, 2012 at 1:13 PM, Brad Malone <bra...@gm...> wrote:
> Hello,
>
> I am working on a plot in which I need to modify the value of the xticks. A
> snippet of my code is attached below:
>
>>        fig=figure()
>>
>>   gs=matplotlib.gridspec.GridSpec(1,2,width_ratios=[3,1])
>>   gs.update(wspace=0.1)
>>   ax=subplot(gs[0])
>>   ylabel('Frequency (cm'+r'$^{-1}$'+')')
>>   for i in range(0,len(ydata)):
>>     plot(xdata[i],ydata[i],'r-',linewidth=1.5)
>>   plot(xdata[0],[0.0]*len(xdata[0]),'k:')
>>
>> pos=[0,49.9856985699,99.9713971397,170.661849982,212.979781775,283.67023461\
>> 7,333.655933187,375.97386498]
>>
>> locs,labels=xticks(pos,[r'$\Gamma$','X','M',r'$\Gamma$','Z','A','R','X'])
>>   for i in range(0,len(pos)):
>>     plt.axvline(x=pos[i],linewidth=0.5,color='k',alpha=0.5)
>>   axis([0,375.98,0,300])
>>   ax2=subplot(gs[1])
>>   plot(dosydata,dosxdata,'r-',linewidth=1.5)
>>   a=gca()
>>   b=a.get_xticks()
>>   print b
>>   a.xaxis.set_ticks([0.0, 0.015, 0.03])
>>  a.tick_params(axis='x',labelsize=14)
>>   a.set_xlim([0,0.03])
>>   a.set_ylim([0,300])
>>   ax.label_outer()
>>   ax2.label_outer()
>>   show()
>
>
> It's a plot with two subplots. Anyway, the issue I'm running into concerns
> the x-axis on the second subplot. As you can see I have set it explicitly
> with "a.xaxis.set_ticks([0.0, 0.015, 0.03])". However, when I do this it
> shows up as (0.000, 0.015,0.030) which I would really like it to look like
> (0,0.015,0.03). In other words, I don't want extra zeros because they are
> unnecessary and make the text run into my other subplot. So I need to be
> able to format them somehow. How would I achieve this selective formatting
> (because of course I want 0.015 to show up that way and not 0.01).
>
> Thanks so much in advance for the help!
>
> Best,
> Brad
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Brad M. <bra...@gm...> - 2012年03月29日 20:14:00
Hello,
I am working on a plot in which I need to modify the value of the xticks. A
snippet of my code is attached below:
 fig=figure()
>
> gs=matplotlib.gridspec.GridSpec(1,2,width_ratios=[3,1])
> gs.update(wspace=0.1)
> ax=subplot(gs[0])
> ylabel('Frequency (cm'+r'$^{-1}$'+')')
> for i in range(0,len(ydata)):
> plot(xdata[i],ydata[i],'r-',linewidth=1.5)
> plot(xdata[0],[0.0]*len(xdata[0]),'k:')
>
> pos=[0,49.9856985699,99.9713971397,170.661849982,212.979781775,283.67023461\
> 7,333.655933187,375.97386498]
>
> locs,labels=xticks(pos,[r'$\Gamma$','X','M',r'$\Gamma$','Z','A','R','X'])
> for i in range(0,len(pos)):
> plt.axvline(x=pos[i],linewidth=0.5,color='k',alpha=0.5)
> axis([0,375.98,0,300])
> ax2=subplot(gs[1])
> plot(dosydata,dosxdata,'r-',linewidth=1.5)
> a=gca()
> b=a.get_xticks()
> print b
> a.xaxis.set_ticks([0.0, 0.015, 0.03])
> a.tick_params(axis='x',labelsize=14)
> a.set_xlim([0,0.03])
> a.set_ylim([0,300])
> ax.label_outer()
> ax2.label_outer()
> show()
>
>
It's a plot with two subplots. Anyway, the issue I'm running into concerns
the x-axis on the second subplot. As you can see I have set it explicitly
with "a.xaxis.set_ticks([0.0, 0.015, 0.03])". However, when I do this it
shows up as (0.000, 0.015,0.030) which I would really like it to look like
(0,0.015,0.03). In other words, I don't want extra zeros because they are
unnecessary and make the text run into my other subplot. So I need to be
able to format them somehow. How would I achieve this selective formatting
(because of course I want 0.015 to show up that way and not 0.01).
Thanks so much in advance for the help!
Best,
Brad
From: Tony Yu <ts...@gm...> - 2012年03月29日 17:53:15
On Thu, Mar 29, 2012 at 1:31 PM, Chao YUE <cha...@gm...> wrote:
> Dear all,
>
> here in cookbook it says "Ever wanted to reverse a colormap, or to
> desaturate one ? Here is a routine to apply a function to the look up table
> of a colormap: "
> http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations
>
> but I don't know how to use cmap_map function as in the link to reverse,
> for example, the cm.jet colormap?
>
If all you want is the reversed colormap, you can call `cm.jet_r` (all the
default colormaps have a `_r` version). From a *quick* look at the example
you link to, it seems that you can pass `lambda x: 1 - x` as the function
to `cmap_xmap`.
Cheers,
-Tony
(Chao: Sorry for the duplicate. Forgot to reply-all)
> thanks,
>
> Chao
> --
>
> ***********************************************************************************
> Chao YUE
> Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
> UMR 1572 CEA-CNRS-UVSQ
> Batiment 712 - Pe 119
> 91191 GIF Sur YVETTE Cedex
> Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
>
> ************************************************************************************
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Chao Y. <cha...@gm...> - 2012年03月29日 17:31:17
Dear all,
here in cookbook it says "Ever wanted to reverse a colormap, or to
desaturate one ? Here is a routine to apply a function to the look up table
of a colormap: "
http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations
but I don't know how to use cmap_map function as in the link to reverse,
for example, the cm.jet colormap?
thanks,
Chao
-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
From: Emmanuel M. <ema...@ya...> - 2012年03月29日 16:57:31
Hello,
I am programming using POO (object programming)
I cannot find a way to create a plot as an object
In concept, I would like to do something like
"""
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
self.figure = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0))
self.figureCanvas = FigureCanvas(self.figure)
for i in range(2):
  plots.append(create_axis())  <-- create plot object in a list
self.plots[1].xlabel = 'X1'
self.plots[2].xlabel = 'X2'
for plot in self.plots:
  self.figure.add_plots(plot)
self.figure.show()
self.plots[1].xlabel = 'XX1'
self.figure.updateDisplay()
"""
Is it possible?
If so, how?
9 messages has been excluded from this view by a project administrator.

Showing results of 368

1 2 3 .. 15 > >> (Page 1 of 15)
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 によって変換されたページ (->オリジナル) /