我试图改变从两个数组中的数据绘制的线的颜色(例如ax.plot(x,y)
).颜色应作为索引变化x
和y
增加.我基本上是试图捕捉自然的"时间"的数据在阵列参数x
和y
.
在一个完美的世界里,我想要一样的东西:
fig = pyplot.figure()
ax = fig.add_subplot(111)
x = myXdata
y = myYdata
# length of x and y is 100
ax.plot(x,y,color=[i/100,0,0]) # where i is the index into x (and y)
Run Code Online (Sandbox Code Playgroud)
生产一条颜色从黑色到深红色变为亮红色的线.
我正在尝试查看带注释的源,$ valgrind --tool=callgrind ./myProgram
然后$ kcachegrind
使用Ubuntu 12.04(我在$ qcachegrind
使用Mac OSX时遇到了同样的问题).
C++脚本myProgram.cpp
调用生活在.hpp
文件中的函数(通过#include "../include/myHeader.hpp"
等).我myProgram.cpp
像这样编译:
g++ -g -o myProgram myProgram.o -l<some third party lib>
Run Code Online (Sandbox Code Playgroud)
我不关心查看第三方库的注释源.
我想看到的是 函数in myHeader.hpp
和for的注释源myProgram.cpp
.
相反,我看到 kcachegrind的Flat Profile窗口,其中列出了所有被调用的函数,包括函数myHeader.hpp
- 这很棒.现在,kcachegrind报告函数的位置myHeader.hpp
来自myProgram
- 这很奇怪.最后,当我从Flat Profile窗口中选择任何函数并请求查看源代码时,我遇到了:
There is no source available for the following function
<name of the selected function>
This is because no debug information is present.
Recompile the source …
Run Code Online (Sandbox Code Playgroud)