Misleading behavior in axis
I am plotting end of the month data as followed.


The above shows Jan 2017 even though the real date is 2016-12-31. It is misleading since the Jan 2017 data is shows up at 0.0054, while in reality it does not exist.

Then, I have decided to put the date as well in label using 'xaxis': {'tickformat': '%Y-%m-%d'}. This shows plot is right since the line stopped before it actually reaches 2017-01-01.
Why is Plotly's default behavior to do label (grid lines as well) the next day after the date instead of the current date ? Is there a parameter to turn it off ?
Here is the code for completeness sake.
{'data': [{'line': {'color': 'rgba(255, 153, 51, 1.0)', 'dash': 'solid', 'width': 1.3}, 'mode': 'lines', 'name': 'price', 'text': '', 'type': 'scatter', 'x': ['2016-07-31', '2016-08-31', '2016-09-30', '2016-10-31', '2016-11-30', '2016-12-31', '2017-01-31', '2017-02-28', '2017-03-31', '2017-04-30'], 'y': array([0.00536, 0.00548, 0.00513, 0.00533, 0.00539, 0.0054, '', 0.0052, 0.00547, 0.00556], dtype=object)}], 'layout': {'legend': {'bgcolor': '#F5F6F9', 'font': {'color': '#4D5663'}}, 'paper_bgcolor': '#F5F6F9', 'plot_bgcolor': '#F5F6F9', 'titlefont': {'color': '#4D5663'}, 'xaxis1': {'gridcolor': '#E1E5ED', 'showgrid': True, 'tickfont': {'color': '#4D5663'}, 'title': '', 'titlefont': {'color': '#4D5663'}, 'zerolinecolor': '#E1E5ED'}, 'yaxis1': {'gridcolor': '#E1E5ED', 'showgrid': True, 'tickfont': {'color': '#4D5663'}, 'title': '', 'titlefont': {'color': '#4D5663'}, 'zerolinecolor': '#E1E5ED'}}}
Why is Plotly's default behavior to do label (grid lines as well) the next day after the date instead of the current date ? Is there a parameter to turn it off ?
Plotly doesn't look at the data at all when deciding where to put ticks. It just looks at the axis range and finds the "roundest" values it can place a reasonable (or the requested) number of ticks at. We consider the first of the month (at the very beginning of the day) to be the roundest values on this plot, so we put the ticks there. And we consider midnight Jan 1, 2017 to be "Jan 2017" - I recognize that this can be confusing in some contexts as the entire month of January comes after this tick, but if it's any help, this is consistent with how numeric axes work: the entire span of "2.xxxx" comes after the number "2" for example.
If you'd like ticks on the last day of the month, you can do this:
Plotly.relayout(gd, {
// the year doesn't matter, just put the canonical tick at the last day of any month
// there's some annoying logic here, as it can't always be the 31st of every month...
// suffice it to say this works :)
'xaxis.tick0': '2000-12-31',
// currently when you specify tick0, automatic dtick is also affected
// we might be able to improve this algorithm, but for the moment you have to
// explicitly specify 1-month tick spacing again.
'xaxis.dtick': 'M1'
})
And then if you still want it to say "Jan 2017" you can do that with `xaxis.tickformat: '%b %Y'`
I found another work around, which might be slightly easier..
As previously discussed, the following does not work ( at least not the behavior I wished).
{'data': [{'line': {'color': 'rgba(255, 153, 51, 1.0)',
'dash': 'solid',
'width': 1.3},
'marker': {'size': 12, 'symbol': 'dot'},
'mode': 'markers',
'name': 'History',
'text': '',
'type': 'scatter',
'x': array(['2016-02-29', '2016-03-31', '2016-04-30', '2016-05-31',
'2016-06-30', '2016-07-31', '2016-08-31', '2016-09-30',
'2016-10-31', '2016-11-30', '2016-12-31', '2017-01-31',
'2017-02-28', '2017-03-31', '2017-04-30'], dtype=object),
'y': array([ 0.00496, 0.00521, 0.00577, 0.00545, 0.0051 , 0.00536,
0.00548, 0.00513, 0.00533, 0.00539, 0.0054 , 0.00526,
0.0052 , 0.00547, 0.00556])}],
'layout': {'legend': {'bgcolor': '#F5F6F9', 'font': {'color': '#4D5663'}},
'paper_bgcolor': '#F5F6F9',
'plot_bgcolor': '#F5F6F9',
'titlefont': {'color': '#4D5663'},
'xaxis1': {'gridcolor': '#E1E5ED',
'showgrid': True,
'tickfont': {'color': '#4D5663'},
'title': '',
'titlefont': {'color': '#4D5663'},
'zerolinecolor': '#E1E5ED'},
'yaxis1': {'gridcolor': '#E1E5ED',
'showgrid': True,
'tickfont': {'color': '#4D5663'},
'title': '',
'titlefont': {'color': '#4D5663'},
'zerolinecolor': '#E1E5ED'}}}


But, the following does work .
{'data': [{'line': {'color': 'rgba(255, 153, 51, 1.0)', 'dash': 'solid', 'width': 1.3}, 'marker': {'size': 12, 'symbol': 'dot'}, 'mode': 'markers', 'name': 'History', 'text': '', 'type': 'scatter', 'x': array(['2016/02/29', '2016/03/31', '2016/04/30', '2016/05/31', '2016/06/30', '2016/07/31', '2016/08/31', '2016/09/30', '2016/10/31', '2016/11/30', '2016/12/31', '2017/01/31', '2017/02/28', '2017/03/31', '2017/04/30'], dtype=object), 'y': array([ 0.00496, 0.00521, 0.00577, 0.00545, 0.0051 , 0.00536, 0.00548, 0.00513, 0.00533, 0.00539, 0.0054 , 0.00526, 0.0052 , 0.00547, 0.00556])}], 'layout': {'legend': {'bgcolor': '#F5F6F9', 'font': {'color': '#4D5663'}}, 'paper_bgcolor': '#F5F6F9', 'plot_bgcolor': '#F5F6F9', 'titlefont': {'color': '#4D5663'}, 'xaxis1': {'gridcolor': '#E1E5ED', 'showgrid': True, 'tickfont': {'color': '#4D5663'}, 'title': '', 'titlefont': {'color': '#4D5663'}, 'zerolinecolor': '#E1E5ED'}, 'yaxis1': {'gridcolor': '#E1E5ED', 'showgrid': True, 'tickfont': {'color': '#4D5663'}, 'title': '', 'titlefont': {'color': '#4D5663'}, 'zerolinecolor': '#E1E5ED'}}}

The only differences in code is the difference in date format '2016-02-29' vs '2016/02/29'. It seems like the former is interpreted as date and the latter is interpreted as regular string. Is that correct ?
If so, is it reliable to assume that 2016/02/29 is not going to be interpreted as date ?
I understand there is an option which set the type of axis in the layout to be "date". My initial guess for default behavior is that Plotly is not going to interpret any type of string as date unless the user explicitly specify the axis to be "date" type. Since that is not true, would it make sense to add axis type "String" as a new feature ?
If so, is it reliable to assume that 2016/02/29 is not going to be interpreted as date ?
Correct. We will interpret 'yyyy-mm-dd HH:MM:SS.ssssss' or any truncation of that as a date, with a couple of extensions ('T' instead of a space in the middle, negative years, timezone info at the end), but we make no attempt to account for other separators, orderings, etc. So what you've given there will create a categorical axis, with all the caveats that entails (ordering, spacing, etc.)
would it make sense to add axis type "String" as a new feature ?
type: 'category'
@flyingBurman in the end I don't see a bug or feature request here, after we clarified what plotly.js is doing. Feel free to reopen if I'm misinterpreting or missing something.