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
|
|
From: Paul B. <ba...@st...> - 2004-08-18 18:45:17
|
Nor Pirzkal wrote: > > I really like the way matplotlib has been turning out. As a Mac > user, I was wondering how portable to Aquaterm the entire thing might > be. Any idea if a aqua front-end is in the work. While tcl/tk WX etc.. > works well under OSX, it is a lot of stuff to have to compile and > install for a plotting package. No. There is currently no Aqua front-end being developed that I am aware of. Have you any interest in developing one for Aqua? I'd suggest an AquaAgg/MacAgg backend, i.e. use Agg to do the rendering and Aqua to do the windowing, such as is done with GtkAgg, WXAgg, and TkAgg. Once the GUI wrapper is done, most of matplotlib comes along for free. >> >> What's new in matplotlib-0.61.0 - >> >> Note win32 pygtk users - if you encounter problems or errors related >> to svg loading, see note at end of this email. >> [snip, snip] -- Paul Barrett, PhD Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Branch FAX: 410-338-4767 Baltimore, MD 21218 |
|
From: John H. <jdh...@ac...> - 2004-08-18 17:55:20
|
>>>>> "Thomas" == Thomas Barket <tho...@ya...> writes:
Thomas> Btw, what does "TkAgg sets interactive mode to True when
Thomas> you issue the show command" mean exactly?
It means that if you are using tkagg and issue show, it launches the
interactive interpreter (python shell)
Thomas> Wx has such a grid widget which can be used for
Thomas> displaying/editing data, which is what I was hoping to
Thomas> use. However, I am not sure if one should mix different
Thomas> gui's. Iow, if I use tkagg or gtk as my interactive
Thomas> matplotlib gui, can I also display and interact with
Thomas> wxpython grid widgets in the same script smoothly? Am I
Thomas> asking for trouble having the same script display
Thomas> interactive matplotlib charts using one gui type and then
Thomas> display these grid widgets using another gui type? Or
Thomas> should I just stick with one gui type throughout the
Thomas> entire script so that the interactive matplotlib charts
Thomas> use say gtk and the same script also uses gtk for its grid
Thomas> widgets?
OK, now I see better where you are coming from. You have a deluge of
data coming back from the prompt in the interactive shell and are
looking for a better way to deal with it. This is really beyond the
scope of matplotlib since it is a plotting library and your question
goes more to interacting with data. See ipython for solutions to
facilitate better interaction with data.
I can give you a couple of pointers though.
If you save the return value of a plot as a named variable, the output
will be suppressed. Then you can use array slicing to only show a
portion of it.
1 >>> n, bins, patches = hist(randn(10000), 100) # no output printed
2 >>> n[:5] # look at your data in slices using indexing
Out[2]: [1,1,2,5,3,]
ipython has additional features to automatically suppress really large
arrays
1 >>> rand(100,100)
Out[1]: array (100,100) , type = d, has 10000 elements
On to your question about mixing GUIs. Don't do it. You will
explode.
If you want to display your data in a wx grid, you could use the wxagg
matplotlib backend and write some functions to display the data in a
wx grid. Eg, if you are working in a shell that supports wx
interactive work (pycrust), you could write a function to display any
array or vector in a wx grid and then call that function
interactively. Fernando is working on an interactive shell (mentioned
previously) that supports matplotlib/gtk. Once he gets the kinks
worked out, he plans to support matplotlib/wx as well.
If you want to work in gtk (eg matplotlib/gtkagg) the equivalent to a
wx grid is a treeview/liststore. You can write functions to pipe
arrays into grids and then display them by calling that function
interactively. Here is an example using Fernando's ipython-gtk
hunter:~/python/examples/pygtk> python ~/tmp/ip/ipython-gtk.py
Extra content at the end of the document
Python 2.3.2 (#1, Oct 13 2003, 11:33:15)
[GCC 3.3.1] on linux2
Type "copyright", "credits" or "license" for more information.
(MatplotlibShell)
1 >>> from matplotlib.numerix import rand
2 >>> from array_to_grid import view_array
3 >>> view_array( rand(20,10))
Out[3]: <ArrayView object (GtkWindow) at 0x4136db94>
And this is the screenshot -
http://nitace.bsd.uchicago.edu:8080/files/share/Screenshot-Ipython-gtk.py.png
While it would be possible for us to write functions in matplotlib
that would implement view_array (or something like it) for each of the
GUI backends, allowing you to call this function for tk, wx or gtk,
it's really beyond the scope of matplotlib (we're busy enough trying
to plot!). It's more in the domain of a matlab / mathematica like
integrated scientific computing environment, another topic near and
dear to Fernando's heart.
Here is the code array_to_grid.py - you can do a lot more with
treeviews and liststores, eg make a proper editable spreadsheet
interface with scroll bars in both x and y directions, but this will
get you started
'Display an array as a treeview'
import pygtk
pygtk.require('2.0')
import gobject
import gtk
from gtk import gdk
def view_array(X):
'instantiate an ArrayView instance and show it'
grid = ArrayView(X)
grid.show_all()
return grid
class ArrayView(gtk.Window):
def __init__(self, X):
gtk.Window.__init__(self)
self.numRows, self.numCols = X.shape
self.data = X
self.set_title('Array display')
self.set_border_width(8)
vbox = gtk.VBox(False, 8)
self.add(vbox)
sw = gtk.ScrolledWindow()
sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
sw.set_policy(gtk.POLICY_NEVER,
gtk.POLICY_AUTOMATIC)
vbox.pack_start(sw, True, True)
model = self.create_model()
self.treeview = gtk.TreeView(model)
self.treeview.set_rules_hint(True)
sw.add(self.treeview)
self.add_columns()
self.set_default_size(640, 480)
self.add_events(gdk.BUTTON_PRESS_MASK |
gdk.KEY_PRESS_MASK|
gdk.KEY_RELEASE_MASK)
def add_columns(self):
model = self.treeview.get_model()
renderer = gtk.CellRendererText()
for i in range(self.numCols):
column = gtk.TreeViewColumn('%d'%i, gtk.CellRendererText(), text=i)
self.treeview.append_column(column)
def create_model(self):
types = [gobject.TYPE_DOUBLE]*self.numCols
store = gtk.ListStore(*types)
for row in self.data:
iter = store.append()
pairs = []
for i, num in enumerate(row): pairs.extend((i, num))
store.set(iter, *pairs)
return store
if __name__=='__main__':
from matplotlib.numerix import rand
view_array(rand(10,10))
gtk.main()
|
|
From: Thomas B. <tho...@ya...> - 2004-08-18 15:43:52
|
John,
Many thanks for your reply. I had seen the interactive.html page before but
I didn't realize I had to drop the "show()" statement in order to accomplish
interactivity. Iow, I had set my matplotlibc file to have interactive be
true, but when I wrote scripts, I kept on using the "show()" command. Oops.
Tks for clearing that up.
Btw, what does "TkAgg sets interactive mode to True when you issue the show
command" mean exactly? Should it say False instead? Anyway, I kept using
"show()" in my scripts, which "hid" interactivity from me. I got that now.
My explanation of what I meant by displaying data in grid-like tables was
not good. Pls let me try again. Your example is v informative and useful,
but it doesn't get at what I had in mind. I did not mean displaying
multiple charts in one window in a grid-like orientation. By displaying the
data set in a grid-like table, I want to see the underlying numerical data
(ie, the actualy numbers) displayed in a grid window.
Perhaps I can better explain what I mean by continuing with your example.
When I run it, upon entering the line that reads "hist(randn(10000), 100)
# lower right", my python prompt prints out the following:
>>> hist(randn(10000), 100) # lower right
(array([ 3, 0, 3, 5, 4, 10, 3, 5, 11, 2, 17, 9, 7,
17, 24, 31, 29, 38, 42, 36, 53, 57, 70, 79, 78, 84,
105, 103, 132, 158, 141, 164, 177, 172, 181, 217, 223, 243, 254,
258, 286, 276, 279, 279, 300, 312, 333, 280, 305, 270, 278, 278,
273, 257, 239, 223, 204, 216, 216, 174, 169, 142, 136, 120, 118,
102, 89, 79, 69, 60, 48, 55, 42, 37, 27, 31, 30, 25,
14, 12, 19, 12, 10, 5, 2, 5, 2, 2, 2, 1, 1,
3, 2, 2, 1, 2, 0, 0, 0, 1]), array([-3.35781891
57051, -3.21132211, -3.13807372, -3.06482532,
-2.99157693, -2.91832853, -2.84508014, -2.77183174, -2.69858334,
-2.62533495, -2.55208655, -2.47883816, -2.40558976, -2.33234137,
-2.25909297, -2.18584457, -2.11259618, -2.03934778, -1.96609939,
-1.89285099, -1.8196026 , -1.7463542 , -1.6731058 , -1.59985741,
-1.52660901, -1.45336062, -1.38011222, -1.30686383, -1.23361543,
-1.16036703, -1.08711864, -1.01387024, -0.94062185, -0.86737345,
-0.79412506, -0.72087666, -0.64762826, -0.57437987, -0.50113147,
-0.42788308, -0.35463468, -0.28138629, -0.20813789, -0.13488949,
-0.0616411 , 0.0116073 , 0.08485569, 0.15810409, 0.23135248,
0.30460088, 0.37784928, 0.45109767, 0.52434607, 0.59759446,
0.67084286, 0.74409125, 0.81733965, 0.89058805, 0.96383644,
1.03708484, 1.11033323, 1.18358163, 1.25683002, 1.33007842,
1.40332682, 1.47657521, 1.54982361, 1.623072 , 1.6963204 ,
1.76956879, 1.84281719, 1.91606558, 1.98931398, 2.06256238,
2.13581077, 2.20905917, 2.28230756, 2.35555596, 2.42880435,
2.50205275, 2.57530115, 2.64854954, 2.72179794, 2.79504633,
2.86829473, 2.94154312, 3.01479152, 3.08803992, 3.16128831,
3.23453671, 3.3077851 , 3.3810335 , 3.45428189, 3.52753029,
3.60077869, 3.67402708, 3.74727548, 3.82052387, 3.89377227])...
To me, that isnt a fun way to look at (or attempt to edit) the numbers in my
data set. I think it would be much more useful to display the numbers such
as those above in a separate window. What if I have 5,000 data
observations? A scrollable data grid window would make a much nicer
display. The picture at http://freshmeat.net/screenshots/36907/39220/ gives
the basic idea of what I mean by a data grid (though what I need is much
more basic than that picture).
Wx has such a grid widget which can be used for displaying/editing data,
which is what I was hoping to use. However, I am not sure if one should mix
different gui's. Iow, if I use tkagg or gtk as my interactive matplotlib
gui, can I also display and interact with wxpython grid widgets in the same
script smoothly? Am I asking for trouble having the same script display
interactive matplotlib charts using one gui type and then display these grid
widgets using another gui type? Or should I just stick with one gui type
throughout the entire script so that the interactive matplotlib charts use
say gtk and the same script also uses gtk for its grid widgets?
I hope that makes more sense.
Thanks again,
Tom
-----Original Message-----
From: John Hunter [mailto:jdh...@ac...]
Sent: Tuesday, August 17, 2004 12:59 PM
To: Thomas Barket
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Requesting advice on multi-threaded
matplotlib session + grids displaying data
>>>>> "Thomas" == Thomas Barket <tho...@ya...> writes:
Thomas> Hello, I am fairly new to matplotlib in particular and
Thomas> using gui's in general and don't have much experience yet
Thomas> with threading. From a python command prompt, I want to
Thomas> be able to use python to create and work with data sets,
Thomas> while simultaneously be able to chart the data with
Thomas> matplotlib. Since I would like to display more than one
Thomas> matplotlib chart at a time, I presume this involves
Thomas> working with threads. Furthermore, I would like to also
Thomas> display the data sets in a grid-like table, and since I
Thomas> want to see more than one such grid-like table at a time
Thomas> (and of course see grid-like tables and matplotlib charts
Thomas> at the same time too), I think this will also involve
Thomas> threading.
Have you had a chance to read
http://matplotlib.sourceforge.net/interactive.html? This gives a little
background on using matplotlib interactively.
As stated on that page, the best approach with the current matplotlib
(0.61) is to set
backend : TkAgg
interactive : True
in your matplotlibrc file
(http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC). If you do this,
you will not need to call show.
Fernando Perez, author of ipython, is working on a much improved interactive
shell for matplotlib + GTK. He plans eventually to support all the
backends, but right now is focusing on GTK (tkagg already works with
ipython). You will need CVS ipython and CVS matplotlib to try this out, but
it is very nice. See his earlier post
http://sourceforge.net/mailarchive/forum.php?thread_id=5323260&forum_id=3340
5
As for the grids, if I understand you correctly, the best way to do this is
create multiple axes with the subplot command, eg,
from matplotlib.matlab import *
subplot(221) # upper left
plot(range(10), 'go')
subplot(222)
pcolor(rand(10,10)) # upper right
subplot(223)
scatter(rand(12), rand(12)) # lower left
subplot(224)
hist(randn(10000), 100) # lower right
show()
Is this what you are looking for? [You can embed multiple matplotlib figure
canvases into a wx grid or a gtk.Table if you want to use the GUI API, but
I'm assuming you're looking for something simpler, as above].
JDH
|
|
From: John H. <jdh...@ac...> - 2004-08-18 14:11:38
|
>>>>> "John" == John Hunter <jdh...@ac...> writes:
John> THE HACK for Windows users with the problematic install and
John> behavior: change HOME to USERPROFILE in font_manager.py.
Hi Alan,
Thanks for the bug report and the pointer to the solution I added the
following code to matplotlib.__init__.py above the get_data_path
function
def get_home():
"""
return the users HOME dir across platforms or None.
On win32, if either HOME is not set or HOME is set but doesn't
exist, the value of USERPROFILE will be used instead.
"""
if os.environ.has_key('HOME'):
path = os.environ['HOME']
if os.path.exists(path): return path
if sys.platform=='win32' and os.environ.has_key('USERPROFILE'):
path = os.environ['USERPROFILE']
if os.path.exists(path): return path
return None
And then use this everywhere in the code that wants HOME.
Fortunately, that is only two places, once in matplotlib_fname and
once in the font_manager.
In font_manager, if you import it
from matplotlib import rcParams, get_data_path, get_home
and use it
ttfpath = get_home()
if ttfpath is None: ttfpath = get_data_path()
ttfcache = os.path.join(ttfpath, '.ttffont.cache')
it should fix the bug.
Would you mind testing it for me? I tried it on a linux and winxp
platform and it worked. But I never had problems before on those two
platforms so it would be helpful to try yours as well.
Thanks!
JDH
|
|
From: John H. <jdh...@ac...> - 2004-08-18 13:02:52
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> Sorry if this is a silly question; i couldn't find the
Dominique> answer in the source files or the mailing list archive.
Dominique> I am using matplotlib 0-60.2. Is there an equivalent in
Dominique> matplotlib to the matlab command 'axis square', to set
Dominique> the aspect ratio to 1? More generally, can i set the
Dominique> aspect ratio to any ratio i like? I am interested in
Dominique> this for plot() and scatter().
There is no axis square at the moment (easy to add though). But yes,
you can set the axes to any aspect ratio you want. Rather than
calling 'subplot', call 'axes'.
# left, bottom, width, height
axes([0.15, 0.15, 0.7, 0.7])
The numbers are fractions of the figure size. So left is 0.15*figure
width, bottom is 0.15 * figure height, width is 0.7 * figure width and
height is 0.7 * figure height. See
http://matplotlib.sourceforge.net/matplotlib.matlab.html#-axes for
more info.
You can control the figure dimensions using the figsize argument (args
in inches, my apologies)
# figure is 6 inches square
figure(1, figsize=(6, 6))
See http://matplotlib.sourceforge.net/matplotlib.matlab.html#-figure.
Here is and example script
from matplotlib.matlab import *
side = 7 # side of square in inches
figure(1, figsize=(side, side))
# left, bottom, width, height
axes([0.15, 0.15, 0.7, 0.7])
N = 500 # number of scatter points
scatter(rand(N), rand(N)) # should be square
savefig('test.ps')
show()
That said, there is a very important caveat. This probably won't
appear square on your monitor because the dots per inch on your
monitor likely differ in the horizontal and vertical directions (it
should be square if you save as *.ps and print it on a postscript
printer). When I implemented freetype fonts for matplotlib, I asked
on this list if anyone was interested in matplotlib supporting dpi in
the x and y direction so that you could actually create figures in
true sizes on the monitor, but there was no interest at the time. The
freetype lib supports horizontal and vertical dpi, which is why it
came up at the time.
JDH
|
|
From: Gregory L. <gre...@ff...> - 2004-08-18 12:57:40
|
Oups, sorry, sent an older version of my modified files... Here they are... Also, this works of course for both x and y scales, who can have different bases and subs... Best regards, Greg. |
|
From: John H. <jdh...@ac...> - 2004-08-18 12:46:58
|
>>>>> "danny" == danny shevitz <dan...@ya...> writes:
danny> howdy, I'm doing an errorbar plot. The cap colors are
danny> always black, even when ecolor is explicitly set. The
danny> documentation states that the second argument returned by
danny> errorbar is a list of "error bar lines". I looked at the
danny> return value and it appears to be a list of 3-tuples of
danny> Line2D instances. I presume each 3-tuple is the errorbar,
danny> and the two endcaps. If I explicitly set the color of the
danny> whole erno collection, only the errorbar color is changed
danny> not the cap color. I can't find any "errorbar Line2D" class
danny> or documentation to that effect.
As Gary noted, recently we changed the way error bars were drawn which
apparently had some unintended consequences. The root of the problem
is related to one that came up earlier on the list about differences
in the way regular lines and marker lines are handled.
A little background. The Line2D class makes a distinction between
markers and lines: the color of markers, eg circles and squares, are
determined by the 'markeredgecolor' and 'markerfacecolor' properties;
the color of regular lines is determined by the 'color' property.
There is another special thing about markers: their sizes are in
points, and so do not depend on the axes scale or transformation. If
you zoom in on a marker, it still looks the same.
For errorbars, the last property is a nice, because we want the error
bar caps to be a fixed capsize in points rather than depend on the
scale. So we changed errorbar to use the new line *marker* symbols
'_' and '|'. While they plot like a solid line, matplotlib considers
them to be markers. So
>> plot(x,y,'_')
are horizontal lines centered at x, with height y, and length
*in points* determined by the markersize. Ditto for '|, which are
vertical lines. Perfect for tick marks or errorbar caps.
However, as markers, their color is determined by the markerfacecolor
and markeredgecolor, which is a bit whacked, I realize. Perhaps they
should be factored into a separate category, or perhaps I should just
change the Line2D class to forward calls from set_color to
set_facecolor and set_edgecolor for these special markers.
I rewrote (and simplified) the errorbar code to fix this problem. It
should be faster too, because I plot the x and y caps in single calls
to plot rather than creating a bunch of individual lines, which was
how the '_' and '|' markers were meant to be used. Code below.
danny> So what am I missing and how do I change errobar cap colors
danny> without doing an explicit loop over the 3-tuples and
danny> setting their colors explicitly?
For future reference, 'set' will loop for you
>>> lines, errbars = errorbar(t, s, [e,g], f, fmt='o')
>>> set(errbars, markerfacecolor='g', markeredgecolor='g')
but with the patched code, that won't be necessary.
Replace matplotlib.axes.Axes.errorbar with the code below. Errorbar
users, I would be much obliged if you test this. I tried all of
Gary's errorbar_demo examples and they appeared to work fine....
def errorbar(self, x, y, yerr=None, xerr=None,
fmt='b-', ecolor='k', capsize=3):
"""
Plot x versus y with error deltas in yerr and xerr.
Vertical errorbars are plotted if yerr is not None
Horizontal errorbars are plotted if xerr is not None
xerr and yerr may be any of:
a rank-0, Nx1 Numpy array - symmetric errorbars +/- value
an N-element list or tuple - symmetric errorbars +/- value
a rank-1, Nx2 Numpy array - asymmetric errorbars -column1/+column2
Alternatively, x, y, xerr, and yerr can all be scalars, which
plots a single error bar at x, y.
fmt is the plot format symbol for y. if fmt is None, just
plot the errorbars with no line symbols. This can be useful
for creating a bar plot with errorbars
Return value is a length 2 tuple. The first element is a list of
y symbol lines. The second element is a list of error bar lines.
capsize is the size of the error bar caps in points
"""
if not self._hold: self.cla()
# make sure all the args are iterable arrays
if not iterable(x): x = asarray([x])
else: x = asarray(x)
if not iterable(y): y = asarray([y])
else: y = asarray(y)
if xerr is not None:
if not iterable(xerr): xerr = asarray([xerr])
else: xerr = asarray(xerr)
if yerr is not None:
if not iterable(yerr): yerr = asarray([yerr])
else: yerr = asarray(yerr)
if fmt is not None:
l0 = self.plot(x,y,fmt)
else: l0 = None
caplines = []
barlines = []
capargs = {'c':ecolor, 'mfc':ecolor, 'mec':ecolor, 'ms':2*capsize}
if xerr is not None:
if len(xerr.shape) == 1:
left = x-xerr
right = x+xerr
else:
left = x-xerr[0]
right = x+xerr[1]
barlines.extend( self.hlines(y, x, left) )
barlines.extend( self.hlines(y, x, right) )
caplines.extend(self.plot(left, y, '|', **capargs))
caplines.extend(self.plot(right, y, '|', **capargs))
if yerr is not None:
if len(yerr.shape) == 1:
lower = y-yerr
upper = y+yerr
else:
lower = y-yerr[0]
upper = y+yerr[1]
barlines.extend( self.vlines(x, y, upper ) )
barlines.extend( self.vlines(x, y, lower ) )
caplines.extend(self.plot(x, lower, '_', **capargs))
caplines.extend(self.plot(x, upper, '_', **capargs))
for l in barlines:
l.set_color(ecolor)
self.autoscale_view()
return (l0, caplines+barlines)
|
|
From: Alan G I. <ai...@am...> - 2004-08-18 04:46:32
|
ON 2004-08-17 16:05 Dominique Orban <Dominique@po...> wrote: > I am using matplotlib 0-60.2. Is there an equivalent in matplotlib to > the matlab command "axis square", to set the aspect ratio to 1? More > generally, can i set the aspect ratio to any ratio i like? I am > interested in this for plot() and scatter(). Please post any info you get. I need the same thing. Thank you, Alan Isaac |
|
From: <ga...@em...> - 2004-08-18 02:12:59
|
Hi Danny, I think I know what's going on here - The rendering of bar-ends was chang= ed at one point to use tick line markers instead of being rendered as par= t of the line. I had seen the behaviour you describe at one point, but fo= r some reason (brain failure!) had convinced myself later that the behavi= our had remedied itslef somehow. I didn't understand this at the time, bu= t I should have put the effort in because it's crept through and you've t= ripped over it. The solution is to revert the bar-end rendering to the wa= y it used to be done. I don't know if you can fix this without touching t= he Matplotlib source since I suspect the line markers reference isn't bei= ng returned. I can't look at this for a day or more, so either be patient= and I'll post the fix to this list, or maybe John Hunter will get to it = first, regards, Gary Ruben ----- Original Message ----- From: danny shevitz <dan...@ya...> Date: Tue, 17 Aug 2004 09:38:40 -0700 (PDT) To: matplotlib <mat...@li...> Subject: [Matplotlib-users] errorbar cap color > howdy,=20 > I'm doing an errorbar plot. The cap colors are always black, even when > ecolor is explicitly set. The documentation states that the second > argument returned by errorbar is a list of "error bar lines". I looked > at the return value and it appears to be a list of 3-tuples of Line2D > instances. I presume each 3-tuple is the errorbar, and the two endcaps. > If I explicitly set the color of the whole erno collection, only the > errorbar color is changed not the cap color. I can't find any "errorbar > Line2D" class or documentation to that effect.=20 >=20 > So what am I missing and how do I change errobar cap colors without > doing an explicit loop over the 3-tuples and setting their colors > explicitly? >=20 > TIA, > Danny --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
|
From: John H. <jdh...@ac...> - 2004-08-17 23:27:20
|
>>>>> "danny" == danny shevitz <dan...@ya...> writes:
danny> Howdy, Another stupid problem. Before .61 when I plotted
danny> with symbols, the symbols were unfilled, now they are
danny> filled. How do I control this? I can't find any
danny> markerfilled property in the Line2D class.
You can override the markerfacecolor as a kwarg
>>> plot(arange(10), 'ro', markerfacecolor=None)
You can also use the abbreviation 'mfc'
>>> plot(arange(10), 'ro', mfc=None)
Should help!
JDH
|
|
From: Dominique O. <Dom...@po...> - 2004-08-17 23:05:52
|
Sorry if this is a silly question; i couldn't find the answer in the source files or the mailing list archive. I am using matplotlib 0-60.2. Is there an equivalent in matplotlib to the matlab command 'axis square', to set the aspect ratio to 1? More generally, can i set the aspect ratio to any ratio i like? I am interested in this for plot() and scatter(). Thanks ! Dominique |
|
From: John H. <jdh...@ac...> - 2004-08-17 17:59:52
|
>>>>> "Thomas" == Thomas Barket <tho...@ya...> writes:
Thomas> Hello, I am fairly new to matplotlib in particular and
Thomas> using gui's in general and don't have much experience yet
Thomas> with threading. From a python command prompt, I want to
Thomas> be able to use python to create and work with data sets,
Thomas> while simultaneously be able to chart the data with
Thomas> matplotlib. Since I would like to display more than one
Thomas> matplotlib chart at a time, I presume this involves
Thomas> working with threads. Furthermore, I would like to also
Thomas> display the data sets in a grid-like table, and since I
Thomas> want to see more than one such grid-like table at a time
Thomas> (and of course see grid-like tables and matplotlib charts
Thomas> at the same time too), I think this will also involve
Thomas> threading.
Have you had a chance to read
http://matplotlib.sourceforge.net/interactive.html? This gives a
little background on using matplotlib interactively.
As stated on that page, the best approach with the current matplotlib
(0.61) is to set
backend : TkAgg
interactive : True
in your matplotlibrc file
(http://matplotlib.sourceforge.net/faq.html#MATPLOTLIBRC). If you do
this, you will not need to call show.
Fernando Perez, author of ipython, is working on a much improved
interactive shell for matplotlib + GTK. He plans eventually to
support all the backends, but right now is focusing on GTK (tkagg
already works with ipython). You will need CVS ipython and CVS
matplotlib to try this out, but it is very nice. See his earlier post
http://sourceforge.net/mailarchive/forum.php?thread_id=5323260&forum_id=33405
As for the grids, if I understand you correctly, the best way to do
this is create multiple axes with the subplot command, eg,
from matplotlib.matlab import *
subplot(221) # upper left
plot(range(10), 'go')
subplot(222)
pcolor(rand(10,10)) # upper right
subplot(223)
scatter(rand(12), rand(12)) # lower left
subplot(224)
hist(randn(10000), 100) # lower right
show()
Is this what you are looking for? [You can embed multiple matplotlib
figure canvases into a wx grid or a gtk.Table if you want to use the
GUI API, but I'm assuming you're looking for something simpler, as
above].
JDH
|
|
From: Dominique O. <Dom...@po...> - 2004-08-17 17:40:12
|
Hi, What would be the easiest way, in matplotlib, to achieve log scaling, along the x axis, say, in a base other than 10? I see in axes.py that semilog[xy] have LOG10 hardwired. I am using matplotlib 0.60.2. Thanks, Dominique |
|
From: danny s. <dan...@ya...> - 2004-08-17 17:10:41
|
howdy, I'm doing an errorbar plot. The cap colors are always black, even when ecolor is explicitly set. The documentation states that the second argument returned by errorbar is a list of "error bar lines". I looked at the return value and it appears to be a list of 3-tuples of Line2D instances. I presume each 3-tuple is the errorbar, and the two endcaps. If I explicitly set the color of the whole erno collection, only the errorbar color is changed not the cap color. I can't find any "errorbar Line2D" class or documentation to that effect. So what am I missing and how do I change errobar cap colors without doing an explicit loop over the 3-tuples and setting their colors explicitly? TIA, Danny __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail |
|
From: danny s. <dan...@ya...> - 2004-08-17 16:54:34
|
Howdy, Another stupid problem. Before .61 when I plotted with symbols, the symbols were unfilled, now they are filled. How do I control this? I can't find any markerfilled property in the Line2D class. TIA, Danny __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail |
|
From: Thomas B. <tho...@ya...> - 2004-08-17 09:11:56
|
Hello, I am fairly new to matplotlib in particular and using gui's in general and don't have much experience yet with threading. From a python command prompt, I want to be able to use python to create and work with data sets, while simultaneously be able to chart the data with matplotlib. Since I would like to display more than one matplotlib chart at a time, I presume this involves working with threads. Furthermore, I would like to also display the data sets in a grid-like table, and since I want to see more than one such grid-like table at a time (and of course see grid-like tables and matplotlib charts at the same time too), I think this will also involve threading. I am currently pretty comfortable using matplotlib, though I don't yet know how to plot a chart and get the python cursor back to do more work and interact with the chart dynamically. I know wxpython has a grid-like table for displaying data called wx.grid. I was hoping to be able to use matplotlib in a threaded manner and also use these wx.grid widgets to display data in a threaded manner from the same python session. How complicated is it to accomplish this kind of functionality? Since the interactive2.py threading example uses pygtk, is pygtk the best way to create multiple, threaded plots from a python prompt and interact with them while also doing data manipulation at the python prompt? If pygtk is the best/easiest way to create threaded matplotlib plots, is it possible/desirable to utilize threaded wx.grids in the same session, or should I stick with whatever grid-like table is provided by pygtk in order for the grids to play nice with the charts (ie, keep all threaded gui objects to be pygtk widgets)? Is it not possible to use python's thread or queue module to do most of the work here, instead of utilizing pygtk threads or wxpython threads? Why cant I just create any new gui object (whether a matplotlib chart or some kind of grid-like table of data) in a new python thread? Thanks vm for your help. Tom |
|
From: Jean-Michel P. <jea...@ir...> - 2004-08-17 09:01:28
|
Hi,
I'm new to matplotlib which is really good job ;-) and I'm currently
fighting against character encodings :-(.
Being working under win2k/western Europe, I finally found on the web
that using a cp850 source encoding definition was working with 'print'
only if you also encode your strings from cp1252! (for us/en users:
windows uses cp1252 but the console uses cp850, this message was written
using iso-8859-1).
Example:
# -*- coding: cp850 -*-
print unicode('texte français','cp1252')
>>> texte français
If I do the same with the matplotlib 0.54 'title' function I get an
error telling the 'ascii' codec cannot encode my 'ç':
# -*- coding: cp850 -*-
from matplotlib.matlab import *
plot([1,2,3,4])
title(unicode('texte français','cp1252'))
>>> Exception in tkinter callback
Traceback ...
[...]
font.set_text(s, 0.0) # ...
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in
position 10: ordinal not in range(128)
-----------------
With matplotlib 0.61 I get this error:
>>> title(unicode('texte français','cp1252'))
Traceback (most recent call last):
File "<<console>>", line 1, in ?
File "C:\PYTHON23\Lib\site-packages\matplotlib\matlab.py", line 1576,
in title
draw_if_interactive()
File
"C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_gtk.py", line
582, in draw_if_interactive
figManager.canvas.draw()
File
"C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_gtkagg.py",
line 40, in draw
FigureCanvasAgg.draw(self)
File
"C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_agg.py", line
306, in draw
self.figure.draw(self.renderer)
File "C:\PYTHON23\Lib\site-packages\matplotlib\figure.py", line 236,
in draw
for a in self.axes: a.draw(renderer)
File "C:\PYTHON23\Lib\site-packages\matplotlib\axes.py", line 704, in
draw
self._title.draw(renderer)
File "C:\PYTHON23\Lib\site-packages\matplotlib\text.py", line 209, in
draw
bbox, info = self._get_layout(renderer)
File "C:\PYTHON23\Lib\site-packages\matplotlib\text.py", line 108, in
_get_layout
w,h = renderer.get_text_width_height(
File
"C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_agg.py", line
210, in get_text_width_height
font.set_text(s, 0.0) # the width and height of unrotated string
TypeError: CXX: type error.
---------------
I tried to add different encodings (ie. unicode('texte français',
'cp1252').encode(...) with utf-8, cp1252, cp850...) without success.
Naturally if I omit any unicode translation, it does not crash but the
string is not correctly rendered. Does it mean that matplotlib currently
expects 'ascii' strings only to passed to its text functions?
JM. Philippe
|
|
From: John H. <jdh...@ac...> - 2004-08-16 21:24:35
|
>>>>> "Shin" == Shin <sd...@em...> writes:
Shin> Following the docstring of matplotlib.dates, I tried the
Shin> following commands, but failed. It says there is no argument
Shin> needed when constructing PyDatetimeConverter object. If it
Shin> is true, how about correcting it right away because the
Shin> document is only one explaining its usage?
Done, thanks.
Early versions of the datetime converter supported time zones, but
there were problems in the implementation and I removed the feature.
The doc string was out of date.
JDH
|
|
From: Shin <sd...@em...> - 2004-08-16 21:09:40
|
Following the docstring of matplotlib.dates, I tried the following commands, but failed. It says there is no argument needed when constructing PyDatetimeConverter object. If it is true, how about correcting it right away because the document is only one explaining its usage? Python 2.3.3 (#2, Feb 17 2004, 11:45:40) Type "copyright", "credits" or "license" for more information. IPython 0.6.1.rc1 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. @magic -> Information about IPython's 'magic' @ functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from matplotlib.dates import PyDatetimeConverter In [3]: from matplotlib.dates import Eastern In [4]: converter=PyDatetimeConverter(Eastern) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /home/sdhyok/catchlab/catchlab/catchlab/pkg/rhessys/test/<console> TypeError: this constructor takes no arguments -- Daehyok Shin (Peter) Geography Department Univ. of North Carolina-Chapel Hill |
|
From: John H. <jdh...@ac...> - 2004-08-15 17:27:56
|
>>>>> "Vineet" == Vineet Jain <vi...@al...> writes:
Vineet> Ok. I found the excursor_demo.py. However, it seems like
Vineet> this demo has a problem. When you expand tthe window. In
Vineet> addition to the cross hair there is a permanent cross and
Vineet> veritcal line where the cross hair was when the window was
Vineet> expanded.
Vineet> Any suggestion?
Hi Vineet,
Both examples are fixed in CVS. I'll send you the wx cursor demo in a
separate email.
Thanks for letting me know,
JDH
|
|
From: Vineet J. <vi...@al...> - 2004-08-15 03:24:00
|
Ok. I found the excursor_demo.py.
However, it seems like this demo has a problem. When you expand tthe window.
In addition to the cross hair there is a permanent cross and veritcal line
where the cross hair was when the window was expanded.
Any suggestion?
Vineet
-----Original Message-----
From: mat...@li...
[mailto:mat...@li...]On Behalf Of Vineet
Jain
Sent: Saturday, August 14, 2004 9:17 PM
To: mat...@li...
Subject: [Matplotlib-users] Problems with running cursor_demo on Wx
When running the cursor_demo with the wxAgg I get the following error:
C:\programming\matplotlib-0.61.0\examples>cursor_demo.py
Traceback (most recent call last):
File "C:\programming\matplotlib-0.61.0\examples\cursor_demo.py", line 87,
in ?
canvas.connect('motion_notify_event', cursor.mouse_move)
AttributeError: 'FigureCanvasWxAgg' object has no attribute 'connect'
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Vineet J. <vi...@al...> - 2004-08-15 02:17:02
|
When running the cursor_demo with the wxAgg I get the following error:
C:\programming\matplotlib-0.61.0\examples>cursor_demo.py
Traceback (most recent call last):
File "C:\programming\matplotlib-0.61.0\examples\cursor_demo.py", line 87,
in ?
canvas.connect('motion_notify_event', cursor.mouse_move)
AttributeError: 'FigureCanvasWxAgg' object has no attribute 'connect'
|
|
From: Todd M. <jm...@st...> - 2004-08-13 21:59:09
|
I was informed that the windows binaries for numarray for matplotlib-0.61.0 were accidentally built without support for GTK. I uploaded new binaries this afternoon and they should make it to the SF mirrors soon (tomorrow?). Please consider downloading them if you're interested in the GTK backend and numarray. Regards, Todd Miller |
|
From: John H. <jdh...@ac...> - 2004-08-13 21:02:42
|
>>>>> "James" == James Boyle <bo...@ll...> writes:
James> The checkerboard goes to the edges but the color overlay
James> has a gap on the right and bottom. I have not been able to
James> figure this out.
Nor have I completely, yet. It's related to interpolation (worse for
bilinear and bicubic that nearest). matlab handles this (at least for
pcolor) by setting the axes lim to not include the last row. Eg, for
a 5x5 pcolor grid, the axes would be 4x4.
This is part of the problem, but there may be an off-by-one or
rounding error as well.
It's a priority to fix, only it ain't fixed yet!
JDH
|
|
From: James B. <bo...@ll...> - 2004-08-13 20:57:43
|
in the example directory the layer_images.py produces a plot that has space between the color plot and the axes on the right side and the bottom. This occurs if I use the PS or Agg backend. It is evident in the example plot in the 'Screenshots' examples: http://matplotlib.sourceforge.net/screenshots/layer_images_large.png The checkerboard goes to the edges but the color overlay has a gap on the right and bottom. I have not been able to figure this out. Thanks for any enlightenment. Jim |