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



Showing 8 results of 8

From: Nicolas R. <Nic...@in...> - 2011年11月22日 20:09:12
Is that what you want ?
No ticks, no labels:
import matplotlib.pyplot as plt
plt.plot(np.arange(10), np.arange(10))
plt.ylim(0,10)
plt.yticks(np.linspace(3,10,8))
plt.show()
Ticks but no labels:
import matplotlib.pyplot as plt
plt.plot(np.arange(10), np.arange(10))
plt.ylim(0,10)
plt.yticks(np.linspace(0,10,11), ['']*3 + ['%d' % i for i in linspace(3,10,8)])
plt.show()
Nicolas
On Nov 22, 2011, at 20:13 , C M wrote:
> What's the best way in Matplotlib to have a y axis that doesn't have ticks/axis numbers near the bottom of the graph? I don't know if it would be specified as the bottom 1/10th of the graph or x amount of pixels or inches or whatever...just need a bit of extra "y-less" space there to plot values that have an x value but no y value. I'm assuming this would be done with a Formatter or Locator, but wasn't sure how to go about it.
> 
> See attached image....
> 
> Thanks,
> Che
> <y_axis_lower_margin.jpg>------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure 
> contains a definitive record of customers, application performance, 
> security threats, fraudulent activity, and more. Splunk takes this 
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Dave X. <xi...@gm...> - 2011年11月22日 19:51:59
Hi,
I am a new user of matplotlib Basemap. I tried to draw the latitude with
interval 0.1 degree using drawparallels, but failed. I wonder if the
drawparallels can draw latitude lines with small interval instead of
integer values. (drawmeridian can work with small interval 0.1).
Does anyone have any idea to fix this issue?
Thanks!
Dave
#here is a test program to test the drawparallels function
#testbasemap.py
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
import math
latmin=36.803200
latmax=37.306640
lonmin=-76.396026
lonmax=-75.602331
latmin1=math.floor(latmin)
latmax1=math.ceil(latmax)
lonmin1=math.floor(lonmin)
lonmax1=math.ceil(lonmax)
m=Basemap(projection='merc',resolution='h',llcrnrlat=latmin,urcrnrlat=latmax,llcrnrlon=lonmin,urcrnrlon=lonmax)
m.drawcoastlines()
m.drawmapboundary(fill_color='aqua')
m.fillcontinents(color='coral',lake_color='aqua')
meridians = np.arange(lonmin1,lonmax1,0.1)
m.drawmeridians(meridians,labels=[1,1,0,1],fmt='%5.2f')
parallels=np.arange(latmin,latmax,0.1)
m.drawparallels(parallels,labels=[1,1,0,1],fmt='%5.2f')
plt.savefig('test.png')
#####################################################################
The error message is as follows:
Traceback (most recent call last):
 File "testbasemap.py", line 25, in <module>
 m.drawparallels(parallels,labels=[1,1,0,1],fmt='%5.2f')
 File
"/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
line 2067, in drawparallels
 if t is not None: linecolls[int(lat)][1].append(t)
KeyError: 36
From: Goyo <goy...@gm...> - 2011年11月22日 17:07:43
2011年11月22日 Robert Kern <rob...@gm...>:
> To get matplotlib 1.1.0 right now, you will have to build it yourself from
> sources.
Matplotlib packages for Precise also seem to work well in Oneiric.
Goyo
From: Robert K. <rob...@gm...> - 2011年11月22日 15:41:14
On 11/22/11 9:40 AM, andrei barcaru wrote:
> Hello
> My name is Andrew and I'm working in University of Gerona, Spain. I've installed
> the entought distribution package on UBUNTU 11 32b OS . During the install I was
> asked by the shell if I want to create a folder .. so I did that, I've created a
> folder named pyth. Now .. when I'm trying to import matplotlib.animation as
> animation for instance .. I get an error that the module animation is missing .
> And indeed in pyth/lib/python2.7/site-package/matplotlib/ there is no file named
> animation
> Can you tell me please how can I update matplotlib to get the animation package
> installed.
The current version of EPD contains matplotlib 1.0.1. The animation package was 
added in matplotlib 1.1.0.
To get matplotlib 1.1.0 right now, you will have to build it yourself from 
sources. You can remove EPD's matplotlib 1.0.1 like so:
$ enpkg --remove matplotlib
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Michael D. <md...@st...> - 2011年11月22日 15:38:30
You may need to set your default font to something with those characters.
For example:
 import matplotlib
 matplotlib.rcParams['font.family'] = 'DejaVu Sans'
Mike
On 11/22/2011 05:41 AM, Yannick Copin wrote:
> Hi,
>
> I'm confused regarding the use of Unicode characters in matplotlib. I tried
> the following:
>
> <code>
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import matplotlib.pyplot as P
>
> ax = P.gca()
> ax.set_title(u"OK: ×ばつ÷, Not OK: αβγδ")
> P.show()
>
> </code>
>
> The 1st "OK" characters are displayed correctly, while the "Not OK" ones are
> (well) not (while they are available from the Gnome Character Map). I have a
> standard matplotlib over a standard Ubuntu distribution...
>
> I'm aware I could use "r$\alpha$" and so on, but I'd like to stick to unicode
> characters... Is there any hope to use unicode greek characters?
>
> Cheers,
From: Collin C. <cdc...@sy...> - 2011年11月22日 15:30:12
Hi Paul,
Thanks. I tried that and I get the same results as you --- running "./version.py" returns 2.7.1 but "python version.py" returns 2.7.2. I think it's because the python installed at /usr/bin/python is the one that came with the OS; when I installed python 2.7.2 using macports, it installed it to /usr/bin/python2.7, then set the environment to point to that. So, if I change the first line from #! /usr/bin/python to #! /usr/bin/env python, I get the same result when I run version.py either way.
Anyway, are you saying that having the two pythons installed is affecting pylab.show()? If so, how can I fix it?
Thanks,
Collin
On Nov 18, 2011, at 10:54 AM, Paul de Beurs wrote:
Collin,
I had the same kind of trouble. OSX Lion comes with Python 2.7.1.
I have this little script named 'version.py':
#!/usr/bin/python
import sys
print 'Python', sys.version
In a Terminal you can start version.py in two different ways.
when I typed: python version.py
I got:
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 14:13:39)
[GCC 4.0.1 (Apple Inc. build 5493)]
when I typed: version.py
I got:
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 23351500)]
When I change the first line in version.py in #!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
the results of the two test are the same.
Maybe this helps you. Please give me your results.
Paul
2011年11月16日 Collin Capano <cdc...@sy...<mailto:cdc...@sy...>>
Hi,
I've installed matplotlib on a new computer running OSX Lion 10.7.2 (Xcode version 4.2). When I open ipython and try to run:
In [1]: import pylab
In [2]: pylab.figure(); pylab.plot([0,1],[2,2]); pylab.show()
nothing happens. I can, however, save the plot using pylab.savefig. I am using matplotlib version 1.1.0, with Python 2.7.2 and ipython version 0.11. I installed all of these using MacPorts (specifically, the python27, py27-matplotlib, and py27-ipython ports).
Any help would be greatly appreciated, as interactive plotting is important for my work.
Thanks,
Collin
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Matplotlib-users mailing list
Mat...@li...<mailto:Mat...@li...>
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jeff W. <js...@fa...> - 2011年11月22日 13:59:12
On 11/21/11 8:45 PM, Arlindo da Silva wrote:
> Hi,
>
> (A similar issue was reported back in 7/4/11 without a definite 
> solution, so I am reposting with some additional diagnostics. ) Up to 
> Matplotlib 0.99 (EPD 6.3) the code snippet below produced a plot with 
> an aligned colorbar as in the attached "correct.png" plot:
>
> fig = plt.figure()
> ax = fig.add_axes(...)
>
> m = Basemap(..., ax=ax, ...)
>
> im = m.imshow(...)
> # show()
> # setup colorbar axes and draw colorbar
> bbox = ax.get_position()
> l,b,w,h = bbox.bounds
> cax = fig.add_axes([l+w+0.05, b, 0.05, h],frameon=False)
> fig.colorbar(im, cax=cax)
>
> Starting with Matplotlib 1.0.0 this no longer works. The 
> ax.get_position() no longer returns the bounding box of the plot but 
> the bbox of the window, see the attached "wrong.png" attached. Some 
> odd behavior:
>
> 1) I can get the code above to work correctly under MPL 1.0 if I 
> uncomment theshow() line above. (This is not an acceptable solution 
> because show() blocks if not in interactive mode).
>
> 2) Under ipython, if after plotting I print 
> gca().get_position().bounds I get the correct bounding box, even when 
> I just got the wrong colorbar positioning.
>
> 3) If I run the code above twice in a row (without creating a new 
> fig), the second time around the correct bounding box is returned.
>
> Can someone explain to me what is going on? Is this one of those 
> arcane features of matplotlib transform caching? It appears that 
> show() is flushing some type of buffer. Is there any way of 
> accomplishing this without actually calling show()?
>
> Thank you,
>
>
Hi Arlindo: I'm not sure what changed in matplotlib to cause this (I'm 
sure someone else on the list will). However, if you upgrade to basemap 
1.0.2/matplotlib 1.1.0 you can use the new matplotlib colorbar method, 
which does what you want automatically without having to use 
ax.get_position. If uses the axes_grid toolkit under the hood to 
compute the correct location and size for the colorbar. See
http://matplotlib.github.com/basemap/api/basemap_api.html?highlight=colorbar#mpl_toolkits.basemap.Basemap.colorbar
The examples at http://matplotlib.github.com/basemap/users/examples.html 
use this.
Regards,
Jeff
From: andrei b. <ma...@gm...> - 2011年11月22日 09:41:05
Hello
My name is Andrew and I'm working in University of Gerona, Spain. I've
installed the entought distribution package on UBUNTU 11 32b OS . During
the install I was asked by the shell if I want to create a folder .. so I
did that, I've created a folder named pyth. Now .. when I'm trying to
import matplotlib.animation as animation for instance .. I get an error
that the module animation is missing . And indeed in
pyth/lib/python2.7/site-package/matplotlib/ there is no file named
animation
Can you tell me please how can I update matplotlib to get the animation
package installed.
Thank yuo.
AB.
2 messages has been excluded from this view by a project administrator.

Showing 8 results of 8

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