2012年06月19日 星期二 17:07
平时常见的画法如下:
2012年06月19日 星期二 17:59
二者的区别是什么?
2012年06月20日 星期三 13:34
你使用什么软件画图
2012年06月20日 星期三 19:45
最近一直用python,第二个图可以用 plt.errorbar(x, y, yerr=e, fmt='ro')直接画出。
我想知道第一种errorbar如何画的, 意义应该也不一样?
2012年06月21日 星期四 06:08
http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo.html
2012年06月21日 星期四 16:09
# fake up some more data
spread= rand(50) * 100
center = ones(25) * 40
flier_high = rand(10) * 100 + 100
flier_low = rand(10) * -100
d2 = concatenate( (spread, center, flier_high, flier_low), 0 )
data.shape = (-1, 1)
d2.shape = (-1, 1)
#data = concatenate( (data, d2), 1 )
# Making a 2-D array only works if all the columns are the
# same length. If they are not, then use a list instead.
# This is actually more efficient because boxplot converts
# a 2-D array into a list of vectors internally anyway.
data = [data, d2, d2[::2,0]]
# multiple box plots on one figure
figure()
boxplot(data)
show()
就链接中的代码:为什么d2 = concatenate( (spread, center, flier_high, flier_low), 0 )中各个变量的长度不一样还可以 concatenate运算。
从python help了解到的信息是
concatenate((a1, a2, ...), axis=0)
Join a sequence of arrays together.
Parameters
----------
a1, a2, ... : sequence of ndarrays
The arrays must have the same shape
2012年06月21日 星期四 16:23
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form:<built-in function concatenate>
Namespace: Interactive
Docstring:
concatenate((a1, a2, ...), axis=0)
Join a sequence of arrays together.
Parameters
----------
a1, a2, ... : sequence of array_like
The arrays must have the same shape, except in the dimension
corresponding to `axis` (the first, by default).
Examples
--------
>>> a = np.array([[1, 2], [3, 4]])
>>> b = np.array([[5, 6]])
>>> np.concatenate((a, b), axis=0)
array([[1, 2],
[3, 4],
[5, 6]])
>>> np.concatenate((a, b.T), axis=1)
array([[1, 2, 5],
[3, 4, 6]])
Zeuux © 2025
京ICP备05028076号