MCPcopy
hub / github.com/ContextLab/hypertools / plot

Method plot

hypertools/datageometry.py:146–190  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 15

test_plot_1dFunction · 0.80
test_plot_2dFunction · 0.80
test_plot_3dFunction · 0.80
test_plot_reduce_noneFunction · 0.80
test_plot_reduce3dFunction · 0.80
test_plot_reduce2dFunction · 0.80
test_plot_reduce1dFunction · 0.80
test_plot_reduce_align5dFunction · 0.80
test_plot_reduce10dFunction · 0.80
test_plot_model_dictFunction · 0.80
test_plot_cluster_strFunction · 0.80
test_plot_cluster_dictFunction · 0.80

Calls

no outgoing calls

Tested by 15

test_plot_1dFunction · 0.64
test_plot_2dFunction · 0.64
test_plot_3dFunction · 0.64
test_plot_reduce_noneFunction · 0.64
test_plot_reduce3dFunction · 0.64
test_plot_reduce2dFunction · 0.64
test_plot_reduce1dFunction · 0.64
test_plot_reduce_align5dFunction · 0.64
test_plot_reduce10dFunction · 0.64
test_plot_model_dictFunction · 0.64
test_plot_cluster_strFunction · 0.64
test_plot_cluster_dictFunction · 0.64