Note that there are some explanatory texts on larger screens.

plurals
  1. POPython+Chaco+Traits - rendering bug: unexpected fills of line plot of large data?
    primarykey
    data
    text
    <p>Using the minimal example below, the line plot of a large (some 110k points) plot I get (with python 2.7, numpy 1.5.1, chaco/enable/traits 4.3.0) is this:</p> <p><a href="https://i.stack.imgur.com/N3eMr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N3eMrm.png" alt="chaco01"></a></p> <p>However, that is bizarre, because it is a line plot, and there shouldn't be any filled areas in there? Especially since the data is sawtooth-ish signal? It's as if there is a line at y~=37XX, above which there is color filling?! But sure enough, if I zoom into an area, I get the rendering I expect - without the unexpected fill:</p> <p><a href="https://i.stack.imgur.com/JwGcc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JwGccm.png" alt="chaco02"></a></p> <p>Is this a bug - or is there something I'm doing wrong? I tried to use <code>use_downsampling</code>, but it makes no difference...</p> <p>The test code:</p> <pre><code>import numpy as np import numpy.random as npr from pprint import pprint from traits.api import HasTraits, Instance from chaco.api import Plot, ArrayPlotData, VPlotContainer from traitsui.api import View, Item from enable.component_editor import ComponentEditor from chaco.tools.api import PanTool, BetterSelectingZoom tlen = 112607 alr = npr.randint(0, 4000, tlen) tx = np.arange(0.0, 30.0-0.00001, 30.0/tlen) ty = np.arange(0, tlen, 1) % 10000 + alr pprint(len(ty)) class ChacoTest(HasTraits): container = Instance(VPlotContainer) traits_view = View( Item('container', editor=ComponentEditor(), show_label=False), width=800, height=500, resizable=True, title="Chaco Test" ) def __init__(self): super(ChacoTest, self).__init__() pprint(ty) self.plotdata = ArrayPlotData(x = tx, y = ty) self.plotobj = Plot(self.plotdata) self.plotA = self.plotobj.plot(("x", "y"), type="line", color=(0,0.99,0), spacing=0, padding=0, alpha=0.7, use_downsampling=True) self.container = VPlotContainer(self.plotobj, spacing=5, padding=5, bgcolor="lightgray") #~ container.add(plot) self.plotobj.tools.append(PanTool(self.plotobj)) self.plotobj.overlays.append(BetterSelectingZoom(self.plotobj)) if __name__ == "__main__": ChacoTest().configure_traits() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload