code: def test_max_terms(self):
      tdm = build_hamlet_jz_term_doc_mat()
      j = ScatterChart(
          term_doc_matrix=tdm, minimum_term_frequency=0, max_terms=2
      ).to_dict("hamlet")
      self.assertEqual(2, len(j["data"]))
  
      j = ScatterChart(
          term_doc_matrix=tdm, minimum_term_frequency=0, max_terms=10
      ).to_dict("hamlet")
      self.assertEqual(10, len(j["data"]))
  
      j = ScatterChart(
          term_doc_matrix=tdm,
          minimum_term_frequency=0,
          pmi_threshold_coefficient=0,
          max_terms=10000,
      ).to_dict("hamlet")
      self.assertEqual(len(tdm.get_term_freq_df()), len(j["data"]))
  
      j = ScatterChart(
          term_doc_matrix=tdm,
          minimum_term_frequency=0,
          pmi_threshold_coefficient=0,
          max_terms=None,
      ).to_dict("hamlet")
      self.assertEqual(len(tdm.get_term_freq_df()), len(j["data"]))
  
imports: import sys
  from unittest import TestCase
  import numpy
  import pandas
  from scattertext import LogOddsRatioUninformativeDirichletPrior, scale
  from scattertext import ScatterChart
  from scattertext.ScatterChart import CoordinatesNotRightException, TermDocMatrixHasNoMetadataException, NeedToInjectCoordinatesException
  from scattertext.test.test_corpusFromPandasWithoutCategories import get_term_doc_matrix_without_categories
  from scattertext.test.test_semioticSquare import get_test_corpus
  from scattertext.test.test_termDocMatrixFactory import build_hamlet_jz_term_doc_mat, build_hamlet_jz_corpus_with_meta
label_desc: Use image node_id 16 for calling the TestScatterChart obj's underlying member method code with example usage: obj.test_max_terms() without return types