fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

columnnames or xticklabels not work for line

hei6775 opened this issue · comments

Hello, I am newer in Visdom. I want to change the xticklabels.

a = np.linspace(1,4,4)
vis.line(a,win="line plot", env="MyPlotEnv",
         opts=dict(
            columnnames = ['2012', '2013', '2014', '2015']
         ),
         )

If I change the columnnames to xticklabels, but nothing seems to have changed
But not work. What should I do?

I suspect in order to properly use xticklabels, you'll also need to provide xtickvals, but I'm not entirely sure. We transform incoming arguments to try to conform to the plotly standard.

Yes, you are right. After I tried to add xtickvals, it works!!

a = np.linspace(1,4,4)
b = np.linspace(0,3,4)
vis.line(X=b, Y=a,win="line plot3", env="MyPlotEnv",
         opts=dict(
            xtickmin=0,
            xtickmax=5,
            xtickstep=1,
            xtickvals=[1,2,3],
            xticklabels= ['2012','2013', '2014'],
         ),
         update="append"
         )

Thanks for your response!!