Open neighthan opened 4 years ago
Ah, the FAQ does address what tuples in vdims
are used for; I didn't see it since I was searching for the word vdims. If one was passing in a dataframe, then a tuple of (column_name, plot_axis_name)
could be given.
Thanks for reporting this. Maybe we should add the word vdims
to the FAQ so this behavior is more searchable..
Issue: different behavior for lists vs tuples
I've been confused multiple times because of how holoviews handles tuples vs lists. Here are a couple of examples:
As input data to a plot
hv.Scatter([x, y, c]).data
, it assumes that the first two entries in each array are, respectively, the (x, y) coordinates of the points.For
vdims
So, I've learned that, for how I format my data, I should use tuples instead of lists. Then I try to rename my
vdims
:hv.Scatter((x, y, c), kdims="h", vdims=("w", "c")).data
shows I just haveh
andw
stored for each point;c
isn't present at all. I'm not sure how using a tuple here is being interpreted or what the proper way to use one would be.Solution: documentation?
For me, it'd be nice if, e.g.,
hv.Scatter((x, y))
andhv.Scatter([x, y])
were equivalent, but I assume some other people are depending on the current behavior of[x, y]
, so this is just a request for clearer documentation. I don't know where would be the best place to put that information, though (the FAQ? unless I'm the only one for whom this issue is "frequent" enough). This information is probably already available somewhere, but I'm not sure how I'd easily find it when, e.g., I don't understand why myvdims
aren't working how I expect..