fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Apache License 2.0
10.05k stars 1.13k forks source link

Float numbers as labels at scatter plot #651

Open defaultUser3214 opened 5 years ago

defaultUser3214 commented 5 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I would like to plot a scatter plot with labels that are floats and not int values. I think many data scientists have the same problem and it would be great if you Y data could also be float. Describe the solution you'd like A clear and concise description of what you want to happen. The visdom experienced an exception while running: AssertionError('labels should be integers') If you use float values as y values for a scatter plot from the example demo.py https://github.com/facebookresearch/visdom/blob/master/example/demo.py Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. I tried to do this workaround for i in range(0, len(data["labels"])): data["labels"] = int(data["labels"] * 100000)

Y = np.random.rand(100)

old_scatter = viz.scatter(

    Y = data["labels"],
    X = [list(a) for a in zip(data["top"], data["middle"])],

which resulted in a The visdom experienced an exception while running: TypeError("cannot convert the series to <class 'int'>")

Additional context Add any other context or screenshots about the feature request here.

JackUrb commented 5 years ago

Hi @defaultUser3214 - labels are a fairly complicated component of the scatter implementation, as they're used to determine indexes into the legend and colormap. Supporting other datatypes would lead to a further increase in complexity where we'd need a map between labels and indices. It could be potentially possible, but I don't necessarily see a clear and clean solution for doing this.

SysOverdrive commented 4 years ago

Is there any other way to display/load float numbers on the side of a scatter plot ?

For example when calculating some metrics (dice/f score) of a prediction and you want to add that to the scatter plot in a corner?