I have come across a little inconsistency that was unexpected in the
matplotlib API. The following is perfectly valid:
import matplotlib.pyplot as plt
plt.plot([], [])
plt.show()
However, this is not valid:
import matplotlib.pyplot as plt
plt.scatter([], [])
plt.show()
The immediate issue that comes up in scatter is that it attempts to find
min/max of the input data for the purpose of autoscaling (this can probably
be done better by just using set_xmargin(0.05) and set_ymargin(0.05)). This
can easily be bypassed with an if statement. However, then we discover that
polygon collection do not like having empty offsets, which leads to a
failure in the affine transformation.
So, the question is, is this a bug or a feature? I personally believe that
empty data is a perfectly valid scenario and given that other matplotlib
functions handle it gracefully, we should make the collections object more
friendly to empty data.
Ben Root
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel