2
$\begingroup$

Using the command,

    A = Show[
  Graphics[{Black, Thick, Circle[{0, 0}, 1, {0, Pi}], Darker[Red], 
    Circle[{0.5, 0}, 0.5, {0, Pi}], Circle[{-0.5, 0}, 0.5, {0, Pi}], 
    Blue, Circle[{0.75, 0}, 0.25, {0, Pi}], 
    Circle[{0.25, 0}, 0.25, {0, Pi}], 
    Circle[{-0.25, 0}, 0.25, {0, Pi}], 
    Circle[{-0.75, 0}, 0.25, {0, Pi}], Darker[Green], 
    Circle[{(-1 - 0.75)/2, 0}, Abs[(-1 - 0.75)/2 - (-0.75)], {0, Pi}],
     Circle[{(-0.75 - 0.5)/2, 0}, 
     Abs[(-0.75 - 0.5)/2 - (-0.5)], {0, Pi}], 
    Circle[{(-0.5 - 0.25)/2, 0}, 
     Abs[(-0.5 - 0.25)/2 - (-0.25)], {0, Pi}], 
    Circle[{(-0.25 - 0)/2, 0}, 
     Abs[(-0.25 - 0.00)/2 - (-0.00)], {0, Pi}], 
    Circle[{(1 + 0.75)/2, 0}, Abs[(1 + 0.75)/2 - (0.75)], {0, Pi}], 
    Circle[{(0.75 + 0.5)/2, 0}, Abs[(0.75 + 0.5)/2 - (0.5)], {0, Pi}],
     Circle[{(0.5 + 0.25)/2, 0}, 
     Abs[(0.5 + 0.25)/2 - (0.25)], {0, Pi}], 
    Circle[{(0.25 + 0)/2, 0}, 
     Abs[(0.25 - 0.00)/2 - (0.00)], {0, Pi}]}], 
  Plot[0, {x, -1, 1}, PlotStyle -> {Black, Thickness[Large]}], 
  Frame -> True, Background -> LightBlue]

I have the following plot:

enter image description here

I want to include a legend where I label the plot manually. For instance, I want to label the dark red set of curves with the label "first iteration," because I got this curve by applying a recursive definition for value k = 1.

How would I go about implementing such a scheme?

$\endgroup$
3
$\begingroup$
Legended["YourPlot",
  Placed[LineLegend[{Red,Green,Blue,"Your Color"},   
        {"Label1","Label2",..."LabelX"}],
    Scaled@{0.5,0.5}]]

You can use another Legend objects instead LineLegend (see help for it for details). The scaled coordinates defines the position of the legend in the figure.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.