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

text objects with prjection are broken #344

Closed
doutriaux1 opened this issue May 21, 2018 · 0 comments
Closed

text objects with prjection are broken #344

doutriaux1 opened this issue May 21, 2018 · 0 comments
Assignees
Milestone

Comments

@doutriaux1
Copy link
Contributor

doutriaux1 commented May 21, 2018

import vcs
canvas = vcs.init()
txt = vcs.createtext()
txt.worldcoordinate = [-20,60,20,80]
txt.x = 0.
txt.y = 85.
txt.color= "black"
txt.string = "High Lat"
# now projection
txt.projection="lambert"  # any projection
canvas.plot(txt)

error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-ca41548d9291> in <module>()
      6 txt.string = "High Lat"
      7 # now projection
----> 8 canvas.plot(txt)
      9 txt.projection="lambert"  # polar projection
     10 canvas.plot(txt)

/home/doutriaux1/anaconda2/envs/cdat8/lib/python2.7/site-packages/vcs/Canvas.pyc in plot(self, *actual_args, **keyargs)
   2780 
   2781         # Plot the data
-> 2782         a = self.__plot(arglist, keyargs)
   2783 
   2784         if "continents_line" in keyargs:

/home/doutriaux1/anaconda2/envs/cdat8/lib/python2.7/site-packages/vcs/Canvas.pyc in __plot(self, arglist, keyargs)
   4013                         **keyargs)
   4014             else:
-> 4015                 returned_kargs = self.backend.plot(*arglist, **keyargs)
   4016                 if not keyargs.get("donotstoredisplay", False):
   4017                     dname = keyargs.get("display_name")

/home/doutriaux1/anaconda2/envs/cdat8/lib/python2.7/site-packages/vcs/VTKPlots.pyc in plot(self, data1, data2, template, gtype, gname, bg, *args, **kargs)
    707                     to=to,
    708                     tt=tt,
--> 709                     cmap=self.canvas.colormap, geoBounds=bounds, geo=vtk_backend_geo)
    710                 self.setLayer(ren, tt.priority)
    711                 self.text_renderers[tt_key] = ren

/home/doutriaux1/anaconda2/envs/cdat8/lib/python2.7/site-packages/vcs/vcs2vtk.pyc in genTextActor(renderer, string, x, y, to, tt, cmap, geoBounds, geo)
   1256     pts = vtk.vtkPoints()
   1257     if vcs.elements["projection"][tt.projection].type != "linear":
-> 1258         wc = geoBounds[:4]
   1259         # renderer.SetViewport(tt.viewport[0],tt.viewport[2],tt.viewport[1],tt.viewport[3])
   1260         renderer.SetWorldPoint(wc)

TypeError: 'NoneType' object has no attribute '__getitem__'
@doutriaux1 doutriaux1 added the bug label May 21, 2018
@doutriaux1 doutriaux1 added this to the 8.1 milestone May 21, 2018
doutriaux1 added a commit that referenced this issue May 25, 2018
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