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
(4) |
3
(12) |
|
4
(5) |
5
(30) |
6
(21) |
7
(20) |
8
(11) |
9
(9) |
10
(12) |
|
11
(11) |
12
(22) |
13
(22) |
14
(38) |
15
(25) |
16
(23) |
17
(20) |
|
18
(7) |
19
(13) |
20
(13) |
21
(18) |
22
(6) |
23
(7) |
24
(4) |
|
25
(9) |
26
(35) |
27
(37) |
28
(22) |
29
(27) |
30
(12) |
31
(4) |
|
From: Einar M. E. <ein...@gm...> - 2009-01-19 14:20:12
|
Hi all.
is it not possible to extend plot outside of a plot area? To
illustrate what I want
to do take for example the wind barbs example from the matplotlib
gallery.
(see below)
I only changed line 23 from ax.barbs(X, Y, U, V) to ax.barbs(X, Y, -
U, -V)
But now we don't see the tail of the barbs in the first subplot.
So Is it possible to let matplotlib plot the tail, without extending
the axes?
Best Regards
Einar M. Einarsson
'''
Demonstration of wind barb plots
'''
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-5, 5, 5)
X,Y = np.meshgrid(x, x)
U, V = 12*X, 12*Y
data = [(-1.5, .5, -6, -6),
(1, -1, -46, 46),
(-3, -1, 11, -11),
(1, 1.5, 80, 80),
(0.5, 0.25, 25, 15),
(-1.5, -0.5, -5, 40)]
data = np.array(data, dtype=[('x', np.float32), ('y', np.float32),
('u', np.float32), ('v', np.float32)])
#Default parameters, uniform grid
ax = plt.subplot(2,2,1)
ax.barbs(X, Y, -U, -V)
#Arbitrary set of vectors, make them longer and change the pivot point
#(point around which they're rotated) to be the middle
ax = plt.subplot(2,2,2)
ax.barbs(data['x'], data['y'], data['u'], data['v'], length=8,
pivot='middle')
#Showing colormapping with uniform grid. Fill the circle for an
empty barb,
#don't round the values, and change some of the size parameters
ax = plt.subplot(2,2,3)
ax.barbs(X, Y, U, V, np.sqrt(U*U + V*V), fill_empty=True,
rounding=False,
sizes=dict(emptybarb=0.25, spacing=0.2, height=0.3))
#Change colors as well as the increments for parts of the barbs
ax = plt.subplot(2,2,4)
ax.barbs(data['x'], data['y'], data['u'], data['v'], flagcolor='r',
barbcolor=['b','g'], barb_increments=dict(half=10, full=20,
flag=100),
flip_barb=True)
plt.show()
|
|
From: <And...@ti...> - 2009-01-19 10:20:39
|
Hi,
I have been trying to build matplotlib on SLED 10:
+ python setup.py build
============================================================================
BUILDING MATPLOTLIB
matplotlib: 0.98.5.2
python: 2.5.2 (r252:60911, Aug 21 2008, 18:45:08) [GCC
3.3.6]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.2.1
freetype2: found, but unknown version (no pkg-config)
OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
* Guessing the library and include directories for
* Tcl and Tk because the tclConfig.sh and
* tkConfig.sh could not be found and/or parsed.
wxPython: no
* wxPython not found
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: no
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: matplotlib will provide
pytz: matplotlib will provide
adding pytz
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: 7.05
latex: no
pdftops: 3.01
[Edit setup.cfg to suppress the above messages]
============================================================================
but have encountered some problems:
g++ -pthread -shared -L/app/gcc/3.3.6/lib -L/app/zlib/1.2.x/lib -L/app/tk/8.4.x/lib -L/app/tcl/8.4.x/lib -L/app/readline/5.0/lib -L/app/openssl/0.9.x/lib -L/app/ncurses/5.5/lib -L/app/gdbm/1.8.3/lib -L/app/expect/5.x/lib -L/app/expat/2.0.x/lib -L/app/db/4.3.x/lib -L/usr/X11R6/lib -Wl,--rpath=/app/Python/2.5.x/lib:/app/gcc/3.3.6/lib:/app/zlib/1.2.x/lib:/app/tk/8.4.x/lib:/app/tcl/8.4.x/lib:/app/readline/5.0/lib:/app/openssl/0.9.x/lib:/app/ncurses/5.5/lib:/app/gdbm/1.8.3/lib:/app/expect/5.x/lib:/app/expat/2.0.x/lib:/app/db/4.3.x/lib:/usr/X11R6/lib -L /app/Python/2.5.x/lib -L/app/gcc/3.3.6/lib -L/app/zlib/1.2.x/lib -L/app/tk/8.4.x/lib -L/app/tcl/8.4.x/lib -L/app/libpng/1.2.x/lib -L/app/freetype/2.1.x/lib -L/usr/X11R6/lib -Wl,--rpath=/app/Python/modules/2.5/matplotlib/0.98.5.2/lib:/app/gcc/3.3.6/lib:/app/zlib/1.2.x/lib:/app/tk/8.4.x/lib:/app/tcl/8.4.x/lib:/app/libpng/1.2.x/lib:/app/freetype/2.1.x/lib:/usr/X11R6/lib -O2 -g -march=i386 -mcpu=i686 -fno-strict-aliasing build/temp.linux-i686-2.5/agg24/src/agg_trans_affine.o build/temp.linux-i686-2.5/agg24/src/agg_bezier_arc.o build/temp.linux-i686-2.5/agg24/src/agg_curves.o build/temp.linux-i686-2.5/agg24/src/agg_vcgen_dash.o build/temp.linux-i686-2.5/agg24/src/agg_vcgen_stroke.o build/temp.linux-i686-2.5/agg24/src/agg_image_filters.o build/temp.linux-i686-2.5/src/_image.o build/temp.linux-i686-2.5/src/ft2font.o build/temp.linux-i686-2.5/src/mplutils.o build/temp.linux-i686-2.5/CXX/cxx_extensions.o build/temp.linux-i686-2.5/CXX/cxxsupport.o build/temp.linux-i686-2.5/CXX/IndirectPythonInterface.o build/temp.linux-i686-2.5/CXX/cxxextensions.o build/temp.linux-i686-2.5/src/backend_agg.o -L/app/libpng/1.2.x/lib -L/app/freetype/2.1.x/lib -L/app/tcl/8.4.x/lib -L/app/tk/8.4.x/lib -L/app/libpng/1.2.x/lib -L/app/freetype/2.1.x/lib -L/app/tcl/8.4.x/lib -L/app/tk/8.4.x/lib -L/app/Python/2.5.x/lib -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -lpython2.5 -o build/lib.linux-i686-2.5/matplotlib/backends/_backend_agg.so
`.L53185' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53186' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53196' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53206' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53207' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53184' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53217' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53236' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53246' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
`.L53265' referenced in section `.rodata' of build/temp.linux-i686-2.5/src/backend_agg.o: defined in discarded section `.gnu.linkonce.t._ZN3agg18rasterizer_sl_clipINS_12ras_conv_intEE7line_toINS_19rasterizer_cells_aaINS_7cell_aaEEEEEvRT_ii' of build/temp.linux-i686-2.5/src/backend_agg.o
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1
I have seen another guy having a similar problem but without solution:
http://forum.hardware.fr/hfr/Programmation/Python/installation-package-matplotlib-sujet_118770_1.htm
I am quite out in the blue here, so if anybody has a clue on what to do, please let me know.
Thnaks,
Anders
|
|
From: Simone G. <sim...@gm...> - 2009-01-19 08:33:49
|
I see that you first build your array and then display it at the end... is it possible in matplotlib to update the plot while the class is evolving? like: f.evolve(6) f.display() f.evolve(.27) f.display() f.evolve(10) f.display() f.evolve(2) f.display() best regards, simone 2009/1/19 C Lewis <ch...@na...>: > #Skeleton example of a taking snapshots of an evolving class > import pylab as p > from math import log > class foo: > def __init__(self): > self.red = 0 > self.green = 1 > self.age = 0 > self.history = ([self.age],[self.red],[self.green]) > > def snapshot(self): > self.history[0].append(self.age) > self.history[1].append(self.red) > self.history[2].append(self.green) > > def evolve(self, time): > self.red = self.red + time/2 > self.green = self.green * log(time) > self.age = self.age + time > self.snapshot() > > def display(self): > > p.plot(self.history[0],self.history[1],self.history[0],self.history[2]) > p.show() > > if __name__ == '__main__': > f = foo() > f.snapshot() > f.evolve(6); f.evolve(.27);f.evolve(10);f.evolve(2) > print f.history > f.display() > > On Jan 18, 2009, at 3:18 PM, Simone Gabbriellini wrote: > >> thanks, it is exactly what I need... I have undestood the logic, I >> build a plot, put my traits values into an array and then I call the >> add_current_state_to_plot function to update the plot with the new >> values... >> >> I am an absolute beginner of matplotlib, can you give me a little >> example of add_current_state_to_plot function? Because I don't know >> the right way to update: do I have to pass all the array, or just the >> new values? >> >> best regards, >> simone >> >> 2009/1/18 C Lewis <ch...@na...>: >>> >>> Guessing about what you want: >>> >>> Does the class change with time? that is, perhaps you have a class foo, >>> and >>> foo evolves, and you would like to plot a history of some traits of foo, >>> but >>> at any given moment foo only contains its current state? >>> >>> If so, I think you need to have a function in foo, or even a separate >>> class, >>> that takes `snapshots' of foo's traits on one schedule, and stores them, >>> and >>> can also plot them on some schedule. Choosing how to do that is more a >>> python problem than a matplotlib problem; personally, I have something >>> set >>> up so class 'profile' has functions to 'setup_plot' and >>> 'add_current_state_to_plot', and I just have to choose when to call the >>> latter. >>> >>> Or you can just store the values and plot at the end; once you have one >>> list >>> of the times, and a separate list of each trait's history at those times, >>> you're set up for matplotlib plotting, e.g. >>> >>> from pylab import * >>> plot(times, traitA, times, traitB, times, traitC) >>> show() >>> >>> although, while looking for a simple example, I found this: >>> >>> >>> http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html >>> >>> which is not totally simple but looks great. >>> >>> >>> &C >>> >>> On Jan 18, 2009, at 9:36 AM, Simone Gabbriellini wrote: >>> >>>> Dear List, >>>> >>>> I have some variables I want to plot... the values of those variable >>>> change in time... I would like to plot the result with a traditional >>>> line plot >>>> >>>> those variables are traits of a class (don't know if this can make a >>>> difference...) >>>> >>>> is there any example of this with matplotlib? >>>> >>>> best regards, >>>> simone gabbriellini >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by: >>>> SourcForge Community >>>> SourceForge wants to tell your story. >>>> http://p.sf.net/sfu/sf-spreadtheword >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> > > Chloe Lewis > Graduate student, Amundson Lab > Division of Ecosystem Sciences, ESPM > University of California, Berkeley > 137 Mulford Hall - #3114 > Berkeley, CA 94720-3114 > ch...@na... > > |
|
From: Joshua L. <dis...@gm...> - 2009-01-19 07:01:13
|
Could you provide an example of code you've written that highlights this and a more specific description of what you mean by coming out poorly? Josh On Sun, Jan 18, 2009 at 11:51 PM, Gideon Simpson <si...@ma...> wrote: > Has anyone else noticed that when using latex with the OS X backend, > figures, while appearing fine on screen, come out poorly when saved as > images? > -gideon > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Gideon S. <si...@ma...> - 2009-01-19 05:18:24
|
Has anyone else noticed that when using latex with the OS X backend, figures, while appearing fine on screen, come out poorly when saved as images? -gideon |
|
From: C L. <ch...@na...> - 2009-01-19 00:41:58
|
#Skeleton example of a taking snapshots of an evolving class
import pylab as p
from math import log
class foo:
def __init__(self):
self.red = 0
self.green = 1
self.age = 0
self.history = ([self.age],[self.red],[self.green])
def snapshot(self):
self.history[0].append(self.age)
self.history[1].append(self.red)
self.history[2].append(self.green)
def evolve(self, time):
self.red = self.red + time/2
self.green = self.green * log(time)
self.age = self.age + time
self.snapshot()
def display(self):
p.plot(self.history[0],self.history[1],self.history[0],self.history[2])
p.show()
if __name__ == '__main__':
f = foo()
f.snapshot()
f.evolve(6); f.evolve(.27);f.evolve(10);f.evolve(2)
print f.history
f.display()
On Jan 18, 2009, at 3:18 PM, Simone Gabbriellini wrote:
> thanks, it is exactly what I need... I have undestood the logic, I
> build a plot, put my traits values into an array and then I call the
> add_current_state_to_plot function to update the plot with the new
> values...
>
> I am an absolute beginner of matplotlib, can you give me a little
> example of add_current_state_to_plot function? Because I don't know
> the right way to update: do I have to pass all the array, or just the
> new values?
>
> best regards,
> simone
>
> 2009/1/18 C Lewis <ch...@na...>:
>> Guessing about what you want:
>>
>> Does the class change with time? that is, perhaps you have a class
>> foo, and
>> foo evolves, and you would like to plot a history of some traits of
>> foo, but
>> at any given moment foo only contains its current state?
>>
>> If so, I think you need to have a function in foo, or even a
>> separate class,
>> that takes `snapshots' of foo's traits on one schedule, and stores
>> them, and
>> can also plot them on some schedule. Choosing how to do that is
>> more a
>> python problem than a matplotlib problem; personally, I have
>> something set
>> up so class 'profile' has functions to 'setup_plot' and
>> 'add_current_state_to_plot', and I just have to choose when to call
>> the
>> latter.
>>
>> Or you can just store the values and plot at the end; once you have
>> one list
>> of the times, and a separate list of each trait's history at those
>> times,
>> you're set up for matplotlib plotting, e.g.
>>
>> from pylab import *
>> plot(times, traitA, times, traitB, times, traitC)
>> show()
>>
>> although, while looking for a simple example, I found this:
>>
>> http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html
>>
>> which is not totally simple but looks great.
>>
>>
>> &C
>>
>> On Jan 18, 2009, at 9:36 AM, Simone Gabbriellini wrote:
>>
>>> Dear List,
>>>
>>> I have some variables I want to plot... the values of those variable
>>> change in time... I would like to plot the result with a traditional
>>> line plot
>>>
>>> those variables are traits of a class (don't know if this can make a
>>> difference...)
>>>
>>> is there any example of this with matplotlib?
>>>
>>> best regards,
>>> simone gabbriellini
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by:
>>> SourcForge Community
>>> SourceForge wants to tell your story.
>>> http://p.sf.net/sfu/sf-spreadtheword
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
Chloe Lewis
Graduate student, Amundson Lab
Division of Ecosystem Sciences, ESPM
University of California, Berkeley
137 Mulford Hall - #3114
Berkeley, CA 94720-3114
ch...@na...
|
|
From: Simone G. <sim...@gm...> - 2009-01-18 23:18:23
|
thanks, it is exactly what I need... I have undestood the logic, I build a plot, put my traits values into an array and then I call the add_current_state_to_plot function to update the plot with the new values... I am an absolute beginner of matplotlib, can you give me a little example of add_current_state_to_plot function? Because I don't know the right way to update: do I have to pass all the array, or just the new values? best regards, simone 2009/1/18 C Lewis <ch...@na...>: > Guessing about what you want: > > Does the class change with time? that is, perhaps you have a class foo, and > foo evolves, and you would like to plot a history of some traits of foo, but > at any given moment foo only contains its current state? > > If so, I think you need to have a function in foo, or even a separate class, > that takes `snapshots' of foo's traits on one schedule, and stores them, and > can also plot them on some schedule. Choosing how to do that is more a > python problem than a matplotlib problem; personally, I have something set > up so class 'profile' has functions to 'setup_plot' and > 'add_current_state_to_plot', and I just have to choose when to call the > latter. > > Or you can just store the values and plot at the end; once you have one list > of the times, and a separate list of each trait's history at those times, > you're set up for matplotlib plotting, e.g. > > from pylab import * > plot(times, traitA, times, traitB, times, traitC) > show() > > although, while looking for a simple example, I found this: > > http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html > > which is not totally simple but looks great. > > > &C > > On Jan 18, 2009, at 9:36 AM, Simone Gabbriellini wrote: > >> Dear List, >> >> I have some variables I want to plot... the values of those variable >> change in time... I would like to plot the result with a traditional >> line plot >> >> those variables are traits of a class (don't know if this can make a >> difference...) >> >> is there any example of this with matplotlib? >> >> best regards, >> simone gabbriellini >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: C L. <ch...@na...> - 2009-01-18 22:41:07
|
Guessing about what you want: Does the class change with time? that is, perhaps you have a class foo, and foo evolves, and you would like to plot a history of some traits of foo, but at any given moment foo only contains its current state? If so, I think you need to have a function in foo, or even a separate class, that takes `snapshots' of foo's traits on one schedule, and stores them, and can also plot them on some schedule. Choosing how to do that is more a python problem than a matplotlib problem; personally, I have something set up so class 'profile' has functions to 'setup_plot' and 'add_current_state_to_plot', and I just have to choose when to call the latter. Or you can just store the values and plot at the end; once you have one list of the times, and a separate list of each trait's history at those times, you're set up for matplotlib plotting, e.g. from pylab import * plot(times, traitA, times, traitB, times, traitC) show() although, while looking for a simple example, I found this: http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html which is not totally simple but looks great. &C On Jan 18, 2009, at 9:36 AM, Simone Gabbriellini wrote: > Dear List, > > I have some variables I want to plot... the values of those variable > change in time... I would like to plot the result with a traditional > line plot > > those variables are traits of a class (don't know if this can make a > difference...) > > is there any example of this with matplotlib? > > best regards, > simone gabbriellini > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Jae-Joon L. <lee...@gm...> - 2009-01-18 20:03:54
|
I'm afraid that you may not be able to do those with the subplot. If you want a fixed size axes, you need to manually calculate the axes position (in normalized figure coordinates) using the figure size. You may use my helper class which support a fixed-size axes. http://dl.getdropbox.com/u/178748/mpl/axes_divider.py import matplotlib.pyplot as plt from axes_divider import make_axes_locatable fig1 = plt.figure(1, (6, 6)) ax = fig1.add_subplot(1, 1, 1) divider = make_axes_locatable(ax) # make a new axes with fixed height (1 inch) above ax ax2 = divider.new_vertical(size=1, pad=0.1, sharex=ax) # size in inches fig1.add_axes(ax2) plt.show() Regardless of the figure size, ax2 will always have 1 inch height and ax will have the rest of the subplot area. Regards, -JJ On Thu, Jan 15, 2009 at 1:14 PM, Eric Jonas <jo...@mi...> wrote: > I've looked in both the examples and the docs, and have yet to find a > clear way of accomplishing the following: > > I have a plot with two subplots: > > |-----------------------------------| > | | > | | > |-----------------------------------| > | | > | | > | | > . . > . . > > > That is, I want the top subplot (which shows aggregate data, using the > same x-axis) to always be, say, 80 pix high, and the bottom subplot > to scale with the number of things (in this case, sparkline-like > timelines) I add to it. So there's not a constant ratio between > the top and bottom subplots. Might anyone be able to point me in the > right direction, either to an explicit example or someplace in the > docs? > > > Thanks! > ...Eric Jonas > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jae-Joon L. <lee...@gm...> - 2009-01-18 19:26:11
|
twinx makes a separate axes and zorders are only meaningful within a same axes. Because ax2 is added to the figure later than the original axes, artists in ax2 are always above others. I don't think there is an easy way to make zorder work between several axes, unless you somehow merge them into a single axes. You may try my (a bit experimental) helper class made for this purpose. http://dl.getdropbox.com/u/178748/mpl/parasite_axes2.py import matplotlib.pyplot as plt from parasite_axes2 import SubplotHost f = plt.figure(2) ax = SubplotHost(f, 1, 1, 1) f.add_subplot(ax) ax.plot([20,30], [0, 5], color="red", lw=5, zorder=10) ax2=ax.twinx() ax2.grid(ls="-", lw=5, zorder=-1) ax2.set_axisbelow(True) plt.show() -JJ On Sun, Jan 18, 2009 at 7:48 AM, Olle Engdegård <ol...@fy...> wrote: > > Hi, > > Does the zorder work between twin axis? I can't get lines on the first > axis to be on top of the second grid: > > > plot([20,30], [0, 5], color="red", lw=5, zorder=10) > ax2=twinx() > grid(ls="-", lw=5, zorder=-1) > ax2.set_axisbelow(True) > title("Why doesn't the read line go above the second axis?") > > Cheers, > Olle > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Simone G. <sim...@gm...> - 2009-01-18 17:36:59
|
Dear List, I have some variables I want to plot... the values of those variable change in time... I would like to plot the result with a traditional line plot those variables are traits of a class (don't know if this can make a difference...) is there any example of this with matplotlib? best regards, simone gabbriellini |
|
From: Olle E. <ol...@fy...> - 2009-01-18 13:06:26
|
Hi,
Does the zorder work between twin axis? I can't get lines on the first
axis to be on top of the second grid:
plot([20,30], [0, 5], color="red", lw=5, zorder=10)
ax2=twinx()
grid(ls="-", lw=5, zorder=-1)
ax2.set_axisbelow(True)
title("Why doesn't the read line go above the second axis?")
Cheers,
Olle
|
|
From: Michael D. <md...@gm...> - 2009-01-18 10:42:58
|
#!/usr/bin/env python
# embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases
#
# Copyright (C) 2005 Florent Rougon
# 2006 Darren Dale
#
# This file is an example program for matplotlib. It may be used and
# modified with no restriction; raw copies as well as modified versions
# may be distributed without limitation.
import sys, os, random
from PyQt4 import QtGui, QtCore
from numpy import arange, sin, pi
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
progname = os.path.basename(sys.argv[0])
progversion = "0.1"
class MyMplCanvas(FigureCanvas):
"""Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.)."""
def __init__(self, parent=None, width=5, height=4, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = fig.add_subplot(111)
# We want the axes cleared every time plot() is called
self.axes.hold(False)
self.compute_initial_figure()
#
FigureCanvas.__init__(self, fig)
self.setParent(parent)
FigureCanvas.setSizePolicy(self,
QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
def compute_initial_figure(self):
pass
class MyStaticMplCanvas(MyMplCanvas):
"""Simple canvas with a sine plot."""
def compute_initial_figure(self):
t = arange(0.0, 3.0, 0.01)
s = sin(2*pi*t)
self.axes.plot(t, s)
class MyDynamicMplCanvas(MyMplCanvas):
"""A canvas that updates itself every second with a new plot."""
def __init__(self, *args, **kwargs):
MyMplCanvas.__init__(self, *args, **kwargs)
timer = QtCore.QTimer(self)
QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"), self.update_figure)
timer.start(1000)
def compute_initial_figure(self):
self.axes.plot([0, 1, 2, 3], [1, 2, 0, 4], 'r')
def update_figure(self):
# Build a list of 4 random integers between 0 and 10 (both inclusive)
l = [ random.randint(0, 10) for i in xrange(4) ]
self.axes.plot([0, 1, 2, 3], l, 'r')
self.axes.yaxis.set_ticklabels(["1", "2", "3"])
self.draw()
class ApplicationWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setWindowTitle("application main window")
self.file_menu = QtGui.QMenu('&File', self)
self.file_menu.addAction('&Quit', self.fileQuit,
QtCore.Qt.CTRL + QtCore.Qt.Key_Q)
self.menuBar().addMenu(self.file_menu)
self.help_menu = QtGui.QMenu('&Help', self)
self.menuBar().addSeparator()
self.menuBar().addMenu(self.help_menu)
self.help_menu.addAction('&About', self.about)
self.main_widget = QtGui.QWidget(self)
l = QtGui.QVBoxLayout(self.main_widget)
sc = MyStaticMplCanvas(self.main_widget, width=5, height=4, dpi=100)
dc = MyDynamicMplCanvas(self.main_widget, width=5, height=4, dpi=100)
toolbar = NavigationToolbar(dc, dc)
l.addWidget(sc)
l.addWidget(dc)
l.addWidget(toolbar)
self.main_widget.setFocus()
self.setCentralWidget(self.main_widget)
self.statusBar().showMessage("All hail matplotlib!", 2000)
def fileQuit(self):
self.close()
def closeEvent(self, ce):
self.fileQuit()
def about(self):
QtGui.QMessageBox.about(self, "About %s" % progname,
u"""%(prog)s version %(version)s
Copyright \N{COPYRIGHT SIGN} 2005 Florent Rougon, 2006 Darren Dale
This program is a simple example of a Qt4 application embedding matplotlib
canvases.
It may be used and modified with no restriction; raw copies as well as
modified versions may be distributed without limitation."""
% {"prog": progname, "version": progversion})
qApp = QtGui.QApplication(sys.argv)
aw = ApplicationWindow()
aw.setWindowTitle("%s" % progname)
aw.show()
sys.exit(qApp.exec_())
#qApp.exec_() |
|
From: Adam M. <ram...@gm...> - 2009-01-17 23:25:13
|
On Sat, Jan 17, 2009 at 17:19, Adam Mercer <ram...@gm...> wrote: > Hi > > I'm trying to track down an issue with the CocoaAgg backend on Mac OS > X using MacPorts, when run with the CocoaAgg backend the following > code: Sorry, should have mentioned that this is with Matplotlib-0.98.5.2 using Mac OS X Leopard. Cheers Adam |
|
From: Adam M. <ram...@gm...> - 2009-01-17 23:19:17
|
Hi
I'm trying to track down an issue with the CocoaAgg backend on Mac OS
X using MacPorts, when run with the CocoaAgg backend the following
code:
from pylab import *
import time
ion()
tstart = time.time()
x = arange(0,2*pi,0.01)
line, = plot(x,sin(x))
for i in arange(1,200):
line.set_ydata(sin(x+i/10.0))
draw()
print 'FPS:' , 200/(time.time()-tstart)
fails with the backtrace:
$ python temp.py -dCocoaAgg
Traceback (most recent call last):
File "temp.py", line 2, in <module>
from pylab import *
File "/opt/local/lib/python2.5/site-packages/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/opt/local/lib/python2.5/site-packages/matplotlib/pylab.py",
line 253, in <module>
from matplotlib.pyplot import *
File "/opt/local/lib/python2.5/site-packages/matplotlib/pyplot.py",
line 75, in <module>
new_figure_manager, draw_if_interactive, show = pylab_setup()
File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_cocoaagg.py",
line 54, in <module>
class FigureCanvasCocoaAgg(FigureCanvasAgg):
File "/opt/local/lib/python2.5/site-packages/matplotlib/backends/backend_cocoaagg.py",
line 63, in FigureCanvasCocoaAgg
start_event_loop.__doc__=FigureCanvasBase.start_event_loop_default.__doc__
NameError: name 'FigureCanvasBase' is not defined
However this runs without issue using the MacOSX backend:
$ python temp.py -dMacOSX
FPS: 20.1183278689
Is there some missing dependency that could cause this?
Cheers
Adam
|
|
From: Pierre GM <pgm...@gm...> - 2009-01-17 20:11:52
|
Anton, You may wanna check on the numpy list as well. I recently reimplemented a function to read text file as a combination of numpy.loadtxt and mlab.csv2rec, that handles missing data nicely. You can get it here for the moment: https://code.launchpad.net/~pierregm/numpy/numpy_addons The function you would need is mafromtxt, in fromascii. Alternatively, you can try using the scikits.timeseries package (http://pytseries.sourceforge.net/ ): recent SVN versions introduced tsfromtxt, that read a text file and return a timeseries. However, none of these possibilities will work out-of-the-box, because of the presence of the footer. What you could do is write a first function that gets rid of this footer (example of MO: open the file, read all the lines in a list, get rid of the first 7 rows (header) and last 8 ones, store the result in a file). Once you have only the data, use mafromtxt (for example) using space as a delimiter, and specify the columns you want to use with usecols (that way, you can get rid of the column with the '*'). The missing data should be taken into account properly. Let me know how it goes. P. On Jan 17, 2009, at 2:16 AM, antonv wrote: > > Dear all, > > I know this is not related to matplotlib but this seems to be the > only place > where I found people that have knowledge of both NOAA data and > python so > please bear with me. > > The .bull file that NOAA gives for upload is an ascii file formatted > for > human readability but it creates a lot of issues when I am trying to > parse > it. Here is a link to one of these files: > > ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/wave/prod/wave.20090117/bulls.t00z/akw.46001.bull > > Do you have any idea on how to extract the data there in columns for > plotting with matplotlib? If you look at the file you'll notice that > there > is both a header and a footer for the file that needs to be > eliminated and > the main columns have sub columns also. Another issue is that in a > column > there is missing data that should keep it's relationship with the time > column. And the last issue, some of the values there are preceded by > a "*" > sign that should just be removed too. > > Any ideas are greatly appreciated! > > Anton > > -- > View this message in context: http://www.nabble.com/NOAA-.bull-file-parsing-tp21513800p21513800.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jd...@gm...> - 2009-01-17 12:50:37
|
On Fri, Jan 16, 2009 at 10:34 PM, Eric Firing <ef...@ha...> wrote: > antonv wrote: >> Thanks for the quick reply John! Now it makes a lot more sense. The next dumb >> question is what is SVN and where can I find more bout it? > > http://sourceforge.net/svn/?group_id=80706 > http://subversion.tigris.org/ See also http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn JDH |
|
From: David T. <dl...@ca...> - 2009-01-17 12:28:12
|
Managed to solve the problem now. David David Trethewey wrote: > I think I realised what I was doing wrong, I didn't have the imshow() > call beforehand in my program: > > But using the code: > > cax = fig.add_axes([0.85, 0.1, 0.075, 0.8]) > a=outer(arange(0,1,0.01),ones(10)) > imshow(a,aspect='auto',cmap=cm.gray,origin='lower') > > I get a set of axes from 0 to 10 in the x direction and 0 to 100 in > y.How do I get rid of the x axis and scale the y axis from 0 to 1. > > David > > David Trethewey wrote: > >> I've been trying to add a colorbar to my figure and have used the >> following code; >> >> cax = axes([0.85, 0.1, 0.075, 0.8]) >> colorbar(cax=cax) >> >> as a template (from >> http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html) >> >> However I get an error: >> >> Traceback (most recent call last): >> File "cornwall2.py", line 640, in <module> >> >> draw_parishes(n_parishes,m_parishes,preoccratio_parishes,0,nthroot,scaling) >> File "cornwall2.py", line 112, in draw_parishes >> colorbar(cax=cax) >> File >> "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\pyplot.py", >> line 1295, in colorbar >> ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) >> File >> "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\figure.py", >> line 977, in colorbar >> cb = cbar.Colorbar(cax, mappable, **kw) >> File >> "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\colorbar.py", >> line 595, in __init__ >> mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax >> AttributeError: 'NoneType' object has no attribute 'autoscale_None' >> >> >> How am I using colorbar incorrectly? >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: David T. <dl...@ca...> - 2009-01-17 10:23:27
|
I think I realised what I was doing wrong, I didn't have the imshow()
call beforehand in my program:
But using the code:
cax = fig.add_axes([0.85, 0.1, 0.075, 0.8])
a=outer(arange(0,1,0.01),ones(10))
imshow(a,aspect='auto',cmap=cm.gray,origin='lower')
I get a set of axes from 0 to 10 in the x direction and 0 to 100 in
y.How do I get rid of the x axis and scale the y axis from 0 to 1.
David
David Trethewey wrote:
> I've been trying to add a colorbar to my figure and have used the
> following code;
>
> cax = axes([0.85, 0.1, 0.075, 0.8])
> colorbar(cax=cax)
>
> as a template (from
> http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html)
>
> However I get an error:
>
> Traceback (most recent call last):
> File "cornwall2.py", line 640, in <module>
>
> draw_parishes(n_parishes,m_parishes,preoccratio_parishes,0,nthroot,scaling)
> File "cornwall2.py", line 112, in draw_parishes
> colorbar(cax=cax)
> File
> "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\pyplot.py",
> line 1295, in colorbar
> ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
> File
> "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\figure.py",
> line 977, in colorbar
> cb = cbar.Colorbar(cax, mappable, **kw)
> File
> "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\colorbar.py",
> line 595, in __init__
> mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax
> AttributeError: 'NoneType' object has no attribute 'autoscale_None'
>
>
> How am I using colorbar incorrectly?
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: David T. <dl...@ca...> - 2009-01-17 10:05:22
|
I've been trying to add a colorbar to my figure and have used the following code; cax = axes([0.85, 0.1, 0.075, 0.8]) colorbar(cax=cax) as a template (from http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html) However I get an error: Traceback (most recent call last): File "cornwall2.py", line 640, in <module> draw_parishes(n_parishes,m_parishes,preoccratio_parishes,0,nthroot,scaling) File "cornwall2.py", line 112, in draw_parishes colorbar(cax=cax) File "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\pyplot.py", line 1295, in colorbar ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) File "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\figure.py", line 977, in colorbar cb = cbar.Colorbar(cax, mappable, **kw) File "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\colorbar.py", line 595, in __init__ mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax AttributeError: 'NoneType' object has no attribute 'autoscale_None' How am I using colorbar incorrectly? |
|
From: C L. <ch...@na...> - 2009-01-17 09:24:15
|
Someplace to start:
----
from matplotlib import cm
shade = cm.bone_r
cmstep = shade.N/len(vg_bulk) #TODO: even *more* elegant to space
colors by time elapsed
for ii in range(len(vg_bulk)):
hue = shade(ii*cmstep)
#convert to moles
for iii in (0,1,2):
vg_bulk[ii][1][iii] = vg_bulk[ii][1][iii]*(10**6*22.4)**-1
ba.plot(vg_bulk[ii][1], vg_sites,
color = hue, linestyle=':', marker='o',label='%d
days'%vg_bulk[ii][0])
----
and here's what I do for linestyle themes, when I don't know how many
lines I'm going to plot but want adjacent ones to be different (and a
set of less than seven looks nice):
----
from itertools import cycle
self.linestyleskwargs = cycle(map(lambda tu:
dict(zip(('color','dashes'),tu)), (('0.5',(4,1,1,1)),('0.4',(2,1)),
('0.3',(5,1,2,1)),('0.2',(4,1)),('0.1',(6,1)), ('0.0',(10,1)))))
for g in self.gases.values():
style = self.linestyleskwargs.next()
p.plot(g.conc,n.linspace(0,self.depth,self.depth/
self.delx),label=g.label, **style)
----
I'm sure either of these examples can be made tidier, or they could be
combined, or one could set up something to replot all the lines in an
existing plot, with nicely spaced colors, once you know how many there
are.
&C
On Jan 16, 2009, at 3:37 PM, Yang Zhang wrote:
> I'm no good at choosing colors. Does matplotlib have a way to
> automatically assign colors (based on a theme), or provide a way to
> choose a color from a theme? (Excel 2007 opened my eyes to this.)
> Currently, when I do:
>
> bar(..., color = 'r', ...)
> bar(..., color = 'y', ...)
> bar(..., color = 'b', ...)
>
> I usually just choose one of the primary colors. It would be nice
> if I
> could instead write the following (or better if the colors could be
> assigned automagically), so I needn't worry about choosing colors:
>
> bar(..., color = themecolor(0), ...)
> bar(..., color = themecolor(1), ...)
> bar(..., color = themecolor(2), ...)
>
> I see these things called colormaps on the home page documentation,
> but
> I can't figure out how to use these (calling autumn() before plotting
> made no change to my plot) or whether they're even what I'm looking
> for.
> Or perhaps there's some Python package out there completely unrelated
> to matplotlib that I could use? Thanks in advance for any hints.
> --
> Yang Zhang
> http://www.mit.edu/~y_z/
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Chloe Lewis
Graduate student, Amundson Lab
Division of Ecosystem Sciences, ESPM
University of California, Berkeley
137 Mulford Hall - #3114
Berkeley, CA 94720-3114
ch...@na...
|
|
From: antonv <vas...@ya...> - 2009-01-17 07:16:58
|
Dear all, I know this is not related to matplotlib but this seems to be the only place where I found people that have knowledge of both NOAA data and python so please bear with me. The .bull file that NOAA gives for upload is an ascii file formatted for human readability but it creates a lot of issues when I am trying to parse it. Here is a link to one of these files: ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/wave/prod/wave.20090117/bulls.t00z/akw.46001.bull Do you have any idea on how to extract the data there in columns for plotting with matplotlib? If you look at the file you'll notice that there is both a header and a footer for the file that needs to be eliminated and the main columns have sub columns also. Another issue is that in a column there is missing data that should keep it's relationship with the time column. And the last issue, some of the values there are preceded by a "*" sign that should just be removed too. Any ideas are greatly appreciated! Anton -- View this message in context: http://www.nabble.com/NOAA-.bull-file-parsing-tp21513800p21513800.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2009-01-17 04:48:38
|
antonv wrote: > Thanks again! That looks cool and seems that it can be used it to a lot of > other projects I have going on! If you are looking for something to use for your own projects, I recommend not svn but one of the more modern distributed vcs systems: mercurial (hg), bzr, or git. I use and like mercurial: http://www.selenic.com/mercurial/wiki/ Eric > > Anton > > > efiring wrote: >> antonv wrote: >>> Thanks for the quick reply John! Now it makes a lot more sense. The next >>> dumb >>> question is what is SVN and where can I find more bout it? >> http://sourceforge.net/svn/?group_id=80706 >> http://subversion.tigris.org/ |
|
From: antonv <vas...@ya...> - 2009-01-17 04:39:54
|
Thanks again! That looks cool and seems that it can be used it to a lot of other projects I have going on! Anton efiring wrote: > > antonv wrote: >> Thanks for the quick reply John! Now it makes a lot more sense. The next >> dumb >> question is what is SVN and where can I find more bout it? > > http://sourceforge.net/svn/?group_id=80706 > http://subversion.tigris.org/ > > Eric > >> >> >> John Hunter-4 wrote: >>> On Fri, Jan 16, 2009 at 10:33 AM, antonv <vas...@ya...> >>> wrote: >>>> I have a series of 18 separate colors to create my cmap but I would >>>> like >>>> to >>>> convert that to a continuous map which interpolates all the other >>>> values >>>> in >>>> between my chosen colors. This should be really easy but I am not sure >>>> how >>>> can it be solved. Any ideas? >>> Although the logic of the LinearSegmentedColormap takes some time to >>> get your head around, it is pretty easy. >>> >>> >>> http://matplotlib.sourceforge.net/api/colors_api.html#matplotlib.colors.LinearSegmentedColormap >>> >>> >>> Here is an example: >>> >>> import numpy as np >>> import matplotlib.pyplot as plt >>> import matplotlib.colors as mcolors >>> import matplotlib.cm as cm >>> colors = 'red', 'green', 'blue', 'yellow', 'orange' >>> >>> ncolors = len(colors) >>> >>> vals = np.linspace(0., 1., ncolors) >>> >>> cdict = dict(red=[], green=[], blue=[]) >>> for val, color in zip(vals, colors): >>> r,g,b = mcolors.colorConverter.to_rgb(color) >>> cdict['red'].append((val, r, r)) >>> cdict['green'].append((val, g, g)) >>> cdict['blue'].append((val, b, b)) >>> >>> cmap = mcolors.LinearSegmentedColormap('mycolors', cdict) >>> >>> >>> x = np.arange(10000.).reshape((100,100)) >>> >>> plt.imshow(x, cmap=cmap) >>> >>> plt.show() >>> >>> See also >>> http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html. >>> I just added a function to svn to support this, so with svn you can >>> do >>> >>> >>> colors = 'red', 'gray', 'green' >>> cmap = mcolors.LinearSegmentedColormap.from_list('mycolors', colors) >>> X, Y = np.meshgrid(np.arange(10), np.arange(10)) >>> plt.imshow(X+Y, cmap=cmap) >>> >>> JDH >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by: >>> SourcForge Community >>> SourceForge wants to tell your story. >>> http://p.sf.net/sfu/sf-spreadtheword >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/cmap-from-sepparate-color-values-tp21503197p21513073.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2009-01-17 04:34:55
|
antonv wrote: > Thanks for the quick reply John! Now it makes a lot more sense. The next dumb > question is what is SVN and where can I find more bout it? http://sourceforge.net/svn/?group_id=80706 http://subversion.tigris.org/ Eric > > > John Hunter-4 wrote: >> On Fri, Jan 16, 2009 at 10:33 AM, antonv <vas...@ya...> >> wrote: >>> I have a series of 18 separate colors to create my cmap but I would like >>> to >>> convert that to a continuous map which interpolates all the other values >>> in >>> between my chosen colors. This should be really easy but I am not sure >>> how >>> can it be solved. Any ideas? >> Although the logic of the LinearSegmentedColormap takes some time to >> get your head around, it is pretty easy. >> >> >> http://matplotlib.sourceforge.net/api/colors_api.html#matplotlib.colors.LinearSegmentedColormap >> >> >> Here is an example: >> >> import numpy as np >> import matplotlib.pyplot as plt >> import matplotlib.colors as mcolors >> import matplotlib.cm as cm >> colors = 'red', 'green', 'blue', 'yellow', 'orange' >> >> ncolors = len(colors) >> >> vals = np.linspace(0., 1., ncolors) >> >> cdict = dict(red=[], green=[], blue=[]) >> for val, color in zip(vals, colors): >> r,g,b = mcolors.colorConverter.to_rgb(color) >> cdict['red'].append((val, r, r)) >> cdict['green'].append((val, g, g)) >> cdict['blue'].append((val, b, b)) >> >> cmap = mcolors.LinearSegmentedColormap('mycolors', cdict) >> >> >> x = np.arange(10000.).reshape((100,100)) >> >> plt.imshow(x, cmap=cmap) >> >> plt.show() >> >> See also >> http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html. >> I just added a function to svn to support this, so with svn you can >> do >> >> >> colors = 'red', 'gray', 'green' >> cmap = mcolors.LinearSegmentedColormap.from_list('mycolors', colors) >> X, Y = np.meshgrid(np.arange(10), np.arange(10)) >> plt.imshow(X+Y, cmap=cmap) >> >> JDH >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |