title: Message "Matplotlib is currently using agg" and Matplotlib doesn't display image
body: <p>Other people have this problem, I used their solutions but not solved.</p>
  
  <p>I use <code>virtual env with python3.5</code>.
  <code>Matplotlib</code> is installed under <code>virtual env</code>.
  I have python3.tkinter installed at system.</p>
  
  <p>When I check </p>
  
  <pre><code>matplotlib.get_backend()
  </code></pre>
  
  <p>I have </p>
  
  <pre><code>&gt;&gt;&gt; import matplotlib
  &gt;&gt;&gt; matplotlib.get_backend()
  'TkAgg'
  </code></pre>
  
  <p>But when I run the code below</p>
  
  <pre><code>for image_path in TEST_IMAGE_PATHS:
    image = Image.open(image_path)
    # the array based representation of the image will be used later in order to prepare the
    # result image with boxes and labels on it.
    image_np = load_image_into_numpy_array(image)
    # Expand dimensions since the model expects images to have shape: [1, None, None, 3]
    image_np_expanded = np.expand_dims(image_np, axis=0)
    # Actual detection.
    output_dict = run_inference_for_single_image(image_np, detection_graph)
    # Visualization of the results of a detection.
    vis_util.visualize_boxes_and_labels_on_image_array(
        image_np,
        output_dict['detection_boxes'],
        output_dict['detection_classes'],
        output_dict['detection_scores'],
        category_index,
        instance_masks=output_dict.get('detection_masks'),
        use_normalized_coordinates=True,
        line_thickness=8)
    #plt.figure(figsize=IMAGE_SIZE)
    plt.imshow(image_np)
    plt.show()
  </code></pre>
  
  <p>I have problem as</p>
  
  <pre><code> UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
    % get_backend())
  </code></pre>
  
  <p>I put at header as</p>
  
  <pre><code>from io import StringIO
  import matplotlib
  matplotlib.rcParams["backend"] = "TkAgg"
  from matplotlib import pyplot as plt
  from PIL import Image
  </code></pre>
  
  <p>some people said it was solved, but I still have the same problem and <code>plt</code> doesn't display image.</p>