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





Showing results of 69

1 2 3 > >> (Page 1 of 3)
From: KURT P. <pet...@ms...> - 2013年09月30日 23:50:08
That doesn't seem to fix it. What I'm expecting is at the top, 28 should correspond to the value -2. Instead it puts a 30 there.
Kurt
 
Date: 2013年9月30日 16:20:50 -0700
Subject: Re: [Matplotlib-users] x axis non-uniform labeling (KURT PETERS)
From: pmh...@gm...
To: pet...@ms...
CC: mat...@li...
On Mon, Sep 30, 2013 at 1:43 PM, KURT PETERS <pet...@ms...> wrote:
I'm including the code below to demonstrate the problem. The top should have simtimedata (0 through 28) labeling the points. As you can see, MATPLOTLIB just distributes those values evenly instead of assigning them properly.
Any ideas?
 
#!/usr/bin/env python
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import re
from matplotlib.ticker import EngFormatter
xdat=np.arange(1,11)
simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])
print idatanp.shape
print simtimedata.shape
print xdat.shape
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.plot(xdat,idatanp)
ax2 = fig.add_subplot(212)
#ax1.plot(x1, x1,'b--')
ax3 = ax2.twiny()
ax2.plot(xdat, idatanp.real,'k-o')
ax3.plot(simtimedata, idatanp,'k--',alpha=0)
ax2.set_title("time domain")
ax2.grid(True)
plt.show()
> 
> I'm trying to find a glitch in an FPGA simulation. The data stored in a file is:
> (simulation time, y)
> 
> In reality, if I plot that I get large gaps because the simulation time continues and data is only output periodically. In other words simulation time is not continuous. I'd like to view the data without the gaps, but with simulation time annotating the x-axis so I can determine where the glitch occurs. 
> I've tried a variety of things:
> #ax1.plot(x1, x1,'b--')
> #ax3 = ax2.twiny()
> ax2.set_xticklabels(simtimedata, fontdict=None, minor=False, rotation = 45)
> ax2.plot( idatanp.real,'k--',idatanp.imag,'g.-')
> #ax2.plot(xdat, idatanp.real,'k--',xdat,idatanp.imag,'g.-')
> #ax3.plot(simtimedata, idatanp.real,'k--',alpha=0)
> 
> but cannot get the axis to both show the data all together AND show where the glitch occurs. I thought the twiny might help to put another x axis up so I could plot the data first with the x axis incrementing based on when the data is read in, and then trying to place labels showing simulation time.
> 
> Does anyone have any ideas how I could do this?
> Kurt
Kurt, 
You need to show ax3's xticklabels somewhere. Like this:
import numpy as npfrom matplotlib import rcimport matplotlib.pyplot as pltimport matplotlib.mlab as mlabimport refrom matplotlib.ticker import EngFormatter
xdat=np.arange(1,11)simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])
fig = plt.figure()
ax1 = fig.add_subplot(211)ax1.plot(xdat,idatanp)
ax2 = fig.add_subplot(212)ax3 = ax2.twiny()
ax2.plot(xdat, idatanp.real,'k-o')
ax3.plot(simtimedata, idatanp,'k--',alpha=0)
 # ---- show ax3's xticklabels
ax3.xaxis.tick_top() ax2.set_title("time domain")ax2.grid(True)
fig.tight_layout()
 		 	 		 
From: Eric F. <ef...@ha...> - 2013年09月30日 23:43:28
On 2013年09月30日 3:45 AM, Mark Bakker wrote:
> The design of the function datestr2num, unfortunately, has an undesired
> side-effect.
> Today (September 30) I cannot convert monthly data, as February doesn't
> have 30 days.
> Conversion of:
> datestr2num('2000-02')
> Gives an error:
> ValueError: day is out of range for month
>
> Should I file a bug report or a feature request?
I would classify it as a bug resulting from a bad default in dateutil.
Eric
>
> Thanks,
>
> Mark
>
>
>
> On Thu, Sep 19, 2013 at 11:38 PM, Goyo <goy...@gm...
> <mailto:goy...@gm...>> wrote:
>
> 2013年9月19日 Mark Bakker <ma...@gm...
> <mailto:ma...@gm...>>:
> > Hello List,
> >
> > When I use datestr2num('2010-05') it nicely converts that to
> a number
> > representing the date.
> > When I convert that number back with num2date, it turns out
> it sets the day
> > to the 19th of the month. The dime is 0:00:00.
> > Any reason it is set to the 19th instead of the first?
> > Maybe because today it the 19th, or is that just a coincidence?
>
> datestr2num calls dateutil.parser.parse, which by default uses the
> current date at 00:00:00 for missing fields. The dateutil function
> also can use a "default" argument to change this bahavoir but it is
> not available in datestr2num.
>
> http://labix.org/python-dateutil#head-a23e8ae0a661d77b89dfb3476f85b26f0b30349c
>
> Goyo
>
>
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Paul H. <pmh...@gm...> - 2013年09月30日 23:21:00
On Mon, Sep 30, 2013 at 1:43 PM, KURT PETERS <pet...@ms...> wrote:
> I'm including the code below to demonstrate the problem. The top should
> have simtimedata (0 through 28) labeling the points. As you can see,
> MATPLOTLIB just distributes those values evenly instead of assigning them
> properly.
> Any ideas?
>
> #!/usr/bin/env python
> import numpy as np
> from matplotlib import rc
> import matplotlib.pyplot as plt
> import matplotlib.mlab as mlab
> import re
> from matplotlib.ticker import EngFormatter
> xdat=np.arange(1,11)
> simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
> idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])
> print idatanp.shape
> print simtimedata.shape
> print xdat.shape
> fig = plt.figure()
>
> ax1 = fig.add_subplot(211)
> ax1.plot(xdat,idatanp)
> ax2 = fig.add_subplot(212)
> #ax1.plot(x1, x1,'b--')
> ax3 = ax2.twiny()
> ax2.plot(xdat, idatanp.real,'k-o')
> ax3.plot(simtimedata, idatanp,'k--',alpha=0)
> ax2.set_title("time domain")
> ax2.grid(True)
> plt.show()
>
> >
> > I'm trying to find a glitch in an FPGA simulation. The data stored in a
> file is:
> > (simulation time, y)
> >
> > In reality, if I plot that I get large gaps because the simulation time
> continues and data is only output periodically. In other words simulation
> time is not continuous. I'd like to view the data without the gaps, but
> with simulation time annotating the x-axis so I can determine where the
> glitch occurs.
> > I've tried a variety of things:
> > #ax1.plot(x1, x1,'b--')
> > #ax3 = ax2.twiny()
> > ax2.set_xticklabels(simtimedata, fontdict=None, minor=False, rotation =
> 45)
> > ax2.plot( idatanp.real,'k--',idatanp.imag,'g.-')
> > #ax2.plot(xdat, idatanp.real,'k--',xdat,idatanp.imag,'g.-')
> > #ax3.plot(simtimedata, idatanp.real,'k--',alpha=0)
> >
> > but cannot get the axis to both show the data all together AND show
> where the glitch occurs. I thought the twiny might help to put another x
> axis up so I could plot the data first with the x axis incrementing based
> on when the data is read in, and then trying to place labels showing
> simulation time.
> >
> > Does anyone have any ideas how I could do this?
> > Kurt
>
Kurt,
You need to show ax3's xticklabels somewhere. Like this:
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import re
from matplotlib.ticker import EngFormatter
xdat=np.arange(1,11)
simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.plot(xdat,idatanp)
ax2 = fig.add_subplot(212)
ax3 = ax2.twiny()
ax2.plot(xdat, idatanp.real,'k-o')
ax3.plot(simtimedata, idatanp,'k--',alpha=0)
 # ---- show ax3's xticklabels
ax3.xaxis.tick_top()
ax2.set_title("time domain")
ax2.grid(True)
fig.tight_layout()
From: KURT P. <pet...@ms...> - 2013年09月30日 20:43:16
I'm including the code below to demonstrate the problem. The top should have simtimedata (0 through 28) labeling the points. As you can see, MATPLOTLIB just distributes those values evenly instead of assigning them properly.
Any ideas?
 
#!/usr/bin/env python
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import re
from matplotlib.ticker import EngFormatter
xdat=np.arange(1,11)
simtimedata = np.array([0, 1, 5, 9, 13, 18, 21, 24, 25, 28])
idatanp = np.array([-1,0, 1, 2, 3, 2, 1, 0, -1, -2])
print idatanp.shape
print simtimedata.shape
print xdat.shape
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax1.plot(xdat,idatanp)
ax2 = fig.add_subplot(212)
#ax1.plot(x1, x1,'b--')
ax3 = ax2.twiny()
ax2.plot(xdat, idatanp.real,'k-o')
ax3.plot(simtimedata, idatanp,'k--',alpha=0)
ax2.set_title("time domain")
ax2.grid(True)
plt.show()
> 
> I'm trying to find a glitch in an FPGA simulation. The data stored in a file is:
> (simulation time, y)
> 
> In reality, if I plot that I get large gaps because the simulation time continues and data is only output periodically. In other words simulation time is not continuous. I'd like to view the data without the gaps, but with simulation time annotating the x-axis so I can determine where the glitch occurs. 
> I've tried a variety of things:
> #ax1.plot(x1, x1,'b--')
> #ax3 = ax2.twiny()
> ax2.set_xticklabels(simtimedata, fontdict=None, minor=False, rotation = 45)
> ax2.plot( idatanp.real,'k--',idatanp.imag,'g.-')
> #ax2.plot(xdat, idatanp.real,'k--',xdat,idatanp.imag,'g.-')
> #ax3.plot(simtimedata, idatanp.real,'k--',alpha=0)
> 
> but cannot get the axis to both show the data all together AND show where the glitch occurs. I thought the twiny might help to put another x axis up so I could plot the data first with the x axis incrementing based on when the data is read in, and then trying to place labels showing simulation time.
> 
> Does anyone have any ideas how I could do this?
> Kurt
 		 	 		 
From: Mark B. <ma...@gm...> - 2013年09月30日 13:45:45
The design of the function datestr2num, unfortunately, has an undesired
side-effect.
Today (September 30) I cannot convert monthly data, as February doesn't
have 30 days.
Conversion of:
datestr2num('2000-02')
Gives an error:
ValueError: day is out of range for month
Should I file a bug report or a feature request?
Thanks,
Mark
>
> On Thu, Sep 19, 2013 at 11:38 PM, Goyo <goy...@gm...> wrote:
>
>> 2013年9月19日 Mark Bakker <ma...@gm...>:
>> > Hello List,
>> >
>> > When I use datestr2num('2010-05') it nicely converts that to a number
>> > representing the date.
>> > When I convert that number back with num2date, it turns out it sets the
>> day
>> > to the 19th of the month. The dime is 0:00:00.
>> > Any reason it is set to the 19th instead of the first?
>> > Maybe because today it the 19th, or is that just a coincidence?
>>
>> datestr2num calls dateutil.parser.parse, which by default uses the
>> current date at 00:00:00 for missing fields. The dateutil function
>> also can use a "default" argument to change this bahavoir but it is
>> not available in datestr2num.
>>
>>
>> http://labix.org/python-dateutil#head-a23e8ae0a661d77b89dfb3476f85b26f0b30349c
>>
>> Goyo
>>
>
>
From: Eric F. <ef...@ha...> - 2013年09月29日 21:58:33
On 2013年09月28日 11:15 AM, Felix Patzelt wrote:
> Dear all,
>
> manually placing labels when using clabel seems to be broken in Matplotlib 1.3.0.
>
> I'm on OS X 10.8.5 and have Matplotlib installed via macports. Today I updated all installed ports and thereby got the new version of Matplotlib. Now manually placing cline labels creates weird artefacts. I attached a demo script at the bottom and uploaded a screenshot at http://i.imgur.com/u6BLcRB.png . As you can see there is also a depreciation warning. Now I downgraded to Matoplotlib 1.2.1 again (keeping all other updates in place) and the problem is gone. I currently have very little time for bug hunting and therefore will just stay away from updates for a while. Maybe someone can figure out what's going wrong.
>
> Best,
> Felix
>
Felix,
Thanks for the report. I have turned it into a Github issue: 
https://github.com/matplotlib/matplotlib/issues/2475.
Eric
From: Goyo <goy...@gm...> - 2013年09月29日 20:44:09
2013年9月28日 Felix Patzelt <fe...@ne...>:
> Dear all,
>
> manually placing labels when using clabel seems to be broken in Matplotlib 1.3.0.
>
> I'm on OS X 10.8.5 and have Matplotlib installed via macports. Today I updated all installed ports and thereby got the new version of Matplotlib. Now manually placing cline labels creates weird artefacts. I attached a demo script at the bottom and uploaded a screenshot at http://i.imgur.com/u6BLcRB.png . As you can see there is also a depreciation warning. Now I downgraded to Matoplotlib 1.2.1 again (keeping all other updates in place) and the problem is gone. I currently have very little time for bug hunting and therefore will just stay away from updates for a while. Maybe someone can figure out what's going wrong.
>
FWIW, I can confirm this issue in Ubuntu Raring with the development
version of matplotlib packaged in ppa:takluyver/matplotlib-daily.
From: Tony Yu <ts...@gm...> - 2013年09月29日 18:31:08
Since the 1.3 release, the Matplotlib gallery has displayed the beginnings
of a clean up effort that will probably require the work of many people. To
make it easier to contribute to the effort, there's already a MEP
(Matplotlib Enhancement Proposal) that details some guidelines for clean up:
https://github.com/matplotlib/matplotlib/wiki/MEP12
To make some of these goals clearer, I just submitted a PR which could
serve as an example of those guidelines in action:
https://github.com/matplotlib/matplotlib/pull/2474
Anyone who is interested in helping out with the clean-up should take a
look at those links and then find an example that needs cleaning up.
Cheers,
-Tony
From: Felix P. <fe...@ne...> - 2013年09月28日 21:42:05
Dear all,
manually placing labels when using clabel seems to be broken in Matplotlib 1.3.0.
I'm on OS X 10.8.5 and have Matplotlib installed via macports. Today I updated all installed ports and thereby got the new version of Matplotlib. Now manually placing cline labels creates weird artefacts. I attached a demo script at the bottom and uploaded a screenshot at http://i.imgur.com/u6BLcRB.png . As you can see there is also a depreciation warning. Now I downgraded to Matoplotlib 1.2.1 again (keeping all other updates in place) and the problem is gone. I currently have very little time for bug hunting and therefore will just stay away from updates for a while. Maybe someone can figure out what's going wrong.
Best,
Felix
##########################################
# demo.py
##########################################
import numpy as np
from matplotlib import mlab
import pylab as plt
# Broken manual labelling demo
# Adapted from pylab_examples example code: contour_demo.py
delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)
plt.figure()
CS = plt.contour(X, Y, Z)
plt.clabel(CS, inline=1, fontsize=10)
plt.title('Simplest default with labels')
plt.show()
plt.figure()
CS = plt.contour(X, Y, Z)
plt.clabel(CS, inline=1, fontsize=10, manual=True)
plt.title('Position labels manually')
plt.show()
From: KURT P. <pet...@ms...> - 2013年09月28日 16:57:55
I'm trying to find a glitch in an FPGA simulation. The data stored in a file is:
(simulation time, y)
 
In reality, if I plot that I get large gaps because the simulation time continues and data is only output periodically. In other words simulation time is not continuous. I'd like to view the data without the gaps, but with simulation time annotating the x-axis so I can determine where the glitch occurs. 
I've tried a variety of things:
#ax1.plot(x1, x1,'b--')
#ax3 = ax2.twiny()
ax2.set_xticklabels(simtimedata, fontdict=None, minor=False, rotation = 45)
ax2.plot( idatanp.real,'k--',idatanp.imag,'g.-')
#ax2.plot(xdat, idatanp.real,'k--',xdat,idatanp.imag,'g.-')
#ax3.plot(simtimedata, idatanp.real,'k--',alpha=0)
 
but cannot get the axis to both show the data all together AND show where the glitch occurs. I thought the twiny might help to put another x axis up so I could plot the data first with the x axis incrementing based on when the data is read in, and then trying to place labels showing simulation time.
 
Does anyone have any ideas how I could do this?
Kurt
 		 	 		 
From: Yuxiang W. <yw...@vi...> - 2013年09月28日 04:21:30
Attachments: test.png
Dear all,
I have the following code that did not work:
################################
import matplotlib.pyplot as plt
# Make the plot
fig, axs = plt.subplots(3, 1, figsize=(3.27, 6))
axs[0].plot(range(5), range(5), label='label 1')
axs[0].plot(range(5), range(4, -1, -1), label='label 2')
axs[0].legend(bbox_to_anchor=(0, 1.1, 1., 0.1), mode='expand', ncol=2,
frameon=True, borderaxespad=0.)
# Adjust subplots to make room
fig.subplots_adjust(top=.5)
fig.savefig('test.png', format='png', dpi=300)
##################################
It can be seen that the fig.subplots_adjust did not work at all.
The picture from the notebook is normal, but the saved png file
(attached test.png) is cropped.
I am using WinPython 3.3.2.3 64 bit, with matplotlib version 1.3.0 and
CPython 3.3. This happened in IPython Notebook. The backend is the
in-line one.
Any help would really be appreciated. Thanks!
-Shawn
-- 
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
yw...@vi...
+1 (434) 284-0836
From: Jody K. <jk...@uv...> - 2013年09月26日 22:47:40
Hi All,
To follow up on my own post - because my curtains and contours were well-ordered, I simply set the "zorder" on each call and got the right effect. 
Thanks, Jody
On Sep 25, 2013, at 15:15 PM, Jody Klymak <jk...@uv...> wrote:
> 	
> Hi all,
> 
> I am trying to make 3-D "curtain" plots. Basically, x,y are N-vectors, z is an M-vector, and C is MxN data set collected on the path with z. Application is a ship's track through the ocean. I also want to be able to contour a second variable C2 also MxN. I know how to do that, but the example below just uses plot3D, because thats how I do the curtain contouring. 
> 
> If I plot three such "curtains" they look OK, including the magenta line in each. 
> 
> If I plot a fourth, the magenta line is obscured by the curtain, and so on for more curtains.
> 
> <bad3dslices.png>
> 
> Any clue what the problem is? The code for this example is below, and I think is self contained, plus or minus running in pylab.
> 
> Thanks, Jody
> 
> from mpl_toolkits.mplot3d import Axes3D
> from matplotlib import cm
> import matplotlib.pyplot as plt
> import numpy as np
> 
> n=0
> fig = figure()
> for Nn in array([3,4]):
> n=n+1
> ax = fig.add_subplot(2,1,n,projection='3d')
> for off in arange(0,Nn*2,2)*50.:
> 
> x = np.arange(-5, 5, .5)
> y = np.arange(-5, 5, .5)
> Z = np.arange(0,200,1)
> Z=np.tile(np.reshape(Z,(200,1)),(1,size(y)))
> X = np.tile(y,(200,1))
> Y = np.tile(y,(200,1))
> 
> N = X*Y*Z
> N = N/N.max() # normalize 0..1
> surf = ax.plot_surface(
> X+off, Y, Z, rstride=20, cstride=4,
> facecolors=cm.jet(N),
> linewidth=0, antialiased=False, shade=False,alpha=0.9)
> ax.plot(x+off+0.001,y,(y+5)*25.,'m')
> ax.set_xlim([-50,350])
> ax.set_ylim([-8.,8.])
> fig.savefig('doc/bad3dslices.png',res=72)
> 
> --
> Jody Klymak 
> http://web.uvic.ca/~jklymak/
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Nat E. <nat...@gm...> - 2013年09月26日 18:58:26
Is there a way to force matplotlib to build (on Mac, 10.6, Xcode 3) against
a specific, non-standard location of libpng? Right now it appears to be
linking to /usr/X11/lib/libpng12.0.dylib, which is making it very difficult
to install the resulting binaries on other Macs. I couldn't figure out a
way to point it somewhere else.
thanks,
Nat
From: Yoshi R. <yo...@ro...> - 2013年09月26日 15:54:07
Hey,
I'm trying to plot streamplots into an axesgrid object with something
like:
fig = pl.figure(1, (13, 20))
grid = AxesGrid(fig, 111,
 nrows_ncols = (3, 2),
 axes_pad = 0.6,
 cbar_location = 'top',
 cbar_mode = 'each',
 cbar_size = '2%',
 cbar_pad = '1%',
 )
[...]
 norm = mpl.colors.LogNorm(vmin=1, vmax=5000)
 im = grid[i].streamplot(XPTS, YPTS, zx, zy,
 color=zr,
 arrowsize=.001,
 norm=norm)
 grid.cbar_axes[i].colorbar(im)
[...]
and then it failes with:
Traceback (most recent call last):
 File "./results.py", line 96, in <module>
 grid.cbar_axes[i].colorbar(im)
 File
"/usr/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_grid.py",
line 85, in colorbar cb = Colorbar(self, mappable,
orientation=orientation, **kwargs) File
"/usr/lib/python2.7/site-packages/mpl_toolkits/axes_grid1/colorbar.py",
line 706, in __init__ mappable.autoscale_None() # Ensure
mappable.norm.vmin, vmax AttributeError: 'StreamplotSet' object has no
attribute 'autoscale_None'
can't I use streamplots in axesgrid? If I comment out the colorbar for
the streamplot colors it works ...
Is this a bug? Is there a right way to do it? Is there a work around?
Many thanks in advance!
Regards, Yoshi
From: Jody K. <jk...@uv...> - 2013年09月25日 22:15:42
	
Hi all,
I am trying to make 3-D "curtain" plots. Basically, x,y are N-vectors, z is an M-vector, and C is MxN data set collected on the path with z. Application is a ship's track through the ocean. I also want to be able to contour a second variable C2 also MxN. I know how to do that, but the example below just uses plot3D, because thats how I do the curtain contouring. 
If I plot three such "curtains" they look OK, including the magenta line in each. 
If I plot a fourth, the magenta line is obscured by the curtain, and so on for more curtains.
Any clue what the problem is? The code for this example is below, and I think is self contained, plus or minus running in pylab.
Thanks, Jody
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
n=0
fig = figure()
for Nn in array([3,4]):
 n=n+1
 ax = fig.add_subplot(2,1,n,projection='3d')
 for off in arange(0,Nn*2,2)*50.:
 
 x = np.arange(-5, 5, .5)
 y = np.arange(-5, 5, .5)
 Z = np.arange(0,200,1)
 Z=np.tile(np.reshape(Z,(200,1)),(1,size(y)))
 X = np.tile(y,(200,1))
 Y = np.tile(y,(200,1))
 
 N = X*Y*Z
 N = N/N.max() # normalize 0..1
 surf = ax.plot_surface(
 X+off, Y, Z, rstride=20, cstride=4,
 facecolors=cm.jet(N),
 linewidth=0, antialiased=False, shade=False,alpha=0.9)
 ax.plot(x+off+0.001,y,(y+5)*25.,'m')
 ax.set_xlim([-50,350])
 ax.set_ylim([-8.,8.])
 fig.savefig('doc/bad3dslices.png',res=72)
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Chao Y. <cha...@gm...> - 2013年09月25日 09:36:02
Hi,
I met with a problem using Python to draw graphs. Compare the
following two scripts and attached graphs. For the first one, the left
edge of the colorbar is white. It seems that only when I use
norm=LogNorm() the problem happens. Does anyone know how to solve it?
Thanks!
python1:
from mpl_toolkits.basemap import cm
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
data = np.tile(np.logspace(-12,0,num=13),(13,1))
print data[0]
bounds = data[0][2:-2]
print bounds
fig,ax=plt.subplots()
im = ax.imshow(data,vmin=bounds[0],vmax=bounds[-1],norm=LogNorm(),cmap
= cm.GMT_seis_r)
cb=fig.colorbar(im,ax=ax,\
 extend='both',\
 ticks=bounds,\
 #default, can be omitted
 drawedges=False,\
 shrink=0.6,\
 orientation='horizontal',\
 pad=0.02)
plt.show()
python2:
from mpl_toolkits.basemap import cm
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
data = np.tile(np.arange(-12,0),(13,1))
print data[0]
bounds = data[0][2:-2]
print bounds
fig,ax=plt.subplots()
im = ax.imshow(data,vmin=bounds[0],vmax=bounds[-1],cmap = cm.GMT_seis_r)
cb=fig.colorbar(im,ax=ax,\
 extend='both',\
 ticks=bounds,\
 #default, can be omitted
 drawedges=False,\
 shrink=0.6,\
 orientation='horizontal',\
 pad=0.02)
plt.show()
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: roman3217 <dav...@no...> - 2013年09月25日 09:06:24
Hello, 
I did a mistake in my previous post.
The correct xlC that I created :
#!/bin/bash
parameters=$(echo $* | sed s/'-l '/''/g)
Modules/ld_so_aix $parameters -lC -ltcl -ltk
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-matplotlib-under-aix-6-1-tp42093p42096.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: vwf <vw...@vu...> - 2013年09月25日 08:31:28
On Tue, Sep 24, 2013 at 03:46:52PM -0700, Jody Klymak wrote: [...]
> 
> 2) Can I suggest this example be added to the tutorial?
> http://stackoverflow.com/questions/6539944/color-matplotlib-plot-surface-command-with-surface-gradient
> None of the other examples explain how to colour your surface with
> data, which is what I wanted. 
> 
> 3) I think plot_surface should accept a fourth (optional) argument C
> for colouring the faces: plot_surface(X,Y,Z,C). I do this a lot if I
> want to make a 3-D plot, and normalizing C, clipping it, and indexing
> a colormap seem clunky, when the routine could do it for me. 
> 
I largely agree. I spend many days to get my plots and posted a few
times on this list e.g.
Subject: Re: [Matplotlib-users] how to create a facecolors map?
Date: 2013年8月29日 09:24:40
Better documetation would be very nice; please provide example code.
And a remark about that: most exemples show functions with symmetry.
This can be confusing when coloring and other techniques are applied.
PS. Please cut down the original message before replying.
From: David R. <Dav...@no...> - 2013年09月25日 08:31:19
hello,
Sorry for my poor english.
I have a big problem with matplotlib under AIX6.1.
My configuration :
OS : AIX 6.1
XLC : 12.1.0.0
Python 2.7.5-1
I installed Python and all dependencies from www.oss4aix.org/download/RPMS with the rpm files.
This is the all packages that I installed:
rpm -ivh gcc/libgcc-4.4.7-1.aix6.1.ppc.rpm
rpm -ivh libffi/libffi-3.0.13-1.aix5.1.ppc.rpm
rpm -ivh libffi/libffi-devel-3.0.13-1.aix5.1.ppc.rpm
rpm -ivh expat/expat-2.1.0-1.aix5.1.ppc.rpm
rpm -ivh expat/expat-devel-2.1.0-1.aix5.1.ppc.rpm
rpm -ivh libiconv/libiconv-1.14-2.aix5.1.ppc.rpm glib2/glib2-2.36.3-1.aix5.1.ppc.rpm gettext/gettext-0.17-1.aix5.1.ppc.rpm --nodeps (missing libxlsmp.a(smprt.o))
rpm -ivh pkg-config/pkg-config-0.28-1.aix5.1.ppc.rpm
rpm -ivh zlib/zlib-1.2.8-1.aix5.1.ppc.rpm
rpm -ivh zlib/zlib-devel-1.2.8-1.aix5.1.ppc.rpm
rpm -ivh libpng/libpng-1.6.3-1.aix5.1.ppc.rpm
rpm -ivh libpng/libpng-devel-1.6.3-1.aix5.1.ppc.rpm
rpm -ivh freetype2/freetype2-2.5.0-1.aix5.1.ppc.rpm
rpm -ivh freetype2/freetype2-devel-2.5.0-1.aix5.1.ppc.rpm
rpm -ivh fontconfig/fontconfig-2.8.0-2.aix5.1.ppc.rpm
rpm -ivh fontconfig/fontconfig-devel-2.8.0-2.aix5.1.ppc.rpm
rpm -ivh libXrender/libXrender-0.9.7-2.aix6.1.ppc.rpm
rpm -ivh libXrender/libXrender-devel-0.9.7-2.aix6.1.ppc.rpm
rpm -ivh libXft/libXft-2.3.1-1.aix5.1.ppc.rpm
rpm -ivh libXft/libXft-devel-2.3.1-1.aix5.1.ppc.rpm
rpm -Uvh tcl/tcl-8.5.14-1.aix5.1.ppc.rpm
rpm -ivh tcl/tcl-devel-8.5.14-1.aix5.1.ppc.rpm
rpm -Uvh tk/tk-8.5.14-1.aix5.1.ppc.rpm
rpm -ivh tk/tk-devel-8.5.14-1.aix5.1.ppc.rpm
rpm -ivh info/info-5.1-1.aix5.1.ppc.rpm
rpm -ivh readline/readline-6.2-4.aix5.1.ppc.rpm
rpm -ivh readline/readline-devel-6.2-4.aix5.1.ppc.rpm
rpm -ivh openssl/openssl-1.0.1e-2.aix5.1.ppc.rpm
rpm -ivh openssl/openssl-devel-1.0.1e-2.aix5.1.ppc.rpm
rpm -ivh gdbm/gdbm-1.10-1.aix5.1.ppc.rpm
rpm -ivh gdbm/gdbm-devel-1.10-1.aix5.1.ppc.rpm
rpm -ivh gmp/gmp-5.0.5-1.aix5.1.ppc.rpm
rpm -ivh gmp/gmp-devel-5.0.5-1.aix5.1.ppc.rpm
rpm -ivh gettext/gettext-devel-0.17-1.aix5.1.ppc.rpm
rpm -ivh db4/db4-4.7.25-2.aix5.1.ppc.rpm
rpm -ivh db4/db4-devel-4.7.25-2.aix5.1.ppc.rpm
rpm -ivh bzip2/bzip2-1.0.6-1.aix5.1.ppc.rpm
rpm -ivh bzip2/bzip2-devel-1.0.6-1.aix5.1.ppc.rpm
rpm -ivh sqlite/sqlite-3.7.17-1.aix5.1.ppc.rpm
rpm -ivh sqlite/sqlite-devel-3.7.17-1.aix5.1.ppc.rpm
rpm -ivh python/python-libs-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-devel-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/tkinter-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-tools-2.7.5-1.aix6.1.ppc.rpm
rpm -ivh python/python-test-2.7.5-1.aix6.1.ppc.rpm
In the first step I spent a lot of time to compile matplotlib. This is what I did to install matplotlib :
>From sources I installed NUMPY, SETUPTOOLS, PYTHON-DATEUTIL
With easy_install I installed TORNADO, PYPARSING
I need to do some changes in sources of matplotlib:
Patch 0
--- CXX/WrapPython.h 2013年09月18日 14:47:26.000000000 -0500
+++ CXX/WrapPython.h.orig 2013年09月18日 14:47:07.000000000 -0500
@@ -38,9 +38,6 @@
 #ifndef __PyCXX_wrap_python_hxx__
 #define __PyCXX_wrap_python_hxx__
- #include<stdio.h>
- #include<unistd.h>
-
 // On some platforms we have to include time.h to get select defined
 #if !defined(__WIN32__) && !defined(WIN32) && !defined(_WIN32) && !defined(_WIN64)
 #include <sys/time.h>
Patch 1
--- src/ft2font.h 2013年09月18日 14:43:11.000000000 -0500
+++ src/ft2font.h.orig 2013年09月18日 14:42:19.000000000 -0500
@@ -1,9 +1,5 @@
 /* -*- mode: c++; c-basic-offset: 4 -*- */
- #include<stdio.h>
- #include<unistd.h>
-
-
 /* A python interface to freetype2 */
 #ifndef _FT2FONT_H
 #define _FT2FONT_H
Patch 2
--- src/mplutils.h 2013年09月18日 14:46:06.000000000 -0500
+++ src/mplutils.h.orig 2013年09月18日 14:45:32.000000000 -0500
@@ -12,9 +12,6 @@
 *
 */
- #include<stdio.h>
- #include<unistd.h>
-
 #ifndef _MPLUTILS_H
 #define _MPLUTILS_H
Patch 3
--- ttconv/pprdrv.h 2013年09月18日 14:49:07.000000000 -0500
+++ ttconv/pprdrv.h.orig 2013年09月18日 14:48:47.000000000 -0500
@@ -21,9 +21,6 @@
 ** This file last revised 5 December 1995.
 */
- #include<stdio.h>
- #include<unistd.h>
-
 #include <vector>
 #include <cassert>
I create a link in the sources directory : ln -s /opt/freeware/lib/python2.7/config Modules
I create a xlC script
cat > xlC << EOF
/bin/bash
Modules/ld_so_aix
EOF
chmod a+x xlC
python setup.py install
With all this, the compilation ends.
When I check the use of matplotlib
import matplotlib
import numpy as np
from matplotlib import pyplot
a=np.arange(100)
pyplot.plot(a)
At this point I'm so happy !!!!!!
BUT, when I want plot the array !!!!
pyplot.show()
I had a segmentation fault ...... HELLLLLLLLLP !
My first question : Do somebody is able to plot something with matplotlib uner AIX 6.1 ???? And HOW ???
Do you know a howtodo page to do a correct installation ?
Thank you !
David
From: Jody K. <jk...@uv...> - 2013年09月24日 22:47:01
Hi All,
On Dec 11, 2012, at 16:59 PM, Damon McDougall <dam...@gm...> wrote:
> On Tue, Dec 11, 2012 at 1:16 PM, Benjamin Root <ben...@ou...> wrote:
>> 
>> 
>> On Tue, Dec 11, 2012 at 2:08 PM, Chloe Lewis <ch...@be...> wrote:
>>> 
>>> Would it be workable for the default to be proportional to the size of the
>>> array passed in? (suggested only because I do that myself, when deciding how
>>> coarse an investigative plot I can get away with.)
>>> 
>>> &C
>>> 
>> 
>> That is pretty much what the PR I was referring to does:
>> 
>> https://github.com/matplotlib/matplotlib/pull/1040
>> 
>> It makes it so that the behavior of both plot_surface and plot_wireframe is
>> the same in this respect. So, by default, the rstride and cstride would be
>> 1% of the size of your data array. This would make the default for the
>> recent example be 1, therefore showing every point. I wonder if a
>> logarithmic default would make sense to better handle large data arrays?
>> 
>> Thoughts?
>> Ben Root
> 
> I hope nobody minds if I chime in here.
> 
> I'm in favour of making the defaults a little more intelligent that
> what is implemented at present, i.e, a constant stride for any
> surface. Any non-trivial scaling law to determine what stride to use
> will result in more expected behaviour than what our users are
> currently seeing.
> 
> Could we do better? Could we have plot_surface try and estimate the
> stride based on the 'roughness' of the surface to be plotted? This
> method would grind to a halt for very rough surfaces, so we could
> default to a scaling law in these cases.
> 
OK, way late here, but
1) I wasted an hour today before I discovered what "rstride" and "cstride" were. Reading the documentation, I still don't actually know what they are, except that if I want to see all my data I need to set them to 1. "Array row stride (step size)", is pretty enigmatic! "stride" is a term I've never heard before except is reference to walking. I see it is used in computer science, but to refer to the byte-wise distance between array elements, so not very analogous. 
Can I suggest the docs be improved to say exactly what these do (I assume either average over cstride columns and rstride rows, or subsample on that frequency, not clear which)? Can I also suggest the default is 1? Its pretty frustrating for large a chunk of your data to not show up for no logical reason. If my data set is too large, I am smart enough to subsample it myself before I plot it. 
2) Can I suggest this example be added to the tutorial? http://stackoverflow.com/questions/6539944/color-matplotlib-plot-surface-command-with-surface-gradient
None of the other examples explain how to colour your surface with data, which is what I wanted. 
3) I think plot_surface should accept a fourth (optional) argument C for colouring the faces: plot_surface(X,Y,Z,C). I do this a lot if I want to make a 3-D plot, and normalizing C, clipping it, and indexing a colormap seem clunky, when the routine could do it for me. 
Thanks, Jody
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Jody K. <jk...@uv...> - 2013年09月24日 16:19:34
On Sep 24, 2013, at 9:12 AM, Benjamin Root <ben...@ou...> wrote:
> ne thing I try to do with my projects is to separate the graph production from the data processing. I would have the data processing save the relevant data, and then have separate scripts that would generate graphs from that data. 
Second this - if it takes longer than 30s to run the processing, then I save the output and reload it to do the plotting. If you want the processing and plotting in the same file (or ipython Notebook, like I do) then consider putting an "if 0:" statement in front of the processing. If you want to run it again later, you just change to an "if 1:". This approach lets you play with plots w/o reprocessing all the time.
Cheers, Jody
--
Jody Klymak 
http://web.uvic.ca/~jklymak/
From: Benjamin R. <ben...@ou...> - 2013年09月24日 16:12:47
On Mon, Sep 23, 2013 at 6:13 PM, Grigoris Maravelias <
gr....@gm...> wrote:
> Hello to all!
>
> I have been using Matplotlib to create a series of plots and now the
> time to submit the paper has come! But I experience problems now with
> the font types of the eps images. The Type-3 fonts are not supported,
> and they accept only Type-1. Is there an easy way to do this ?(and of
> course not go through the reprocessing of all data to produce again the
> same plots).
>
> best
> Grigoris
>
>
A word of advice with regards to your hesitation to redo the graphs. Almost
always you will need to do so anyway when reviews come back. Either because
one of the reviewers wanted a change in the graph, or some other fault in
the process was discovered and needed to be corrected (and so new graphs
have to be made anyway). Also, you may be asked to produce the data for
others to use some time in the future. One thing I try to do with my
projects is to separate the graph production from the data processing. I
would have the data processing save the relevant data, and then have
separate scripts that would generate graphs from that data. For bonus
points, I usually tie everything together with Makefiles so that I don't
have to remember the exact set of commands I used when the reviewer
comments come back 6 months later.
Cheers!
Ben Root
From: Michael D. <md...@st...> - 2013年09月24日 15:04:14
You could try ps2ps (which comes with ghostscript) or similar tools.
Mike
On 09/23/2013 06:13 PM, Grigoris Maravelias wrote:
> Hello to all!
>
> I have been using Matplotlib to create a series of plots and now the
> time to submit the paper has come! But I experience problems now with
> the font types of the eps images. The Type-3 fonts are not supported,
> and they accept only Type-1. Is there an easy way to do this ?(and of
> course not go through the reprocessing of all data to produce again the
> same plots).
>
> best
> Grigoris
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
 _
|\/|o _|_ _. _ | | \.__ __|__|_|_ _ _ ._ _
| ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |
http://www.droettboom.com
From: Grigoris M. <gr....@gm...> - 2013年09月23日 22:13:19
Hello to all!
I have been using Matplotlib to create a series of plots and now the 
time to submit the paper has come! But I experience problems now with 
the font types of the eps images. The Type-3 fonts are not supported, 
and they accept only Type-1. Is there an easy way to do this ?(and of 
course not go through the reprocessing of all data to produce again the 
same plots).
best
Grigoris
From: Fabrice S. <si...@lm...> - 2013年09月23日 13:10:17
Hi,
Is there a way to save figures as Language Level 2 Encapsulated
PostScript ?
Hard coded header in backends/backend_ps.py (Lines 1109 and 1278)
writes:
 %!PS-Adobe-3.0 EPSF-3.0
but in the same module, there is an ambiguous:
 backend_version = 'Level II'
Regards,

Showing results of 69

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