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
(5) |
2
(6) |
|
3
(4) |
4
(9) |
5
(7) |
6
(16) |
7
(5) |
8
(10) |
9
(2) |
|
10
(3) |
11
(9) |
12
(1) |
13
(13) |
14
(1) |
15
(13) |
16
(5) |
|
17
(3) |
18
(14) |
19
(17) |
20
(14) |
21
(15) |
22
(6) |
23
(6) |
|
24
|
25
(4) |
26
(4) |
27
(4) |
28
(11) |
29
(7) |
30
(1) |
|
From: Luke <haz...@gm...> - 2011-04-28 21:56:30
|
Ian, Thanks for the response and the example code. I guess what I'm trying to do might be well defined. Here is a plot that should illustrate the data I'm working with: http://biosport.ucdavis.edu/blog/copy_of_steady_benchmark_tau.png The green and red regions are being displayed by plotting each and every point in my data set that is stable. So the set of points I was describing in my original message looks like these green and red regions. What I would like is just the boundary of the stable region, which maybe isn't a very well defined statement. The convex hull of these points would enclose a part of the x-y plane that isn't stable, so I don't want to include it in my plot. I am thinking that perhaps the approach I should be taking should involve contouring the real part of the eigenvalues which determine the stability, and then plot the zero-level curve. I'll have to think about that some more. Is it clear what I am trying to do? If so, do you think the Delaunay triangulation is the right way to go? ~Luke On Thu, Apr 28, 2011 at 2:14 PM, Ian Thomas <ian...@gm...> wrote: > On 28 April 2011 08:51, Luke <haz...@gm...> wrote: >> >> I have a set of unstructured (x,y) points which I would like to >> compute a boundary polygon for. I don't want the convex hull. >> >> I was able to use matplotlib.tri to get a Delaunay triangulation for >> my points by following the examples online, but I'm having trouble >> masking everything but the triangles with a boundary edge. >> Additionally, once I get this, I'm not clear on how to plot just the >> boundary. >> >> Here is what it seems like the mask should be, assume triang comes >> from matplotlib.tri.Triangulation(). >> >> mask = np.where(np.where(triang.neighbors < 0, 0, 1).all(axis=1), 1, 0) >> triang.set_mask(mask) >> >> but, when I plot triang using plot.triplot(), or plt.plot() to plot >> the edges, I am getting a bunch of extra stuff that isn't just the >> boundary triangles/edges. >> >> Anybody have example code for properly masking and plotting only the >> boundary edges? >> >> ~Luke > > Luke, > > I am not entirely clear exactly what you want to do, but I'll try to help. > > Your masking of the triangulation masks the triangles not the edges, and so > your triplot call displays those triangles that include a boundary edge but > also the other edges of those triangles. As you say, this isn't what you > want. > > I've attached an example script that follows on from your idea of testing > triang.neighbors to determine the boundary edges, and displays just those > edges. However, this is the convex hull as, by definition, the boundary of > an unconstrained Delaunay triangulation is the convex hull. As you don't > want the convex hull, I am not clear what you want instead. > > If I have misunderstood your requirements and/or you have further questions, > please post your example code as it is much easier for others on the mailing > list to correct existing code than come up with their own freestanding > example. > > I hope some of this helps! > Ian Thomas > -- "Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin, Historical Review of Pennsylvania, 1759 |
|
From: Ian T. <ian...@gm...> - 2011-04-28 21:14:46
|
On 28 April 2011 08:51, Luke <haz...@gm...> wrote: > I have a set of unstructured (x,y) points which I would like to > compute a boundary polygon for. I don't want the convex hull. > > I was able to use matplotlib.tri to get a Delaunay triangulation for > my points by following the examples online, but I'm having trouble > masking everything but the triangles with a boundary edge. > Additionally, once I get this, I'm not clear on how to plot just the > boundary. > > Here is what it seems like the mask should be, assume triang comes > from matplotlib.tri.Triangulation(). > > mask = np.where(np.where(triang.neighbors < 0, 0, 1).all(axis=1), 1, 0) > triang.set_mask(mask) > > but, when I plot triang using plot.triplot(), or plt.plot() to plot > the edges, I am getting a bunch of extra stuff that isn't just the > boundary triangles/edges. > > Anybody have example code for properly masking and plotting only the > boundary edges? > > ~Luke > Luke, I am not entirely clear exactly what you want to do, but I'll try to help. Your masking of the triangulation masks the triangles not the edges, and so your triplot call displays those triangles that include a boundary edge but also the other edges of those triangles. As you say, this isn't what you want. I've attached an example script that follows on from your idea of testing triang.neighbors to determine the boundary edges, and displays just those edges. However, this is the convex hull as, by definition, the boundary of an unconstrained Delaunay triangulation is the convex hull. As you don't want the convex hull, I am not clear what you want instead. If I have misunderstood your requirements and/or you have further questions, please post your example code as it is much easier for others on the mailing list to correct existing code than come up with their own freestanding example. I hope some of this helps! Ian Thomas |
|
From: Pau <vim...@go...> - 2011-04-28 18:13:15
|
Hi,
I am trying to "grep" in 650 data files a row which has a particular
number on column 2, namely " 0.250000000000000E+00 ".
Alternatively, I could look for that row by searching for the first
column, which is " 1 ".
Unfortunately, this row changes position in the 650 files and looks like this:
-----------
.
.
.
4224 0.249999993684469E-04 0.450621747970581E+01
-0.217168951034546E+01 0.798277109861374E-01 -0.598546504974365E+00
-0.947211563587189E+00 0.298483103513718E+00 0.694457411766052E+00
-0.135573709011078E+01 0.500285959243774E+01 0
4225 0.249999993684469E-04 0.503941202163696E+01
-0.236623978614807E+01 -0.171467363834381E+00 -0.204598993062973E+00
-0.764434099197388E+00 0.354671090841293E+00 0.141895398497581E+00
-0.693929433822632E+00 0.556993389129639E+01 0
4226 0.249999993684469E-04 0.403050041198730E+01
-0.215032029151917E+01 0.877652913331985E-01 -0.991083562374115E+00
0.611193120479584E+00 0.273028463125229E+00 0.364663577079773E+01
-0.221709823608398E+01 0.456908226013184E+01 0
1 0.250000000000000E+00 0.417827463150024E+01
-0.208329892158508E+01 0.104015089571476E+00 0.154748081695288E-02
-0.619542039930820E-02 -0.361486850306392E-02 0.216096282005310E+01
-0.701378881931305E+00 0.467000341415405E+01 0
4228 0.249999993684469E-04 -0.348412361145020E+02
-0.309311046600342E+02 -0.551393890380859E+01 -0.908447951078415E-01
-0.427876152098179E-01 -0.533953774720430E-02 0.295748591423035E+01
-0.196792855858803E-01 0.469153327941895E+02 0
4229 0.249999993684469E-04 0.427954912185669E+01
-0.195016658306122E+01 0.785302296280861E-01 0.806781768798828E+00
-0.110497450828552E+01 -0.624167263507843E+00 0.235030865669250E+01
-0.216405773162842E+01 0.470360040664673E+01 0
4230 0.249999993684469E-04 0.551125669479370E+01
-0.394835329055786E+01 0.588055849075317E+00 -0.504932820796967E+00
0.104279957711697E+00 -0.213553920388222E+00 0.198102459311485E+00
-0.341262459754944E+00 0.680509042739868E+01 0
.
.
.
-------------
The purpose is to identify the row and then plot the 3rd and 4th
columns once that row has been identified:
X_inst = FILE[????:, 2] # Column 3
Y_inst = FILE[????:, 3] # Column 4
My problem is how to define those ????
thanks a lot,
Pau
|
|
From: Wes M. <wes...@gm...> - 2011-04-28 17:06:44
|
On Thu, Apr 28, 2011 at 1:01 PM, Wes McKinney <wes...@gm...> wrote:
> On Thu, Apr 28, 2011 at 12:55 PM, Pau <vim...@go...> wrote:
>> Hi,
>>
>> I am trying to use recursively a matplotlib script to create 650 plots.
>>
>> For this, I have defined
>>
>> cluster = loadtxt(sys.argv[1])
>> MBH = loadtxt ('./TrajectoryMBH.asc')
>>
>> X_cl = cluster[:, 2] # Column 3
>> Y_cl = cluster[:, 3] # Column 4
>> Z_cl = cluster[:, 4] # Column 5
>>
>> X_mbh = MBH[:, 2] # Column 3
>> Y_mbh = MBH[:, 3] # Column 4
>> Z_mbh = MBH[:, 4] # Column 5
>>
>>
>> because "cluster" is the file that changes. TrajectoryMBH.asc is
>> always the same file for all 650 plots
>>
>> This way, I can run
>>
>> ./Hit_Cluster_MBH.py MYFILE_001.dat
>>
>> and the script takes MYFILE_001.dat as "cluster".
>>
>> Now, I would like matplotlib to produce the eps file automatically,
>> without any popup window.
>>
>> For this, I usually define
>>
>> import matplotlib
>> matplotlib.use('Agg')
>> import matplotlib.pyplot as plt
>>
>> and the, at the very bottom, instead of
>>
>> show()
>>
>> I have
>>
>> plt.savefig('MyEPS.eps')
>>
>> What I would like though is that matplotlib produces automatically
>>
>> MYFILE_001.eps
>> MYFILE_002.eps
>>
>> etc
>>
>> when running the python script within a shell script such as
>>
>> for file in $(ls *dat) ; do ; ./Hit_Cluster_MBH.py $file ; done
>>
>> but I do not know how to do this in the
>>
>> plt.savefig('MyEPS.eps')
>>
>> part...
>>
>> Obviously
>>
>> plt.savefig('$file.eps')
>>
>> does not work.
>>
>> Any hint will be appreciated.
>>
>> Thanks,
>>
>> Pau
>>
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network
>> management toolset available today. Delivers lowest initial
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> How about something like:
>
> name, ext = sys.argv[1].split('.')
> plt.savefig('%s.eps' % name)
>
Also, if you do everything in Python instead of a shell script, the
whole process will take much less time. E.g.:
def generate_eps_file(pth):
...
# generate your plot from specified file
name, ext = pth.split('.')
plt.savefig('%s.eps' % name)
import glob
files = glob.glob('*.dat')
for filepath in files:
generate_eps_file(filepath)
|
|
From: Pau <vim...@go...> - 2011-04-28 17:06:15
|
thanks!
On 28 April 2011 19:01, Wes McKinney <wes...@gm...> wrote:
> On Thu, Apr 28, 2011 at 12:55 PM, Pau <vim...@go...> wrote:
>> Hi,
>>
>> I am trying to use recursively a matplotlib script to create 650 plots.
>>
>> For this, I have defined
>>
>> cluster = loadtxt(sys.argv[1])
>> MBH = loadtxt ('./TrajectoryMBH.asc')
>>
>> X_cl = cluster[:, 2] # Column 3
>> Y_cl = cluster[:, 3] # Column 4
>> Z_cl = cluster[:, 4] # Column 5
>>
>> X_mbh = MBH[:, 2] # Column 3
>> Y_mbh = MBH[:, 3] # Column 4
>> Z_mbh = MBH[:, 4] # Column 5
>>
>>
>> because "cluster" is the file that changes. TrajectoryMBH.asc is
>> always the same file for all 650 plots
>>
>> This way, I can run
>>
>> ./Hit_Cluster_MBH.py MYFILE_001.dat
>>
>> and the script takes MYFILE_001.dat as "cluster".
>>
>> Now, I would like matplotlib to produce the eps file automatically,
>> without any popup window.
>>
>> For this, I usually define
>>
>> import matplotlib
>> matplotlib.use('Agg')
>> import matplotlib.pyplot as plt
>>
>> and the, at the very bottom, instead of
>>
>> show()
>>
>> I have
>>
>> plt.savefig('MyEPS.eps')
>>
>> What I would like though is that matplotlib produces automatically
>>
>> MYFILE_001.eps
>> MYFILE_002.eps
>>
>> etc
>>
>> when running the python script within a shell script such as
>>
>> for file in $(ls *dat) ; do ; ./Hit_Cluster_MBH.py $file ; done
>>
>> but I do not know how to do this in the
>>
>> plt.savefig('MyEPS.eps')
>>
>> part...
>>
>> Obviously
>>
>> plt.savefig('$file.eps')
>>
>> does not work.
>>
>> Any hint will be appreciated.
>>
>> Thanks,
>>
>> Pau
>>
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network
>> management toolset available today. Delivers lowest initial
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> How about something like:
>
> name, ext = sys.argv[1].split('.')
> plt.savefig('%s.eps' % name)
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today. Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Wes M. <wes...@gm...> - 2011-04-28 17:01:29
|
On Thu, Apr 28, 2011 at 12:55 PM, Pau <vim...@go...> wrote:
> Hi,
>
> I am trying to use recursively a matplotlib script to create 650 plots.
>
> For this, I have defined
>
> cluster = loadtxt(sys.argv[1])
> MBH = loadtxt ('./TrajectoryMBH.asc')
>
> X_cl = cluster[:, 2] # Column 3
> Y_cl = cluster[:, 3] # Column 4
> Z_cl = cluster[:, 4] # Column 5
>
> X_mbh = MBH[:, 2] # Column 3
> Y_mbh = MBH[:, 3] # Column 4
> Z_mbh = MBH[:, 4] # Column 5
>
>
> because "cluster" is the file that changes. TrajectoryMBH.asc is
> always the same file for all 650 plots
>
> This way, I can run
>
> ./Hit_Cluster_MBH.py MYFILE_001.dat
>
> and the script takes MYFILE_001.dat as "cluster".
>
> Now, I would like matplotlib to produce the eps file automatically,
> without any popup window.
>
> For this, I usually define
>
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as plt
>
> and the, at the very bottom, instead of
>
> show()
>
> I have
>
> plt.savefig('MyEPS.eps')
>
> What I would like though is that matplotlib produces automatically
>
> MYFILE_001.eps
> MYFILE_002.eps
>
> etc
>
> when running the python script within a shell script such as
>
> for file in $(ls *dat) ; do ; ./Hit_Cluster_MBH.py $file ; done
>
> but I do not know how to do this in the
>
> plt.savefig('MyEPS.eps')
>
> part...
>
> Obviously
>
> plt.savefig('$file.eps')
>
> does not work.
>
> Any hint will be appreciated.
>
> Thanks,
>
> Pau
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today. Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
How about something like:
name, ext = sys.argv[1].split('.')
plt.savefig('%s.eps' % name)
|
|
From: Pau <vim...@go...> - 2011-04-28 16:55:17
|
Hi,
I am trying to use recursively a matplotlib script to create 650 plots.
For this, I have defined
cluster = loadtxt(sys.argv[1])
MBH = loadtxt ('./TrajectoryMBH.asc')
X_cl = cluster[:, 2] # Column 3
Y_cl = cluster[:, 3] # Column 4
Z_cl = cluster[:, 4] # Column 5
X_mbh = MBH[:, 2] # Column 3
Y_mbh = MBH[:, 3] # Column 4
Z_mbh = MBH[:, 4] # Column 5
because "cluster" is the file that changes. TrajectoryMBH.asc is
always the same file for all 650 plots
This way, I can run
./Hit_Cluster_MBH.py MYFILE_001.dat
and the script takes MYFILE_001.dat as "cluster".
Now, I would like matplotlib to produce the eps file automatically,
without any popup window.
For this, I usually define
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
and the, at the very bottom, instead of
show()
I have
plt.savefig('MyEPS.eps')
What I would like though is that matplotlib produces automatically
MYFILE_001.eps
MYFILE_002.eps
etc
when running the python script within a shell script such as
for file in $(ls *dat) ; do ; ./Hit_Cluster_MBH.py $file ; done
but I do not know how to do this in the
plt.savefig('MyEPS.eps')
part...
Obviously
plt.savefig('$file.eps')
does not work.
Any hint will be appreciated.
Thanks,
Pau
|
|
From: Luke <haz...@gm...> - 2011-04-28 07:51:55
|
I have a set of unstructured (x,y) points which I would like to compute a boundary polygon for. I don't want the convex hull. I was able to use matplotlib.tri to get a Delaunay triangulation for my points by following the examples online, but I'm having trouble masking everything but the triangles with a boundary edge. Additionally, once I get this, I'm not clear on how to plot just the boundary. Here is what it seems like the mask should be, assume triang comes from matplotlib.tri.Triangulation(). mask = np.where(np.where(triang.neighbors < 0, 0, 1).all(axis=1), 1, 0) triang.set_mask(mask) but, when I plot triang using plot.triplot(), or plt.plot() to plot the edges, I am getting a bunch of extra stuff that isn't just the boundary triangles/edges. Anybody have example code for properly masking and plotting only the boundary edges? ~Luke -- "Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin, Historical Review of Pennsylvania, 1759 |
|
From: briant100 <btr...@ho...> - 2011-04-28 06:16:38
|
that should work many thanks butterw wrote: > > given a recarray r, r.dtype.names contains a tuple with the column names. > > It should be easy to do what you want using a loop. > > > briant100 wrote: >> >> Hey John - currently using matplotlib.mlab import csv2rec functionality >> in a script. >> >> Is there a tool or way to automate plotting of multiple y series >> contained in a csv data file (data in columns, header is first row, x >> axis is time, several y series) with varying column header names and >> varying numbers of columns depending on the individual data file? >> I particularly want to avoid manually typing individual series names -as >> this information is contained in the header row for each column of data >> it seems inefficient to have to type series names for plotting, only to >> have to retype series names for the next csv file which contains >> different column header names >> >> Plotfile came close, but doesnt seem to automatically label individual >> series by column header >> eg file formats (varying headers, and numbers of columns): >> >> file 1 >> elapsedtime,AS2data,AS45data,SE34data,VB56data >> >> file 2 >> elapsedtime,AS09data,VB24data >> > > -- View this message in context: http://old.nabble.com/record-array-and-date-support-tp11011990p31493748.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2011-04-28 05:23:20
|
The Axes class of the axisartist toolkit uses very different way to handle ticks and tick labels. Thus most of the tick-related commands of original matplotlib do not work! Unfortunately, there is no easy way to support a logarithmic scale. To utilize the full functionality, you need to create a transform object and provide an appropriate tick locator. The first part is easy but the second part is not. You can use origial mapltolib's tick locator, but it has a limitation that minor ticks are not well supported. The easiest way is to convert your data to log scale and use a fixed locator with a custom formatter. An example script is attached. The better approach is to create your own locator and formatter. Regards, -JJ On Fri, Apr 22, 2011 at 1:49 AM, Junghun Shin <jh...@ef...> wrote: > Hi, everyone. > > Let me explain what I wanted to do: First, I wanted to make a polar > plot with angles from 0 to 90. I could do it by adopting the > curvelinear grid demo ( http://goo.gl/kruXf ). And then I wanted to > present the radius in log10 scale. But setting the plot command to > semilogy or trying to set 'set_rscale('log')' all failed. Below I > pasted the code that works for radius in linear scale. > > [Code] > #!/usr/bin/env python > import matplotlib.pyplot as plt > import numpy as np > > #Modified from http://matplotlib.sourceforge.net/plot_directive/mpl_toolkits/axes_grid/examples/demo_floating_axis.py > > #def curvelinear_test2(fig, lp_r, lp_t): > def curvelinear_test2(fig, lp_t, lp_r, rLower, rUpper): > rmin = np.min(lp_r) > rmax = np.max(lp_r) > print 'rm: ', rmin, 'rM: ', rmax,'rL: ', rLower, 'rU: ', rUpper > """ > polar projection, but in a rectangular box. > """ > global ax1 > import mpl_toolkits.axisartist.angle_helper as angle_helper > from matplotlib.projections import PolarAxes > from matplotlib.transforms import Affine2D > > from mpl_toolkits.axisartist import SubplotHost, ParasiteAxesAuxTrans > > from mpl_toolkits.axisartist import GridHelperCurveLinear > > from mpl_toolkits.axisartist.grid_helper_curvelinear import > GridHelperCurveLinear > > > # see demo_curvelinear_grid.py for details > tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform() > > extreme_finder = angle_helper.ExtremeFinderCycle(20, 20, > lon_cycle = 360, > lat_cycle = None, > lon_minmax = (0, 360), > lat_minmax = > (-np.inf, np.inf), > #lat_minmax = > (rmin, np.inf), > ) > > grid_locator1 = angle_helper.LocatorDMS(12) > > tick_formatter1 = angle_helper.FormatterDMS() > > grid_helper = GridHelperCurveLinear(tr, > extreme_finder=extreme_finder, > grid_locator1=grid_locator1, > tick_formatter1=tick_formatter1 > ) > > > ax1 = SubplotHost(fig, 1, 1, 1, grid_helper=grid_helper) > > fig.add_subplot(ax1) > > # make ticklabels of all axis visible. > ax1.axis[:].major_ticklabels.set_visible(True) > #ax1.axis["top"].major_ticklabels.set_visible(True) > #ax1.axis["left"].major_ticklabels.set_visible(True) > #ax1.axis["bottom"].major_ticklabels.set_visible(True) > > # show angle (0) at right and top > ax1.axis["right"].get_helper().nth_coord_ticks=0 > ax1.axis["top"].get_helper().nth_coord_ticks=0 > > # show radius (1) at left and bottom > ax1.axis["left"].get_helper().nth_coord_ticks=1 > ax1.axis["bottom"].get_helper().nth_coord_ticks=1 > > # set labels > ax1.axis["left"].label.set_text(r'ylabel') > ax1.axis["bottom"].label.set_text(r'xlabel') > ax1.axis["bottom"].major_ticklabels.set_rotation(-30) > > ax1.set_aspect(1.) > ax1.set_xlim(rLower, rUpper) > ax1.set_ylim(rLower, rUpper) > #ax1.rscale('log') > > # A parasite axes with given transform > ax2 = ParasiteAxesAuxTrans(ax1, tr, "equal") > # note that ax2.transData == tr + ax1.transData > # Anthing you draw in ax2 will match the ticks and grids of ax1. > ax1.parasites.append(ax2) > > ax2.plot(lp_t, lp_r, 'o-') > #ax2.semilogy(lp_t, lp_r, 'o-') > #ax2.set_rscale('log') > #ax1.set_xscale('log') > #ax1.set_yscale('log') > > ax1.grid(True) > > if __name__ == "__main__": > > fig = plt.figure(1, figsize=(5, 5)) > fig.clf() > > rmin = 1e-1 > rmax = 1e2 > lp_t = np.linspace(0., 90., 5) > lp_r = np.linspace(rmin, rmax/10, 5)*5 > > print "lp_t: ", lp_t > print "lp_r: ", lp_r > print "log10(lp_r): ", np.log10(lp_r) > > curvelinear_test2(fig, lp_t, lp_r, rmin, rmax) > #curvelinear_test2(fig, lp_t, np.log10(lp_r), np.log10(rmin), np.log(rmax)) > > plt.show() > > [/Code] > > I'm using Enthought Python Distribution Version: 7.0-2 (32-bit) Python > 2.7.1 on win32 > and matplotlib.__version__ is '1.0.1'. > > Thanks, > Junghun Shin > -- > Division of Electrical, Electronic and Information Engineering, > Graduate School of Engineering, Osaka University, > 2-6 Yamada-oka, Suita-shi, Osaka, 565-0871, JAPAN > Tel / Fax: +81-6-6879-8755 > E-mail: jh...@ef... > Group Homepage: http://www.eie.eng.osaka-u.ac.jp/ef/ > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: jfortiv <jf...@gm...> - 2011-04-28 04:32:08
|
This worked. Thank you very much! For some reason I had commented out ax.fmt_xdata = ... This is exactly what I needed. James Goyo wrote: > > 2011/4/23 jfortiv <jf...@gm...>: >> >> Hi, >> >> This actually did not work for me. Can you show me the full code that >> you >> used to successfully produce the time-format x-axis labels? > > See attached files. > > Goyo > > > > ------------------------------------------------------------------------------ > Fulfilling the Lean Software Promise > Lean software platforms are now widely adopted and the benefits have been > demonstrated beyond question. Learn why your peers are replacing JEE > containers with lightweight application servers - and what you can gain > from the move. http://p.sf.net/sfu/vmware-sfemails > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/Date-format-the-x-axis-of-a-barh%28%29-plot--tp31420395p31493421.html Sent from the matplotlib - users mailing list archive at Nabble.com. |