<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
df = pd.DataFrame({'y': [3.5, 4.5, 6.5]}, index=[2.5, 1.5, 3.5])
df.plot(style='o')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'y'</span>: [<span class="pl-c1">3.5</span>, <span class="pl-c1">4.5</span>, <span class="pl-c1">6.5</span>]}, <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">2.5</span>, <span class="pl-c1">1.5</span>, <span class="pl-c1">3.5</span>])
<span class="pl-s1">df</span>.<span class="pl-en">plot</span>(<span class="pl-s1">style</span><span class="pl-c1">=</span><span class="pl-s">'o'</span>)</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6169306/31855630-2861406e-b6af-11e7-9205-995e580e7e4e.png"><img src="https://user-images.githubusercontent.com/6169306/31855630-2861406e-b6af-11e7-9205-995e580e7e4e.png" alt="actual" style="max-width: 100%;"></a></p>
<h4 dir="auto">Problem description</h4>
<p dir="auto">This above may or may not be expected behaviour, but it did catch me by surprise: The range of the horizontal axis will be [2.5, 3.5], even though one of the data points has an index value outside that range.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">Instead, I would have expected the output currently obtainable through <code class="notranslate">df.sort_index().plot(style='o')</code>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6169306/31855638-3d677ee2-b6af-11e7-9681-1f0c4f8b5bd5.png"><img src="https://user-images.githubusercontent.com/6169306/31855638-3d677ee2-b6af-11e7-9681-1f0c4f8b5bd5.png" alt="expected" style="max-width: 100%;"></a></p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.2.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 8.1<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.20.3<br>
pytest: 3.2.1<br>
pip: 9.0.1<br>
setuptools: 34.1.0<br>
Cython: 0.26<br>
numpy: 1.13.1<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 6.1.0<br>
sphinx: 1.6.2<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.2.2<br>
numexpr: 2.6.2<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: 2.4.8<br>
xlrd: 1.0.0<br>
xlwt: 1.2.0<br>
xlsxwriter: 0.9.8<br>
lxml: 3.8.0<br>
bs4: 4.6.0<br>
html5lib: 0.9999999<br>
sqlalchemy: 1.1.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: 0.5.0</p>
</details>
<p dir="auto">Compare these 2 plots below, this is not expected behavior:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd
from numpy.random import rand
testarr1=rand(100)
testarr2=rand(100)
pd.DataFrame(testarr2,index=testarr1).plot(style='.')
pd.DataFrame(testarr2,index=testarr1).sort().plot(style='.')"><pre class="notranslate"><code class="notranslate">import pandas as pd
from numpy.random import rand
testarr1=rand(100)
testarr2=rand(100)
pd.DataFrame(testarr2,index=testarr1).plot(style='.')
pd.DataFrame(testarr2,index=testarr1).sort().plot(style='.')
</code></pre></div>