<diagram dimensions="(300,300)" margins="5">
  <definition>f(x,y) = y^2 - x^3 + x</definition>
  <definition>g(x) = x^3 - x</definition>

  <coordinates bbox="[-1.95, -1.95, 1.95, 1.95]">
    <grid-axes xlabel="x" ylabel="y" />
    <label at="function-expr" anchor="(-2,2)"
	   alignment="southeast">
      <m>y^2 - x^3 + x = k</m>
    </label>
    

    <group at="curves">
      <group at="curve--1">
        <implicit-curve function="f" k="-1" stroke="orange" />
        <label anchor="(1.4,0.5)" alignment="center" clear-background="yes">
          <m>\text{}-1</m>
        </label>
      </group>
      
      <group at="curve-0">
        <implicit-curve function="f" k="0" stroke="orange" />
        <label anchor="(-0.3,0.5)" alignment="center" clear-background="yes">
          <m>\text{}0</m>
        </label>
        <label anchor="(1,0)" alignment="center" clear-background="yes">
          <m>\text{}0</m>
        </label>
      </group>
      
      <group at="curve-root3">
        <implicit-curve function="f" k="g(-sqrt(1/3))" stroke="orange"/>
        <label anchor="(0.3,-0.3)" alignment="center" clear-background="yes">
          <m>\frac{2}{3\sqrt{3}}</m>
        </label>
      </group>
      
      <group at="curve-1">
        <implicit-curve function="f" k="1" stroke="orange" />
        <label anchor="(0.5,0.8)" alignment="center" clear-background="yes">
          <m>\text{}1</m>
        </label>
      </group>
      
      <group at="curve-2">
        <implicit-curve function="f" k="2" stroke="orange" />
        <label anchor="(0.5,1.3)" alignment="center" clear-background="yes">
          <m>\text{}2</m>
        </label>
      </group>
    </group>
  </coordinates>
  
  <annotations>
    <annotation ref="figure"
		text="Level curves of the function y squared minus x cubed plus x">
      <annotation ref="curves" text="The level curves">
        <annotation ref="curve--1" text="The level curve minus 1" />
        <annotation ref="curve-0" text="The level curve 0" />
        <annotation ref="curve-root3" text="The level curve 2 over 3 root 3" />
        <annotation ref="curve-1" text="The level curve 1" />
        <annotation ref="curve-2" text="The level curve 2" />
      </annotation>
    </annotation>
  </annotations>
  
</diagram>


