Dear John,
Well, the behavior you are seeing is the correct, documented
behavior. I think it would be easier for you to pass errorbar what it
is expecting than for errorbar to handle this additional use case -
it's already getting pretty hairy in there.DO you have a problem doing
errorbar([1],[2],xerr=[.1])
Not really, it's just that I hate to think beforehand about whether a
routine eats everything or just arrays ;). The adjustments needed are
only minor I found out, after sending the previous mail. Here is the
diff against matplotlib-0.50e
<diff>
7c7
< log10, Float
ยทยทยท
---
log10, Float, NewAxis
527a528,531
if (len(x.shape) == 0): x=x[NewAxis,] if (len(y.shape) == 0): y=y[NewAxis,]
533,534c537,544
< if xerr is not None: xerr = asarray(xerr)
< if yerr is not None: yerr = asarray(yerr)
---
if xerr is not None: xerr = asarray(xerr) if (len(xerr.shape) == 0): xerr=xerr[NewAxis,] if yerr is not None: yerr = asarray(yerr) if
(len(yerr.shape) == 0): yerr=yerr[NewAxis,]
</diff>
You're not the first! The temporary workaround is to use plot(x,y,'o') which uses fixes sizes in points for the symbols (you
can also use '*', '+', etc) However, you cannot vary the size or
color of the symbols so this may not be workable.
I'm perfectly happy with the plot command to do normal scatter plots. I
even think that it would be more logical (but perhaps not
matlab-compatible) to move all machinery of scatter to plot.
You asked for information of how people (would like to) use scatter
plots. Well, my wishlist for scatter would be more or less like (sorry
it's a long wishlist, but see them as suggestions, not commands!):
* Scatter plots of symbols where the size of the symbols can be set per
x-y pair. The use of this is that it depends on the number of points
whether you want tiny dots, or large circles (the latter being nice
when you have 10 points, but not when you have a million. For me,
the size does not need to be specified in points, or another seemingly
exact measure. I can live with a 'default size' (say 1/100 of the
smallest of the axes) and a multiplier that can set by the user (like
in Gnuplot).
* The symbols should be the same kind of symbols as used in plot (i.e.
squares, triangles, circles etc.). The blob-symbols as plotted now
should be a special case rather than the default. For myself, I only
see a useful usage for *circular* (irrespective of axes) blobs where
the radius is set by the s-keyword. But perhaps others like to have
ellipsoid blobs that have a *two* axes that make physical sense.
* It would be nice if all symbols -as far as applicable- come in 'open'
and 'filled' versions (nice if you want to plot in one scatter plot
data referring to the same physical quantity, but separating between
daytime and nighttime for instance).
For me, the number of symbols needed in one plot is rather limited: I
hardly use more than 4 simultaneously in one scatter plot. On the
other hand, in general x-y plots (lines, line-points, or points in
Gnuplot terms) I would like to have at least say 10 symbols, since I
usually use symbols to clarify the difference between lines, because
that's easier than to ask the reader to differentiate between dash,
dash-dot, dash-dash-dot etc.
* With respect to the coloring (c-keyword) it is perhaps easiest if this
is applied to the symbols directly: just as one can say 'b>' in plot,
it would be something like:
scatter(x, y, '>', c=color_array)
* Assume that the new symbol for the 'blobs' would be say '@', then
scatter(x, y, '@', s=size_array, c=color_array)
gives colored blobs with unequal axes (as now),
scatter(x, y, 'b@', s=size_array)
gives blue blobs with unequal axes
scatter(x, y, 'b@', s=size_array*-1)
gives blue blobs with equal axes
etc.
I hope this helps. And perhaps I can help in some other ways.
With kind regards,
Arnold Moene
When I refactor the scatter / pcolor etc commands as discussed in my
response to Dominique Orban above, I'll make sure that this case is
handled as well. I plan to support efficient handling of scatter
with arbitrary (or at least several) shapes where the size can be in
data (x,y) or user-defined coords, eg, physical sizes. It would be
helpful for me if people gave some information about how they would
like scatter to behave, particularly in regard to the sizes since I
am still working this out.Would you like physical sizes, eg circles with radius in points, or
what?Should the shape depend on the aspect ratio of the plotting window.
Eg, if it's a circle and you have a short, wide window, should it
appear ellipsoidal?What basic scatter symbols should be supported?
What are the most common uses: fixed size? fixed color? vary both?
JDH
--
------------------------------------------------------------------------
Arnold F. Moene NEW tel: +31 (0)317 482604
Meteorology and Air Quality Group fax: +31 (0)317 482811
Wageningen University e-mail: Arnold.Moene@...100...
Duivendaal 2 url: http://www.met.wau.nl 6701
AP Wageningen
The Netherlands
------------------------------------------------------------------------
Openoffice.org - Freedom at work
------------------------------------------------------------------------
--
------------------------------------------------------------------------
Arnold F. Moene NEW tel: +31 (0)317 482604
Meteorology and Air Quality Group fax: +31 (0)317 482811
Wageningen University e-mail: Arnold.Moene@...100...
Duivendaal 2 url: http://www.met.wau.nl
6701 AP Wageningen
The Netherlands
------------------------------------------------------------------------
Openoffice.org - Freedom at work
------------------------------------------------------------------------