Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Can't visualize the csv

Hi there,
I’m new to plotly I’ve tried several times to upload a simple csv from ipython, the problem is that the graph is blank when I click view but I can see them when I click edit.

I also wonder if the creation of new graph is only possible interatively ie. using ipython vs python. It doesn’t seems to be working when calling the program from the python interpreter

and this is the program straight from the example:
import pandas as pd
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go

df = pd.read_csv('log.csv')

trace1 = go.Scatter( x=df[lab_x], y=df[lab_y], 
                mode='lines', name='values' )
layout = go.Layout(title='my csv data',
               plot_bgcolor='rgb(230, 230,230)')
fig = go.Figure(data=[trace1], layout=layout)
py.iplot(fig, filename='plot-my-csv')

Wow, this is weird. We’re investigating.

Looks like there are 4 spaces between your date and time values, see here:

In order for the chart viewer to properly recognize the x axis as dates, you need to reduce this to 1 space between the date and time strings.

The chart editor treats axes slightly differently and is plotting the xaxis as categorical strings, not as dates.

Anyway, get rid of the extra spaces and you should be :+1: