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 6 results of 6

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

Showing 6 results of 6

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 によって変換されたページ (->オリジナル) /