title: "ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected."
body: <p>Not able to understand why I am getting this error and how to fix it.
  I am trying to plot a graph for number of listings in the neighborhood.
  I have tried uninstalling and then reinstalling pandas but it doesn't seem to work</p>
  <p>By running the following code :</p>
  <pre><code>feq=listings['neighbourhood'].value_counts().sort_values(ascending=True)
  feq.plot.barh(figsize=(10, 8), color='b', width=1)
  plt.title(&quot;Number of listings by neighbourhood&quot;, fontsize=20)
  plt.xlabel('Number of listings', fontsize=12)
  plt.show()
  </code></pre>
  <p>This error is encountered :</p>
  <pre><code>ImportError: matplotlib is required for plotting when the default backend &quot;matplotlib&quot; is selected.
  ---------------------------------------------------------------------------
  ImportError                               Traceback (most recent call last)
  C:\Users\DIKSHA~1\AppData\Local\Temp/ipykernel_2704/2039381319.py in &lt;module&gt;
        1 feq=listings['neighbourhood'].value_counts().sort_values(ascending=True)
  ----&gt; 2 feq.plot.barh(figsize=(10, 8), color='b', width=1)
        3 plt.title(&quot;Number of listings by neighbourhood&quot;, fontsize=20)
        4 plt.xlabel('Number of listings', fontsize=12)
        5 plt.show()
  
  ~\anaconda3\lib\site-packages\pandas\plotting\_core.py in barh(self, x, y, **kwargs)
     1197             &gt;&gt;&gt; index = ['snail', 'pig', 'elephant',
     1198             ...          'rabbit', 'giraffe', 'coyote', 'horse']
  -&gt; 1199             &gt;&gt;&gt; df = pd.DataFrame({'speed': speed,
     1200             ...                    'lifespan': lifespan}, index=index)
     1201             &gt;&gt;&gt; ax = df.plot.barh(x='lifespan')
  
  ~\anaconda3\lib\site-packages\pandas\plotting\_core.py in __call__(self, *args, **kwargs)
      873                 &quot;arguments, only keyword arguments. The order of &quot;
      874                 &quot;positional arguments will change in the future. &quot;
  --&gt; 875                 f&quot;Use `Series.plot({keyword_args})` instead of &quot;
      876                 f&quot;`Series.plot({positional_args})`.&quot;
      877             )
  
  ~\anaconda3\lib\site-packages\pandas\plotting\_core.py in _get_plot_backend(backend)
     1784         f&quot;Could not find plotting backend '{backend}'. Ensure that you've &quot;
     1785         f&quot;installed the package providing the '{backend}' entrypoint, or that &quot;
  -&gt; 1786         &quot;the package has a top-level `.plot` method.&quot;
     1787     )
     1788 
  
  ImportError: matplotlib is required for plotting when the default backend &quot;matplotlib&quot; is selected.
  </code></pre>