Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with rectangle markers under Python 3 #235

Closed
corranwebster opened this issue Jun 6, 2016 · 1 comment
Closed

Issue with rectangle markers under Python 3 #235

corranwebster opened this issue Jun 6, 2016 · 1 comment

Comments

@corranwebster
Copy link
Member

corranwebster commented Jun 6, 2016

The following test code from Chaco works under Python 2, but fails under Python 3:

size = (50, 50)
scatterplot = create_scatter_plot(
    data=[range(10), range(10)],
    border_visible=False,
    marker_size=range(1, 11),
)
scatterplot.outer_bounds = list(size)
gc = PlotGraphicsContext(size)
gc.render_component(scatterplot)

the error generated seems to implicate the Python 3 swig bindings (from Travis CI run):

Traceback (most recent call last):
  File "/home/travis/build/enthought/chaco/build/lib.linux-x86_64-3.4/chaco/tests/scatterplot_renderers_test_case.py", line 71, in test_scatter_slow
    gc.render_component(scatterplot)
  File "/home/travis/build/enthought/chaco/build/lib.linux-x86_64-3.4/chaco/plot_graphics_context.py", line 58, in render_component
    component.draw(self, view_bounds=(0, 0, self.width(), self.height()))
  File "/home/travis/build/enthought/chaco/enable/build/lib.linux-x86_64-3.4/enable/component.py", line 424, in draw
    self._draw(gc, view_bounds, mode)
  File "/home/travis/build/enthought/chaco/enable/build/lib.linux-x86_64-3.4/enable/component.py", line 776, in _draw
    self._dispatch_draw(layer, gc, view_bounds, mode)
  File "/home/travis/build/enthought/chaco/enable/build/lib.linux-x86_64-3.4/enable/component.py", line 796, in _dispatch_draw
    handler(gc, view_bounds, mode)
  File "/home/travis/build/enthought/chaco/build/lib.linux-x86_64-3.4/chaco/base_xy_plot.py", line 466, in _draw_plot
    self._draw_component(gc, view_bounds, mode)
  File "/home/travis/build/enthought/chaco/build/lib.linux-x86_64-3.4/chaco/base_xy_plot.py", line 474, in _draw_component
    self._render(gc, pts)
  File "/home/travis/build/enthought/chaco/build/lib.linux-x86_64-3.4/chaco/scatterplot.py", line 482, in _render
    self.custom_symbol, point_mask=self._cached_point_mask)
  File "/home/travis/build/enthought/chaco/build/lib.linux-x86_64-3.4/chaco/scatterplot.py", line 141, in render_markers
    marker.add_to_path(gc, size)
  File "/home/travis/build/enthought/chaco/enable/build/lib.linux-x86_64-3.4/enable/markers.py", line 51, in add_to_path
    self._add_to_path(path, size)
  File "/home/travis/build/enthought/chaco/enable/build/lib.linux-x86_64-3.4/enable/markers.py", line 78, in _add_to_path
    path.rect(-size, -size, size * 2, size * 2)
  File "/home/travis/build/enthought/chaco/enable/build/lib.linux-x86_64-3.4/kiva/agg/agg.py", line 1026, in rect
    def rect(self, *args): return _agg.GraphicsContextArray_rect(self, *args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'GraphicsContextArray_rect'.
  Possible C/C++ prototypes are:
    kiva::graphics_context_base::rect(kiva::rect_type &)
    kiva::graphics_context_base::rect(double,double,double,double)

It should be possible to reduce this to a pure Enable issue.

@jwiggins
Copy link
Member

jwiggins commented Feb 22, 2021

Cannot reproduce.

Enthought Deployment Manager -- https://www.enthought.com
Python 3.6.12 |Enthought, Inc. (x86_64)| (default, Sep 16 2020, 16:27:31) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from chaco.api import create_scatter_plot, PlotGraphicsContext
2021-02-22 18:00:28.243 Python[71798:14869044] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
>>> size = (50, 50)
>>> scatterplot = create_scatter_plot(data=[list(range(10)), list(range(10))], border_visible=False, marker_size=list(range(1,11)))
>>> scatterplot.outer_bounds = list(size)
>>> gc = PlotGraphicsContext(size)
>>> gc.render_component(scatterplot)
>>> gc.save("blah.png")
>>> ^D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants