Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

2D imagemap for 3D scatter plot #296

Closed
ddale opened this Issue · 2 comments

3 participants

@ddale
Owner

Original report at SourceForge, opened Fri Oct 22 10:15:01 2010

I am trying to create a 3D matplotlib scatter plot as an imagemap for a web page, where the scatter points are clickable using an map.

A variant on the code below works wonderfully for normal 2D plots but I cannot get it to work with an Axes3D and (3D) scatter diagram. What am I doing wrong (I assume I need to use proj3d.transform differently)?

Many Thanks
Ted


Code following

        axes = Axes3D(self.figure,azim=azim,elev=elev)

        ys = np.random.rand(100)
        xs = np.random.rand(100)
        zs = np.random.rand(100)
        s=self.axes.scatter(xs, ys, zs)

        dpi = self.figure.get_dpi()
        height = self.figure.get_figheight() * dpi

        x1,y1,z1= proj3d.transform(xs, ys, zs,axes.get_proj())
        self.s.set_transform(axes.transData)
        xys = zip(x1,y1)

        transformed_xys = self.s.get_transform().transform(xys)
        ### transformed_xys to contain the x,y coords of the points
        # (need to do height - y for the image-map)
        ... output as imagemap
@WeatherGod WeatherGod was assigned
@efiring
Owner

@weathergod, can this be closed?

@WeatherGod
Collaborator
@efiring efiring closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.