# Plots Not Showing Up

**URL:** <https://community.plotly.com/t/plots-not-showing-up/16311>\
**Category:** 📊 Plotly Python\
**Created:** [December 1, 2018, 6:27am UTC](https://community.plotly.com/t/plots-not-showing-up/16311 "2018-12-01T06:27:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcyee90](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mcyee90](https://community.plotly.com/u/mcyee90)\
**Post date:** [December 1, 2018, 6:27am UTC](https://community.plotly.com/t/plots-not-showing-up/16311/1 "2018-12-01T06:27:54Z")

</div>

I am trying to create a scatter graph with three traces as well as axes for each scatter graph. Here is my code. My data is located in a pandas table. For some reason, only the third trace is showing up in the main graph, but all three lines are showing up in the dragging application created at the bottom.

```auto
trace1 = go.Scatter(
            x = all_data['Date'],
            y = all_data['Revenue'],
            name = "Revenues",
            line = {'color': "#008000"},
            mode = 'lines')

trace2 = go.Scatter(
            x = all_data['Date'],
            y = all_data['total'],
            name = "Cost",
            line = {'color': "#ff0000"},
            mode = 'lines',
            yaxis='y2')

trace3 = go.Scatter(
            x=all_data['Date'],
            y=all_data['Visits'],
            name = "Visits",
            line = {'color': "#0000ff"},
            mode = 'lines',
            yaxis='y3')

day_data = [trace1, trace2, trace3]

layout = go.Layout(
    title='Revenue, Cost and Website Visits (Daily)',
    xaxis=dict(
        rangeselector=dict(
            buttons=list([
                dict(count=1,
                     label='1m',
                     step='month',
                     stepmode='backward'),
                dict(count=6,
                     label='6m',
                     step='month',
                     stepmode='backward'),
                dict(step='all')
            ])
        ),
        domain=[0.25, 0.75],
        rangeslider=dict(
            visible = True
        ),
        type='date'
    ),
    yaxis = dict(
        title='Revenue',
        titlefont=dict(
            color='#008000'
            ),
        tickfont=dict(
            color='#008000'
            ),
        anchor='x',
        overlaying='y',
        side='left',
        position=0
        ),
    yaxis2 = dict(
        title='Cost',
        titlefont=dict(
            color='#ff0000'
            ),
        tickfont=dict(
            color='#ff0000'
            ),
        anchor='x',
        overlaying='y',
        side='right',
        ),
    
    yaxis3=dict(
        title='Visits',
        titlefont=dict(
            color='#0000ff'
            ),
        tickfont=dict(
            color='#0000ff'
            ),
        anchor='free',
        overlaying='y',
        side='right',
        position=.95
        )
)

fig1 = go.Figure(data=day_data, layout=layout)

py.iplot(fig1)

```

 ![newplot](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/1/1ca9d69eeb3bce2db1a1398f1a8312d30233935a.png)

csv: [https://github.com/mcyee90/MedMen/blob/master/all\_data.csv](https://github.com/mcyee90/MedMen/blob/master/all_data.csv)

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [December 1, 2018, 11:00am UTC](https://community.plotly.com/t/plots-not-showing-up/16311/2 "2018-12-01T11:00:26Z")

</div>

Hi @mcyee90,

Could you update your post to put the code in a fenced code block? See [https://help.github.com/articles/creating-and-highlighting-code-blocks/](https://help.github.com/articles/creating-and-highlighting-code-blocks/). This will keep the markdown renderer from messing up the formatting. Also, please include the imports and some sample data so that folks can copy and paste the code block and run it themselves.

Thanks!  
-Jon

---

<div class="post-metadata">

**Author:** ![mcyee90](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mcyee90](https://community.plotly.com/u/mcyee90)\
**Post date:** [December 2, 2018, 5:08am UTC](https://community.plotly.com/t/plots-not-showing-up/16311/3 "2018-12-02T05:08:19Z")

</div>

I think I updated it successfully, please let me know if there is anything else I can do?

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [December 2, 2018, 11:35am UTC](https://community.plotly.com/t/plots-not-showing-up/16311/4 "2018-12-02T11:35:29Z")

</div>

Hi @mcyee90,

It looks like you need to remove `overlaying='y'` from `yaxis`. I’m not sure why it causes this exact problem, but removing it makes sense because `yaxis` can’t really overlay on top of itself. When I remove this one line, here’s what I get:

```python
import plotly.graph_objs as go
import pandas as pd

all_data = pd.read_csv('https://raw.githubusercontent.com/mcyee90/MedMen/master/all_data.csv')

trace1 = go.Scatter(
            x = all_data['Date'],
            y = all_data['Revenue'],
            name = "Revenues",
            line = {'color': "#008000"},
            mode = 'lines')

trace2 = go.Scatter(
            x = all_data['Date'],
            y = all_data['total'],
            name = "Cost",
            line = {'color': "#ff0000"},
            mode = 'lines',
            yaxis='y2')

trace3 = go.Scatter(
            x=all_data['Date'],
            y=all_data['Visits'],
            name = "Visits",
            line = {'color': "#0000ff"},
            mode = 'lines',
            yaxis='y3')

day_data = [trace1, trace2, trace3]

layout = go.Layout(
    title='Revenue, Cost and Website Visits (Daily)',
    xaxis=dict(
        rangeselector=dict(
            buttons=list([
                dict(count=1,
                     label='1m',
                     step='month',
                     stepmode='backward'),
                dict(count=6,
                     label='6m',
                     step='month',
                     stepmode='backward'),
                dict(step='all')
            ])
        ),
        domain=[0.25, 0.75],
        rangeslider=dict(
            visible = True
        ),
        type='date'
    ),
    yaxis = dict(
        title='Revenue',
        titlefont=dict(
            color='#008000'
            ),
        tickfont=dict(
            color='#008000'
            ),
        anchor='x',
        # overlaying='y',
        side='left',
        position=0
        ),
    yaxis2 = dict(
        title='Cost',
        titlefont=dict(
            color='#ff0000'
            ),
        tickfont=dict(
            color='#ff0000'
            ),
        anchor='x',
        overlaying='y',
        side='right',
        ),
    
    yaxis3=dict(
        title='Visits',
        titlefont=dict(
            color='#0000ff'
            ),
        tickfont=dict(
            color='#0000ff'
            ),
        anchor='free',
        overlaying='y',
        side='right',
        position=.95
        )
)

fig1 = go.Figure(data=day_data, layout=layout)
py.iplot(fig1)

```

 ![newplot%20(7)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/d/dd76066e9c7f478abefb802c88e862dd7e3e7df7.png)

Hope that helps!  
-Jon

---

<div class="post-metadata">

**Author:** ![mcyee90](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mcyee90](https://community.plotly.com/u/mcyee90)\
**Post date:** [December 2, 2018, 6:44pm UTC](https://community.plotly.com/t/plots-not-showing-up/16311/5 "2018-12-02T18:44:16Z")

</div>

Thanks so much for the help!
