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





Showing 11 results of 11

From: Brent P. <bpe...@gm...> - 2009年11月09日 23:28:27
On Mon, Nov 9, 2009 at 3:18 PM, Jae-Joon Lee <lee...@gm...> wrote:
> On Mon, Nov 9, 2009 at 6:03 PM, Brent Pedersen <bpe...@gm...> wrote:
>> how can i have the divider account for the room needed
>> for the
>> labels and ticks?
>
> Doing this automatically is not straight forward. So you need to
> manually adjust the area occupied by the axes.
> Note that rect is [left, bottom, width, height] in normalized figure
> coordinate. Try something like rect=[0., 0.1, 1., 0.8], or simply use
> subplot.
that does it. thanks, i forgot it was height, not ymax.
-brent
>
> Regards,
>
> -JJ
>
From: Jae-Joon L. <lee...@gm...> - 2009年11月09日 23:18:49
On Mon, Nov 9, 2009 at 6:03 PM, Brent Pedersen <bpe...@gm...> wrote:
> how can i have the divider account for the room needed
> for the
> labels and ticks?
Doing this automatically is not straight forward. So you need to
manually adjust the area occupied by the axes.
Note that rect is [left, bottom, width, height] in normalized figure
coordinate. Try something like rect=[0., 0.1, 1., 0.8], or simply use
subplot.
Regards,
-JJ
From: Brent P. <bpe...@gm...> - 2009年11月09日 23:04:10
hi, i'd like to use the divider stuff in axes_grid to plot a figure
with 2 axes, with xticks on the bottom axis.
in the script pasted below, if i use 0.07 as the min for the y-axis,
then it chops off the top of the plot. if i use 0 as the min, then
it doesn't chop of the top, but it doesnt show the x-axis
ticks/labels. how can i have the divider account for the room needed
for the
labels and ticks?
i've also tried:
hori = [Size.AxesX(axes[0])]
vert = [Size.Scaled(0.3), Size.Scaled(0.7)]
d = Divider(f, rect, hori, vert)
with same problem.
thanks,
-brent
===========================================
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid import make_axes_locatable
import numpy as np
plt.close()
f = plt.figure()
rect = (0, 0.07, 1, 1)
#rect = (0, 0, 1, 1)
ax = f.add_axes(rect, autoscale_on=False, aspect="auto")
divider = make_axes_locatable(ax)
ax2 = divider.new_vertical(size="30%", pad=0.0)
f.add_axes(ax2)
axes = [ax, ax2]
for ax in axes:
 ax.plot(np.sin(np.linspace(0, 10, 1600)))
 ax.set_xlim(0, 1600)
 ax.set_ylim(-1, 1)
axes[1].set_xticks([])
plt.show()
From: Tim B. <Tim...@no...> - 2009年11月09日 22:58:31
On 10/11/2009, at 3:37 AM, Christopher Barker wrote:
> Tim Burgess wrote:
>> So....decided to go down the MacPorts path. Many automated 
>> downloads later, I now have a successful Basemap install (yay!)
>> Many thanks to the folks who have contributed to MacPorts and 
>> interestingly geos 3.1.1 is installed.
>
> Is it 64 bit now. If so...
>
>
>> Only present worry is that wxWidgets port is not building on 10.6 - 
>> yet to resolve that.
>
> wxWidgets/wxPython can not be built (for the Mac) 64 bit. It is 
> built on Carbon, which Apple has not and will not port to 64 bit. 
> There is a Cocoa version of wxMac, but it's not done yet, and has 
> not been wrapped for Python.
>
> You may be able to get a 64bit GTK/X11 wxPython working with 
> MacPorts -- I've never tried that.
>
>
>> And FYI, to check whether you have a 64bit Python install:
>> >>> import sys; print sys.maxint
>> 9223372036854775807
>
> So it looks like you are running 64 bit -- what a pain this all is.
>
> -Chris
Yes, I'm running all 64bit now. Can't say I'm seeing dramatic 
performance improvements as I haven't done much in basemap in 32bit to 
compare.
I did find a couple of problems with the current MacPort basemap. I 
could create a Basemap object with a resolution of 'c' but specifying 
a resolution of 'i' caused a program failure.
And the example 'warpimage.py' failed to run as well.
The error wasn't obvious to my eye so I simply did an svn checkout and 
built the code into an .egg and then did an /opt/local/bin/ 
easy_install-2.6 basemap-0.99.5-py2.6-macosx-10.6-i386.egg
I can now use the higher resolution option and warpimage.py all runs 
fine.
As for wxWidgets, there is some pain there. Pierre GM (thanks!) made 
the suggestion of simply using the MacOSX matplotlib backend and so 
problem neatly side-stepped (for me at least).
~~~~~~~~~~~~~~
Tim Burgess
Software Engineer - Coral Reef Watch
Satellite Applications and Research - NESDIS
National Oceanic and Atmospheric Administration
http://www.coralreefwatch.noaa.gov
675 Ross River Rd, Kirwan QLD Australia 4817
tim...@no...
Ph +61-7-47551811
Fax +61-7-47551822
From: Robert K. <rob...@gm...> - 2009年11月09日 20:28:45
On 2009年11月09日 11:46 AM, Chloe Lewis wrote:
> ... and for dessert, is there a circular colormap that would work for
> the colorblind?
Almost certainly not, at least not without compromising other desirable features 
for circular colormaps. You could do a circle roughly perpendicular to the lines 
of confusion, but this would mean going up and down in lightness, which 
perceptually overemphasizes the light half.
On the other hand, this may not be a bad thing if 0 degrees and/or 180 degrees 
are special as might be the case with phase measurements and other complex 
number-related things.
> My department is practicing presenting-science-for-the-general-public,
> and the problems 'heat maps' have for the colorblind keep coming up.
As a deuteronopic, I heartily thank you for paying attention to these issues.
I've written an application to visualize colormaps in 3D perceptual space as 
well as simulating colorblindness. It uses Mayavi and Chaco, so you will need a 
full Enthought Tool Suite installation:
http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/colormap_explorer/
Of interest for this thread might be the function find_chroma() in hcl_opt.py 
which will, given a lightness value in HCL space, find the largest chroma value 
(roughly similar to saturation) such that a circle at the given lightness value 
will just fit inside of the RGB gamut. A simple maximization on that function 
will find the lightness that gives the largest chroma and hence the largest 
dynamic range of such a colormap. However, it should be noted that I have found 
such colormaps to appear a little washed out and drab. But then, I'm colorblind.
-- 
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: Jae-Joon L. <lee...@gm...> - 2009年11月09日 18:08:44
On Thu, Nov 5, 2009 at 2:31 PM, Thomas Robitaille
<tho...@gm...> wrote:
> Is there an easy way to add axes to a figure, but specify the 'rect'
> in real rather than relative units? For example, something like:
>
unfortunately no. And I'm not sure if matplotlib will ever going to
support it internally.
However, converting axes coordinates given in inches to the normalized
figure coordinates is not that difficult. And this will work as far as
the figure size does not change after the axes position is calculated
in the normalized figure coordinates.
fig = figure(1)
rect_inches = 0.5, 0.5, 3., 3.
from matplotlib.transforms import Bbox, BboxTransformFrom, TransformedBbox
tr = BboxTransformFrom(Bbox.from_bounds(0, 0, *fig.get_size_inches()))
rect = TransformedBbox(Bbox.from_bounds(*rect_inches), tr).bounds
ax = fig.add_axes(rect)
Note that the axes coordinate need to be recalculated whenever the
figure size changes.
While the axes_grid toolkit has some limited support for fixed size
(in inches) axes, I personally never find it useful.
http://matplotlib.sourceforge.net/examples/axes_grid/demo_fixed_size_axes.html
-JJ
From: Chloe L. <ch...@be...> - 2009年11月09日 17:46:47
... and for dessert, is there a circular colormap that would work for 
the colorblind?
My department is practicing presenting-science-for-the-general-public, 
and the problems 'heat maps' have for the colorblind keep coming up.
handy: http://konigi.com/tools/submissions/color-deficit-simulators
&C
On Nov 8, 2009, at 3:34 AM, Gary Ruben wrote:
> Hi Ariel,
>
> You might find the attached function helpful here. Try creating a 
> new colormap using the example in the docstring (you could also try 
> setting high=0.8) - basically this will let you turn down the 
> saturation which will hopefully solve your problem. You may also 
> find the plot option useful to see what the individual colour 
> channels are doing if you decide to make a new colormap of your own 
> - you just need to ensure that the r, g, and b values match at both 
> ends.
>
> Gary
>
>
> Ariel Rokem wrote:
>> Hi everyone,
>> I am interested in using a circular colormap, in order to represent 
>> a phase variable, but I don't like 'hsv' (which is circular). In 
>> particular, I find that it induces perceptual distortion, where 
>> values in the green/yellow part of the colormap all look the same. 
>> Are there any circular colormaps except for 'hsv'? If not - how 
>> would you go about constructing a new circular colormap? Thanks,
>> Ariel
>> -- 
>> Ariel Rokem
>> Helen Wills Neuroscience Institute
>> University of California, Berkeley
>> http://argentum.ucbso.berkeley.edu/ariel
> import numpy as np
> import matplotlib.pyplot as plt
> import matplotlib.colors as colors
> import matplotlib._cm as _cm
>
>
> def rescale_cmap(cmap_name, low=0.0, high=1.0, plot=False):
> '''
> Example 1:
> my_hsv = rescale_cmap('hsv', low = 0.3) # equivalent scaling 
> to cplot_like(blah, l_bias=0.33, int_exponent=0.0)
> Example 2:
> my_hsv = rescale_cmap(cm.hsv, low = 0.3)
> '''
> if type(cmap_name) is str:
> cmap = eval('_cm._%s_data' % cmap_name)
> else:
> cmap = eval('_cm._%s_data' % cmap_name.name)
> LUTSIZE = plt.rcParams['image.lut']
> r = np.array(cmap['red'])
> g = np.array(cmap['green'])
> b = np.array(cmap['blue'])
> range = high - low
> r[:,1:] = r[:,1:]*range+low
> g[:,1:] = g[:,1:]*range+low
> b[:,1:] = b[:,1:]*range+low
> _my_data = {'red': tuple(map(tuple,r)),
> 'green': tuple(map(tuple,g)),
> 'blue': tuple(map(tuple,b))
> }
> my_cmap = colors.LinearSegmentedColormap('my_hsv', _my_data, 
> LUTSIZE)
>
> if plot:
> plt.figure()
> plt.plot(r[:,0], r[:,1], 'r', g[:,0], g[:,1], 'g', b[:,0], 
> b[:,1], 'b', lw=3)
> plt.axis(ymin=-0.2, ymax=1.2)
>
> return my_cmap
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 
> 30-Day
> trial. Simplify your report design, integration and deployment - and 
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Christopher B. <Chr...@no...> - 2009年11月09日 17:35:34
Tim Burgess wrote:
> So....decided to go down the MacPorts path. Many automated downloads 
> later, I now have a successful Basemap install (yay!)
> Many thanks to the folks who have contributed to MacPorts and 
> interestingly geos 3.1.1 is installed.
Is it 64 bit now. If so...
> Only present worry is that wxWidgets port is not building on 10.6 - yet 
> to resolve that.
wxWidgets/wxPython can not be built (for the Mac) 64 bit. It is built on 
Carbon, which Apple has not and will not port to 64 bit. There is a 
Cocoa version of wxMac, but it's not done yet, and has not been wrapped 
for Python.
You may be able to get a 64bit GTK/X11 wxPython working with MacPorts -- 
I've never tried that.
> And FYI, to check whether you have a 64bit Python install:
> >>> import sys; print sys.maxint
> 9223372036854775807
So it looks like you are running 64 bit -- what a pain this all is.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Michael D. <md...@st...> - 2009年11月09日 14:22:44
See this FAQ:
http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server
Mike
On 11/09/2009 09:20 AM, Oguz Yarimtepe wrote:
> Hi,
>
> I was trying to use the matplotlib at my Django view. The version i was trying is 0.98. What i did is to import the library and then plot a graph. The problem is when i tried the "from pylab import *", i got "RuntimeError: could not create GdkCursor object". This is most probably because of the apache user is not able to access the X server. Indeed at my distro it doesn't have shell account.
>
> I don't want to define X access to apache user. So what do you suggest?
>
> 
From: Oguz Y. <com...@gm...> - 2009年11月09日 14:20:46
Hi,
I was trying to use the matplotlib at my Django view. The version i was trying is 0.98. What i did is to import the library and then plot a graph. The problem is when i tried the "from pylab import *", i got "RuntimeError: could not create GdkCursor object". This is most probably because of the apache user is not able to access the X server. Indeed at my distro it doesn't have shell account.
I don't want to define X access to apache user. So what do you suggest?
-- 
Oguz Yarimtepe <com...@gm...>
From: luc E. <luc...@en...> - 2009年11月09日 08:43:05
Dear All,
I am new to the list, so hello everyone !
I am trying to use the new 3D facilities offered by Matplotlib, and I 
can't manage to vary the color and/or size of the markers when doing 3D 
scatter plots :
fig = plt.figure()
ax = Axes3D(fig)
ax.scatter([1,2,3],[3,1,2],[1,2,0],c='r',s=[4,10,20])
The code above doesn't seem to plot anything more than :
ax.scatter([1,2,3],[3,1,2],[1,2,0])
Does anyone have a tip regarding this issue ?
Thanks a lot,
luc
---------------
luc Estebanez
Graduate Student,
ENS, Paris

Showing 11 results of 11

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