由于某些原因,matplotlib scatter
无法解析日期时间值,但plot
是。import datetime
from decimal import Decimal
import matplotlib.pyplot as plt
import seaborn as sns
x = [datetime.date(2016, 10, 12),datetime.date(2017, 6, 28)]
y = [Decimal('618020.0000'), Decimal('442107.0000')]
plt.plot(x, y)
。这是matplotlib中的错误还是我做错了什么?
import datetime
from decimal import Decimal
import matplotlib.pyplot as plt
import seaborn as sns
x = [datetime.date(2016, 10, 12),datetime.date(2017, 6, 28)]
y = [Decimal('618020.0000'), Decimal('442107.0000')]
plt.scatter(x, y)
template<typename T>T GETPARAM(void) { return T(); }
template<>int GETPARAM(void) { return 123; }
template<>double GETPARAM(void) { return 1.2345; }
template<>const char *GETPARAM(void) { return "hello"; }
template<typename P1, typename P2, typename P3, typename RES> RES BuildArgs3(RES(*fn)(P1, P2, P3)) {
P1 p1 = GETPARAM<P1>();
P2 p2 = GETPARAM<P2>();
P3 p3 = GETPARAM<P3>();
return fn(p1, p2, p3);
}
int print3(int a, double b, const char *c)
{
Cout() << "Print3:" << a << ", " << b << ", " << c << "\n";
return 1;
}
main() {
BuildArgs3(print3);
}
我的matplotlib版本是1.5.3。