code: def test_plot_coefficients(n_features, n_top_features):
      coef = np.arange(n_features) + 0.4
      names = ["feature_{}".format(i) for i in range(n_features)]
      plot_coefficients(coef, names, n_top_features=n_top_features)
      ax = plt.gca()
      assert len(ax.get_xticks()) == min(n_top_features, n_features)
      coef[:-5] = 0
      plot_coefficients(coef, names, n_top_features=n_top_features)
      ax = plt.gca()
      assert len(ax.get_xticks()) == 5
  
file_path: dabl/dabl/plot/tests/test_utils.py
imports: import pytest
  import numpy
  import matplotlib.pyplot
  from sklearn.datasets import load_iris
  from dabl.utils import data_df_from_bunch
  from dabl.plot.utils import find_pretty_grid, plot_coefficients, pairplot
label_desc: Use image node_id 2 for calling a global function with example usage: test_plot_coefficients(n_features, n_top_features) without return types