How to align the plot legends in the following way?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Consider example
ContourPlot[(x - 2)^2 + (y - 2)^2 ==
12, (x + 2)^3 + (y + 2)^3 ==8, x, -4, 4, y, -4, 4,
PlotLegends ->
Placed[Style["Region 1", 20], Style["Region 2", 20], 0.7, 0.82]]
The result is the picture on the left. Could you please tell me to change the colour of the legend text and set for each plot legend set its own coordinate, see the picture on the right?
plotting syntax legending
add a comment |Â
up vote
1
down vote
favorite
Consider example
ContourPlot[(x - 2)^2 + (y - 2)^2 ==
12, (x + 2)^3 + (y + 2)^3 ==8, x, -4, 4, y, -4, 4,
PlotLegends ->
Placed[Style["Region 1", 20], Style["Region 2", 20], 0.7, 0.82]]
The result is the picture on the left. Could you please tell me to change the colour of the legend text and set for each plot legend set its own coordinate, see the picture on the right?
plotting syntax legending
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Consider example
ContourPlot[(x - 2)^2 + (y - 2)^2 ==
12, (x + 2)^3 + (y + 2)^3 ==8, x, -4, 4, y, -4, 4,
PlotLegends ->
Placed[Style["Region 1", 20], Style["Region 2", 20], 0.7, 0.82]]
The result is the picture on the left. Could you please tell me to change the colour of the legend text and set for each plot legend set its own coordinate, see the picture on the right?
plotting syntax legending
Consider example
ContourPlot[(x - 2)^2 + (y - 2)^2 ==
12, (x + 2)^3 + (y + 2)^3 ==8, x, -4, 4, y, -4, 4,
PlotLegends ->
Placed[Style["Region 1", 20], Style["Region 2", 20], 0.7, 0.82]]
The result is the picture on the left. Could you please tell me to change the colour of the legend text and set for each plot legend set its own coordinate, see the picture on the right?
plotting syntax legending
plotting syntax legending
asked 5 hours ago
John Taylor
682211
682211
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
Try this:
Show[
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 ==
8, x, -4, 4, y, -4, 4, ContourStyle -> Blue, Orange],
Graphics[Text[Style["Region 1", 20, Blue], Scaled[0.8, 0.8]],
Text[Style["Region 2", 20, Orange], Scaled[0.2, 0.2]]
]
]
Done. Have fun!
Maybe a bit more "authomatic":Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
add a comment |Â
up vote
2
down vote
labels = Style[#, 20] & /@ "Region 1", "Region 2";
colors = ColorData[97] /@ 1, 2;
positions = 7, 7 / 10, 1, 1 / 4;
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8,
x, -4, 4, y, -4, 4,
PlotLegends -> ( Placed[Style@##2, #] & @@@ Transpose[positions, labels, colors])]
1
Nice answer, first time I've ever seen##n
used.
– N.J.Evans
9 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Try this:
Show[
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 ==
8, x, -4, 4, y, -4, 4, ContourStyle -> Blue, Orange],
Graphics[Text[Style["Region 1", 20, Blue], Scaled[0.8, 0.8]],
Text[Style["Region 2", 20, Orange], Scaled[0.2, 0.2]]
]
]
Done. Have fun!
Maybe a bit more "authomatic":Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
add a comment |Â
up vote
3
down vote
accepted
Try this:
Show[
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 ==
8, x, -4, 4, y, -4, 4, ContourStyle -> Blue, Orange],
Graphics[Text[Style["Region 1", 20, Blue], Scaled[0.8, 0.8]],
Text[Style["Region 2", 20, Orange], Scaled[0.2, 0.2]]
]
]
Done. Have fun!
Maybe a bit more "authomatic":Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Try this:
Show[
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 ==
8, x, -4, 4, y, -4, 4, ContourStyle -> Blue, Orange],
Graphics[Text[Style["Region 1", 20, Blue], Scaled[0.8, 0.8]],
Text[Style["Region 2", 20, Orange], Scaled[0.2, 0.2]]
]
]
Done. Have fun!
Try this:
Show[
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 ==
8, x, -4, 4, y, -4, 4, ContourStyle -> Blue, Orange],
Graphics[Text[Style["Region 1", 20, Blue], Scaled[0.8, 0.8]],
Text[Style["Region 2", 20, Orange], Scaled[0.2, 0.2]]
]
]
Done. Have fun!
answered 5 hours ago


Alexei Boulbitch
20.8k2369
20.8k2369
Maybe a bit more "authomatic":Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
add a comment |Â
Maybe a bit more "authomatic":Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
Maybe a bit more "authomatic":
Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
Maybe a bit more "authomatic":
Show[ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, x, -4, 4, y, -4, 4, ContourStyle -> Blue, PlotLegends -> Placed["Region 1", Right, Top]], ContourPlot[(x + 2)^3 + (y + 2)^3 == 8, x, -4, 4, y, -4, 4, ContourStyle -> Orange, PlotLegends -> Placed["Region 2", Left, Bottom]]]
– b.gatessucks
5 hours ago
add a comment |Â
up vote
2
down vote
labels = Style[#, 20] & /@ "Region 1", "Region 2";
colors = ColorData[97] /@ 1, 2;
positions = 7, 7 / 10, 1, 1 / 4;
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8,
x, -4, 4, y, -4, 4,
PlotLegends -> ( Placed[Style@##2, #] & @@@ Transpose[positions, labels, colors])]
1
Nice answer, first time I've ever seen##n
used.
– N.J.Evans
9 mins ago
add a comment |Â
up vote
2
down vote
labels = Style[#, 20] & /@ "Region 1", "Region 2";
colors = ColorData[97] /@ 1, 2;
positions = 7, 7 / 10, 1, 1 / 4;
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8,
x, -4, 4, y, -4, 4,
PlotLegends -> ( Placed[Style@##2, #] & @@@ Transpose[positions, labels, colors])]
1
Nice answer, first time I've ever seen##n
used.
– N.J.Evans
9 mins ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
labels = Style[#, 20] & /@ "Region 1", "Region 2";
colors = ColorData[97] /@ 1, 2;
positions = 7, 7 / 10, 1, 1 / 4;
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8,
x, -4, 4, y, -4, 4,
PlotLegends -> ( Placed[Style@##2, #] & @@@ Transpose[positions, labels, colors])]
labels = Style[#, 20] & /@ "Region 1", "Region 2";
colors = ColorData[97] /@ 1, 2;
positions = 7, 7 / 10, 1, 1 / 4;
ContourPlot[(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8,
x, -4, 4, y, -4, 4,
PlotLegends -> ( Placed[Style@##2, #] & @@@ Transpose[positions, labels, colors])]
answered 12 mins ago
kglr
169k8192395
169k8192395
1
Nice answer, first time I've ever seen##n
used.
– N.J.Evans
9 mins ago
add a comment |Â
1
Nice answer, first time I've ever seen##n
used.
– N.J.Evans
9 mins ago
1
1
Nice answer, first time I've ever seen
##n
used.– N.J.Evans
9 mins ago
Nice answer, first time I've ever seen
##n
used.– N.J.Evans
9 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185071%2fhow-to-align-the-plot-legends-in-the-following-way%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password