cartesian_3D.py 829 Bytes
Newer Older
1
2
3
4
5
6
# -*- coding: utf-8 -*-

from cartesian import Cartesian


class Cartesian3D(Cartesian):
Theo Steininger's avatar
Theo Steininger committed
7
    def __init__(self, data, label='', line=None, marker=None,
8
                 showlegend=True):
Theo Steininger's avatar
Theo Steininger committed
9
        super(Cartesian3D, self).__init__(data, label, line, marker,
10
                                          showlegend)
Theo Steininger's avatar
Theo Steininger committed
11
12
13
14
15
16
17

    def at(self, data):
        return Cartesian3D(data=data,
                           label=self.label,
                           line=self.line,
                           marker=self.marker,
                           showlegend=self.showlegend)
18

19
20
21
22
    @property
    def figure_dimension(self):
        return 3

23
24
    def to_plotly(self):
        plotly_object = super(Cartesian3D, self).to_plotly()
Theo Steininger's avatar
Theo Steininger committed
25
        plotly_object['z'] = self.data[2]
26
27
        plotly_object['type'] = 'scatter3d'
        return plotly_object