title: How to put background image to the plot in Rust plotters lib
body: <p>I'm trying to draw car trips on a plane. I'm using Plotters library.
  Here is some code example of trips' drawing procedure:</p>
  <pre class="lang-rust prettyprint-override"><code>pub fn save_trips_as_a_pic&lt;'a&gt;(trips: &amp;CarTrips, resolution: (u32, u32))
  {
     // Some initializing stuff 
     /// &lt;...&gt;
  
      let root_area =
          BitMapBackend::new(&quot;result.png&quot;, (resolution.0, resolution.1)).into_drawing_area();
  
      root_area.fill(&amp;WHITE).unwrap();
  
      let root_area =
          root_area.margin(10,10,10,10).titled(&quot;TITLE&quot;,
                           (&quot;sans-serif&quot;, 20).into_font()).unwrap();
  
      let drawing_areas =
          root_area.split_evenly((cells.1 as usize, cells.0 as usize));
  
      for (index, trip) in trips.get_trips().iter().enumerate(){
  
          let mut chart =
              ChartBuilder::on(drawing_areas.get(index).unwrap())
              .margin(5)
              .set_all_label_area_size(50)
              .build_ranged(50.0f32..54.0f32, 50.0f32..54.0f32).unwrap();
  
          chart.configure_mesh().x_labels(20).y_labels(10)
              .disable_mesh()
              .x_label_formatter(&amp;|v| format!(&quot;{:.1}&quot;, v))
              .y_label_formatter(&amp;|v| format!(&quot;{:.1}&quot;, v))
              .draw().unwrap();
  
          let coors = trip.get_points();
          {
              let draw_result =
                  chart.draw_series(series_from_coors(&amp;coors, &amp;BLACK)).unwrap();
  
              draw_result.label(format!(&quot;TRIP {}&quot;,index + 1)).legend(
                  move |(x, y)|
                  PathElement::new(vec![(x, y), (x + 20, y)], &amp;random_color));
          }
          {
              // Here I put red dots to see exact nodes
              chart.draw_series(points_series_from_trip(&amp;coors, &amp;RED));
          }
          
          chart.configure_series_labels().border_style(&amp;BLACK).draw().unwrap();
      }
  }
  </code></pre>
  <p>What I got now on Rust Plotters:</p>
  <p><img src="https://i.stack.imgur.com/eWzrC.png" alt="What I got now on Rust Plotters" /></p>
  <p>So, after drawing it in the 'result.png' image file, I struggle to understand these &quot;lines&quot;, because I don't see the map itself. I suppose, there is some way in this library to put a map &quot;map.png&quot; in the background of the plot. If I would use Python, this problem will be solved like this:</p>
  <pre class="lang-py prettyprint-override"><code># here we got a map image;
  img: Image.Image = Image.open(&quot;map-image.jpg&quot;)
  img.putalpha(64)
  imgplot = plt.imshow(img)
  # let's pretend that we got our map size in pixels and coordinates
  # just in right relation to each other.
  scale = 1000
  x_shift = 48.0
  y_shift = 50.0
  coor_a = Coordinate(49.1, 50.4)
  coor_b = Coordinate(48.9, 51.0)
  
  x_axis = [coor_a.x, coor_b.x]
  x_axis = [(element-x_shift) * scale for element in x_axis]
  y_axis = [coor_a.y, coor_b.y]
  y_axis = [(element-y_shift) * scale for element in y_axis]
  
  plt.plot(x_axis, y_axis, marker='o')
  plt.show()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/VNuDv.png" rel="nofollow noreferrer">Desired result on Python</a></p>
  <p>Well, that's easy on Python, but I got no idea, how to do similar thing on Rust.</p>