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


Showing 14 results of 14

From: John H. <jd...@gm...> - 2009年12月14日 22:01:56
On Mon, Dec 14, 2009 at 12:38 PM, jenya56 <je...@ya...> wrote:
>
> I have the following in my PyScripter:
>
> import matplotlib
> matplotlib.interactive(True)
> from matplotlib.pylab import *
> import pylab
>
>
> if __name__ == '__main__':
>  plot([1,2,3])
>  pylab.show()
> #__main__
>
>
> For the first run it works just fine and plots what expected. However, on
> the second run it just gives gray window without plot...Any suggestions?
> Thanks
Have you seen this:
http://code.google.com/p/pyscripter/wiki/FAQ#How_do_I_use_Matplotlib_with_PyScripter_?
JDH
From: Jouni K. S. <jk...@ik...> - 2009年12月14日 19:27:47
Jose Gomez-Dans <jgo...@gm...> writes:
> I find this problem when generating a PDF and viewing it in Linux,but the
> on-screen version seems to work fine. 
While the PDF format has advanced support for different color spaces and
rendering intents, the current PDF backend just uses DeviceRGB and
whatever the default rendering intent is. I wonder if some kind of
different color space or such setting would help - but this is a subject
that I know almost nothing about, and the PDF support is so complex that
I don't even know what the next reasonable step would be above just
using DeviceRGB.
Does the bluemarble image come with a specification or documentation
that mentions a color space, or what the pixel values are supposed to
mean, or how they are recommended to be rendered?
> Another thing you can do is to modify the bluemarble that
> comes with matplotlib using the gimp, as it is just an image file you can
> edit easily. Starts looking like data cooking, tho' ;-)
The fact is that different devices (displays, printers, projectors) have
different gamuts, and unless there is a specified color space, a set of
pixel values has no "right" mapping to the colors of the gamut (and even
if the space is known, mapping out-of-gamut colors can be done in
several ways). So I wouldn't call it "data cooking" if you are just
trying to get a reasonable contrast in your visualization of some data
that consists of values in some arbitrary space, although of course it
will not be any kind of true-color image either.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Thomas R. <tho...@gm...> - 2009年12月14日 19:18:17
Hi,
I would like to plot a colorbar which automatically gets resized when 
I change the view limits and the aspect ratio of the main axes. So for 
example:
import matplotlib.pyplot as mpl
import numpy as np
fig = mpl.figure()
ax = fig.add_axes([0.1,0.1,0.7,0.8])
cax = fig.add_axes([0.81,0.1,0.02,0.8])
image = ax.imshow(np.random.random((100,100)))
fig.colorbar(image, cax=cax)
Is fine, but then if I interactively select a sub-region to zoom in 
with a different aspect ratio, which I can also emulate by doing
ax.set_ylim(40.,60.)
The colorbar is then too high. If I then do
ax.set_xlim(50.,55.)
The height is fine but the position would need changing.
Is there an easy way to get around this issue and have the colorbar 
always at a fixed distance from the main axes, and also have it 
resize? Or is the only way to write this all explicitly using event 
callbacks?
Thanks for any help,
Thomas
From: John H. <jd...@gm...> - 2009年12月14日 18:55:14
We are looking to hire a quantitative researcher to help research and
develop trading ideas, and to develop and support infrastructure to
put these trading strategies into production. We are looking for
someone who is bright and curious with a quantitative background and a
strong interest in writing good code and building systems that work.
Experience with probability, statistics and time series is required,
and experience working with real world data is a definite plus. We do
not require a financial background, but are looking for someone with
an enthusiasm to dive into this industry and learn a lot. We do most
of our data modeling and production software in python and R. We have
a lot of ideas to test and hopefully put into production, and you'll
be working with a fast paced and friendly small team of traders,
programmers and quantitative researchers.
Applying:
 Please submit a resume and cover letter to qs...@tr.... In
 your cover letter, please address how your background, experience
 and skills will fit into the position described above. We are
 looking for a full-time, on-site candidate only.
About Us:
 TradeLink Holdings LLC is a diversified alternative investment,
 trading and software firm. Headquartered in Chicago, TradeLink
 Holdings LLC includes a number of closely related entities. Since
 its organization in 1979, TradeLink has been actively engaged in the
 securities, futures, options, and commodities trading
 industries. Engaged in the option arbitrage business since 1983,
 TradeLink has a floor trading and/or electronic trading interface in
 commodity options, financial futures and options, and currency
 futures and options at all major U.S. exchanges. TradeLink is
 involved in various market-making programs in many different
 exchanges around the world, including over-the-counter derivatives
 markets. http://www.tradelinkllc.com
From: jenya56 <je...@ya...> - 2009年12月14日 18:38:43
I have the following in my PyScripter:
import matplotlib
matplotlib.interactive(True)
from matplotlib.pylab import *
import pylab
if __name__ == '__main__':
 plot([1,2,3])
 pylab.show()
#__main__
For the first run it works just fine and plots what expected. However, on
the second run it just gives gray window without plot...Any suggestions?
Thanks
-- 
View this message in context: http://old.nabble.com/first-run-works-fine-but-on-the-second-not-tp26779948p26779948.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jose Gomez-D. <jgo...@gm...> - 2009年12月14日 18:31:19
Hi!
2009年12月14日 jenya56 <je...@ya...>
>
> 1.) How to control the size of each circle on the scatter plot
>
Use the "s" option to scatter (units are points**2)
> 2.) How to add the coast line with lambert projection?
>
You want to use the basemap extension. An example can be found in this blog:
<
http://stevendkay.wordpress.com/2009/10/12/scatter-plots-with-basemap-and-matplotlib/
>
Cheers,
Jose
From: jenya56 <je...@ya...> - 2009年12月14日 17:57:10
The update:
I was able to produce the plot with:
fig = P.figure()
ax = fig.add_subplot(1,1,1)
cmap = P.matplotlib.cm.jet
norm = P.matplotlib.colors.Normalsize(vmin=0,vmax=1)
sc = ax.scatter(ave_lon,ave_lat,c=v,cmap=cmap,norm=norm)
savefig('sg.png')
However, I have a few questions:
1.) How to control the size of each circle on the scatter plot
2.) How to add the coast line with lambert projection?
THANKS
jenya56 wrote:
> 
> Dear all, I was wondering if there is equivalent in python of this
> function:
> PLOTCLR(X,Y,V) plots the values specified in V as a color coded scatter
> plot at the locations specified in the vectors X and Y. The current
> colormap of the figure is used for the color code. Any suggestions?
> Thanks.
> 
-- 
View this message in context: http://old.nabble.com/advaced-scatter-plot-tp26779933p26779939.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年12月14日 17:37:05
On Mon, Dec 14, 2009 at 11:31 AM, jenya56 <je...@ya...> wrote:
>
> Dear all, I was wondering if there is equivalent in python of this function:
> PLOTCLR(X,Y,V) plots the values specified in V as a color coded scatter plot
> at the locations specified in the vectors X and Y. The current colormap of
> the figure is used for the color code. Any suggestions? Thanks.
"scatter" should do it
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter
http://matplotlib.sourceforge.net/search.html?q=codex+scatter
From: jenya56 <je...@ya...> - 2009年12月14日 17:31:21
Dear all, I was wondering if there is equivalent in python of this function:
PLOTCLR(X,Y,V) plots the values specified in V as a color coded scatter plot
at the locations specified in the vectors X and Y. The current colormap of
the figure is used for the color code. Any suggestions? Thanks.
-- 
View this message in context: http://old.nabble.com/advaced-scatter-plot-tp26779933p26779933.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年12月14日 17:27:26
On Mon, Dec 14, 2009 at 10:22 AM, Susanne Pfeifer <ti...@ti...> wrote:
> Hello,
>
> I am relatively new to matplotlib and I was wondering whether there is
> an easy possibility to generate a histogram whose height is normalized
> to one (rather than the total area under the curve which is the case if
> I use normed=1).
Use np.histogram to generate the counts, divide these by the sum of
the counts, and use pyplot.bar to plot the bar heights. Something
like
In [44]: x = np.random.randn(10000)
In [45]: n, bins = np.histogram(x, bins=20)
In [46]: left = bins[:-1]
In [47]: width = bins[1] - bins[0]
In [48]: pct = n/float(n.sum())
In [49]: plt.bar(left, pct, width=width)
JDH
From: Susanne P. <ti...@ti...> - 2009年12月14日 16:38:38
Hello,
I am relatively new to matplotlib and I was wondering whether there is
an easy possibility to generate a histogram whose height is normalized
to one (rather than the total area under the curve which is the case if
I use normed=1).
Thank you for your help,
Tiffy
From: Trevor I. <tre...@gm...> - 2009年12月14日 15:35:15
Thanks,
This almost does what I want. The labels are now changed to log notation,
but the tick locations have remained the same. I want the spacing between
each logarithmic decade to be equal. I just did an svn up and rebuild so I
am working with bleeding edge matplotlib. Do I need to manually set the
locations of the ticks? I'll play around a bit more with w_yaxis, I wasn't
aware of this.
Danke vel,
Trevor
2009年12月13日 Reinier Heeres <re...@he...>
> Hi,
>
> You'll have to use ax.w_yaxis.set_yscale('log'), which should work fine.
>
> Hope this helps,
> Reinier
>
> On Tue, Dec 8, 2009 at 5:11 PM, Trevor Irons <tre...@gm...>
> wrote:
> > Hi:
> >
> > I'm trying to get a semilog 3D plot. I want to plot several 2D time
> series
> > lines, with the third axis being on a log scale. I am trying to set an
> axis
> > to log using ax.set_yscale('log'), but am getting errors. Is this
> possible?
> >
> > I keep getting numpy errors when I try:
> > raise MaskError, 'Cannot convert masked element to a Python int.'
> > numpy.ma.core.MaskError: Cannot convert masked element to a Python int.
> >
> > My attempt:
> >
> > from mpl_toolkits.mplot3d import Axes3D
> > import matplotlib.pyplot as plt
> > import numpy as np
> >
> > fig = plt.figure()
> > #ax = fig.gca()
> > ax = Axes3D(fig)
> >
> > colors = ('r', 'g', 'b', 'k')
> > zd = (0., 1., 2., 3.)
> > T2 = (0.9, .8, .7, .6)
> > ic = 1
> >
> > for ic in xrange(len(colors)):
> > x = np.arange(0.05,1,.005)
> > z = np.exp(-x/T2[ic]) + np.random.normal(0, .05, len(x))
> > y = np.exp(zd[ic])*np.ones(len(x))
> > ax.plot(x,y,z)
> >
> > # Error if uncommented
> > #ax.set_yscale('log')
> > plt.show()
> >
> > Thanks for any insight.
>
> --
> Reinier Heeres
> Tel: +31 6 10852639
>
From: Jose Gomez-D. <jgo...@gm...> - 2009年12月14日 13:54:24
Hi,
2009年12月14日 Dr. Phillip M. Feldman <pfe...@ve...>
> When I generate a map with a background generated via Basemap.bluemarble(),
> the background is extremely dark. Is there any way to get a
> lighter/brighter version? (I've looked at all of the available parameters,
> but none of them seems to allow for adjustment of the luminance).
>
I find this problem when generating a PDF and viewing it in Linux,but the
on-screen version seems to work fine. One reason for your darkness might be
the actual bluemarble scene. There is one for every month <
http://earthobservatory.nasa.gov/Features/BlueMarble/>, so you can have a
look at the different month and pick u which is better for your
area/application. Another thing you can do is to modify the bluemarble that
comes with matplotlib using the gimp, as it is just an image file you can
edit easily. Starts looking like data cooking, tho' ;-)
J
From: Dr. P. M. F. <pfe...@ve...> - 2009年12月14日 04:17:39
When I generate a map with a background generated via Basemap.bluemarble(),
the background is extremely dark. Is there any way to get a
lighter/brighter version? (I've looked at all of the available parameters,
but none of them seems to allow for adjustment of the luminance).
-- 
View this message in context: http://old.nabble.com/bluemarble-is-too-dark-tp26772824p26772824.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 14 results of 14

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