<diagram dimensions="(300,240)" margins="5">
  <definition>f(x) = log(x+1)</definition>
  <coordinates bbox="[-0.2,-0.2,4,2]">

    <grid-axes at="grid-axes" xlabel="x" ylabel="y" vlabels="(0,1,2)"/>
    <riemann-sum at = "riemann-sum" function="f" domain="(1,3)" rule="right"
                 N="4" fill="lawngreen" stroke="black" thickness="1"/>
    <graph at="graph" function="f"/>

    <label at="a1" anchor="(1.25, 0.5*f(1))" clear-background="yes" background-margin="3">
      <m>A_1</m>
    </label>
    <label at="a2" anchor="(1.75, 0.5*f(1.5))"
           clear-background="yes" background-margin="3">
      <m>A_2</m>
    </label>
    <label at="a3" anchor="(2.25, 0.5*f(2))"
           clear-background="yes" background-margin="3">
      <m>A_3</m>
    </label>
    <label at="a4" anchor="(2.75, 0.5*f(2.5))"
           clear-background="yes" background-margin="3">
      <m>A_4</m>
    </label>
  </coordinates>

  <annotations>
    <annotation ref="figure"
                text="The graph of a function and the right Riemann sum with four terms from 1 to 3">
      <annotation ref="grid-axes"
                  text="The coordinate grid and axes">
        <annotation ref="grid"
                    text="The coordinate grid" />
        <annotation ref="axes"
                    text="The coordinate axes" />
      </annotation>
      <annotation ref="graph"
                  text="The graph of the function log x plus 1"/>
      <annotation ref="riemann-sum"
                  text="The right Riemann sum with four terms">
        <annotation ref="riemann-sum-0"
                    text="The first term in the Riemann sum is the area of this rectangle" />
        <annotation ref="riemann-sum-1"
                    text="The second term in the Riemann sum is the area of this rectangle" />
        <annotation ref="riemann-sum-2"
                    text="The third term in the Riemann sum is the area of this rectangle" />
        <annotation ref="riemann-sum-3"
                    text="The fourth term in the Riemann sum is the area of this rectangle" />
      </annotation>
    </annotation>

  </annotations>

</diagram>
