MCPcopy Index your code
hub / github.com/plotly/plotly.py / scatterplot_dict

Function scatterplot_dict

plotly/figure_factory/_scatterplot.py:202–354  ·  view source on GitHub ↗

Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked. Used if colormap is a dictionary with index values as keys pointing to colors. Forces colormap_type to behave categorically because it would no

(
    dataframe,
    headers,
    diag,
    size,
    height,
    width,
    title,
    index,
    index_vals,
    endpts,
    colormap,
    colormap_type,
    **kwargs,
)

Source from the content-addressed store, hash-verified

200
201
202def scatterplot_dict(
203 dataframe,
204 headers,
205 diag,
206 size,
207 height,
208 width,
209 title,
210 index,
211 index_vals,
212 endpts,
213 colormap,
214 colormap_type,
215 **kwargs,
216):
217 """
218 Refer to FigureFactory.create_scatterplotmatrix() for docstring
219
220 Returns fig for scatterplotmatrix with both index and colormap picked.
221 Used if colormap is a dictionary with index values as keys pointing to
222 colors. Forces colormap_type to behave categorically because it would
223 not make sense colors are assigned to each index value and thus
224 implies that a categorical approach should be taken
225
226 """
227
228 theme = colormap
229 dim = len(dataframe)
230 fig = make_subplots(rows=dim, cols=dim, print_grid=False)
231 trace_list = []
232 legend_param = 0
233 # Work over all permutations of list pairs
234 for listy in dataframe:
235 for listx in dataframe:
236 # create a dictionary for index_vals
237 unique_index_vals = {}
238 for name in index_vals:
239 if name not in unique_index_vals:
240 unique_index_vals[name] = []
241
242 # Fill all the rest of the names into the dictionary
243 for name in sorted(unique_index_vals.keys()):
244 new_listx = []
245 new_listy = []
246 for j in range(len(index_vals)):
247 if index_vals[j] == name:
248 new_listx.append(listx[j])
249 new_listy.append(listy[j])
250 # Generate trace with VISIBLE icon
251 if legend_param == 1:
252 if (listx == listy) and (diag == "histogram"):
253 trace = graph_objs.Histogram(
254 x=new_listx, marker=dict(color=theme[name]), showlegend=True
255 )
256 elif (listx == listy) and (diag == "box"):
257 trace = graph_objs.Box(
258 y=new_listx,
259 name=None,

Callers 1

create_scatterplotmatrixFunction · 0.85

Calls 6

make_subplotsFunction · 0.90
append_traceMethod · 0.80
keysMethod · 0.45
formatMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected