html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/6263#issuecomment-1049066201,https://api.github.com/repos/pydata/xarray/issues/6263,1049066201,IC_kwDOAMm_X84-h3rZ,1562854,2022-02-23T18:09:32Z,2022-02-23T18:09:32Z,CONTRIBUTOR,"It could, after the units are set to dates, but all it would do is pass to `datetime64`, so the recommendation would be that users do that explicitly. If the units are not set to dates (ie. this is the first call on the axis) then strings are interpreted as categories in Matplotlib, and all sorts of hilarity ensues if the strings are all dates....","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1130073503 https://github.com/pydata/xarray/issues/6263#issuecomment-1049060894,https://api.github.com/repos/pydata/xarray/issues/6263,1049060894,IC_kwDOAMm_X84-h2Ye,2448579,2022-02-23T18:03:52Z,2022-02-23T18:03:52Z,MEMBER,@jklymak it seems a benefit of the pandas converter is that it converts strings to dates. Can the matplotlib converter do the same?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1130073503 https://github.com/pydata/xarray/issues/6263#issuecomment-1035102667,https://api.github.com/repos/pydata/xarray/issues/6263,1035102667,IC_kwDOAMm_X849smnL,14371165,2022-02-10T16:07:53Z,2022-02-10T16:07:53Z,MEMBER,"xarray now relies on matplotlibs converters instead of automatically registering pandas converters, see #6109. A pure matplotlib version doesn't work either so importing xarray shouldn't all of a sudden change that: ```python import numpy as np import matplotlib.pyplot as plt times = np.arange(np.datetime64('2001-01-02'), np.datetime64('2002-02-03'), np.timedelta64(75, 'm')) y = np.random.randn(len(times)) fig, ax = plt.subplots() ax.plot(times, y) ax.set_xlim([""2002-01-03"",""2002-01-20""]) ``` One way is to use datetime64 in set_xlim, which makes sense to me since `times` is `datetime64` as well: ```python import numpy as np import matplotlib.pyplot as plt times = np.arange(np.datetime64('2001-01-02'), np.datetime64('2002-02-03'), np.timedelta64(75, 'm')) y = np.random.randn(len(times)) fig, ax = plt.subplots() ax.plot(times, y) ax.set_xlim(np.array([""2002-01-03"",""2002-01-20""], dtype=""datetime64"")) ``` Or use pandas converters like xarray did before: ```python import numpy as np import matplotlib.pyplot as plt import pandas as pd pd.plotting.register_matplotlib_converters() times = np.arange(np.datetime64('2001-01-02'), np.datetime64('2002-02-03'), np.timedelta64(75, 'm')) y = np.random.randn(len(times)) fig, ax = plt.subplots() ax.plot(times, y) ax.set_xlim([""2002-01-03"",""2002-01-20""]) ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1130073503