Plot the data Parameters ---------- data : numpy array, pandas dataframe or list of arrays/dfs The data to plot. If no data is passed, the xform_data from the DataGeometry object will be returned. kwargs : keyword arguments
(self, data=None, **kwargs)
| 144 | |
| 145 | # a function to plot the data |
| 146 | def plot(self, data=None, **kwargs): |
| 147 | """ |
| 148 | Plot the data |
| 149 | |
| 150 | Parameters |
| 151 | ---------- |
| 152 | data : numpy array, pandas dataframe or list of arrays/dfs |
| 153 | The data to plot. If no data is passed, the xform_data from |
| 154 | the DataGeometry object will be returned. |
| 155 | |
| 156 | kwargs : keyword arguments |
| 157 | Any keyword arguments supported by `hypertools.plot` are also supported |
| 158 | by this method |
| 159 | |
| 160 | Returns |
| 161 | ---------- |
| 162 | geo : hypertools.DataGeometry |
| 163 | A new data geometry object |
| 164 | |
| 165 | """ |
| 166 | |
| 167 | # import plot here to avoid circular imports |
| 168 | from .plot.plot import plot as plotter |
| 169 | |
| 170 | if data is None: |
| 171 | d = copy.copy(self.data) |
| 172 | transform = copy.copy(self.xform_data) |
| 173 | if any([k in kwargs for k in ['reduce', 'align', 'normalize', |
| 174 | 'semantic', 'vectorizer', 'corpus']]): |
| 175 | d = copy.copy(self.data) |
| 176 | transform = None |
| 177 | else: |
| 178 | d = data |
| 179 | transform = None |
| 180 | |
| 181 | # get kwargs and update with new kwargs |
| 182 | new_kwargs = copy.copy(self.kwargs) |
| 183 | update_kwargs = dict(transform=transform, reduce=self.reduce, |
| 184 | align=self.align, normalize=self.normalize, |
| 185 | semantic=self.semantic, vectorizer=self.vectorizer, |
| 186 | corpus=self.corpus) |
| 187 | new_kwargs.update(update_kwargs) |
| 188 | for key in kwargs: |
| 189 | new_kwargs.update({key : kwargs[key]}) |
| 190 | return plotter(d, **new_kwargs) |
| 191 | |
| 192 | def save(self, fname, compression=None): |
| 193 | """ |
no outgoing calls