How create a general legend which always remain on top of the plotIncreasing the thickness of line in plot...
Why is there no logical not operator (!!) in C-style languages?
Is the text of all UK treaties and laws public?
Are great composers almost always prodigious performers?
Why does allocating a single 2D array take longer than a loop allocating multiple 1D arrays of the same total size and shape?
universal string conversion
False Shadow of an Orb
What are the rules for punctuating a conversation?
Difference between $HOME and ~
Without exposing his identity, did Roy help his parents with money so that they can afford to stay in their home?
tikz declare function with multiple outputs
Injection from two strings to one string
How to discipline overeager engineer
Should I reveal productivity tricks to peers, or keep them to myself in order to be more productive than the others?
I pay for a service, but I miss the broadcast
Coffee Grounds and Gritty Butter Cream Icing
D&D Monsters and Copyright
Why didn't Trudy wear a breathing mask in Avatar?
I am confused with the word order when putting a sentence into passé composé with reflexive verbs
How do lasers measure short distances (<1cm) when electronics are too slow for time-of-flight to work?
Was Wayne Brady considered a guest star on the original "Whose Line Is It Anyway?"
This fell out of my toilet when I unscrewed the supply line. What is it?
How do I know how many sub-shells deep I am?
How are steel imports supposed to threaten US national security?
What is the next number in the series: 21, 21, 23, 20, 5, 25, 31, 24,?
How create a general legend which always remain on top of the plot
Increasing the thickness of line in plot legendMesh inside Plot legendPlotting: DensityPlot produces artifactsCreate a colorbar plot legendPlace legend without border above the plotLegend Matrix PlotHow to create a bar legend of a contour plot that contains labels of the extreme values?How to make plots 'blacker'?Make Plot Legend WiderLegend Missing In The Plot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}
.everyonelovesstackoverflow{position:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;}
$begingroup$
I am writing a small report, wherein I have several plots, some plots are on a linear-linear scale, some are in log-linear scale, some in log-log. The problem I am facing is every time I change my scale it is becoming very difficult for me to adjust the legend. right now I am customized my legend using line command and circle command of graphics. Is there any way to fix this suppose my plot image size is 1500 (which is fixed for all of my plots), with respect to this can I set my legends.
. I don't have a
style1 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{2, 7}]}
style2 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{8, 20}]}
style3 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{4, 18, 40}]}
p1 = Plot[Sin[π*x], {x, 0, 1}, Evaluate@style1];
p2 = Plot[Sin[2 π*x], {x, 0, 1}, Evaluate@style2];
p3 = Plot[Sin[3 π*x], {x, 0, 1}, Evaluate@style3];
s1 = Graphics[{Thickness[0.004], AbsoluteDashing[{2, 7}],
Line[{{0, 14}, {1.5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (1)]),",
FontSize -> 30], {2.5, 14}]}];
s2 = Graphics[{Thickness[0.004], AbsoluteDashing[{8, 20}],
Line[{{3.5, 14}, {5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (2)]),",
FontSize -> 30], {6, 14}]}];
s3 = Graphics[{Thickness[0.004], AbsoluteDashing[{4, 18, 40}],
Line[{{7, 14}, {10, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (3)]),",
FontSize -> 30], {10.5, 14}]}];
Show[p1, p2, p3,s1,s2,s3, PlotRange -> All]
The above plot is on a linear-linear scale I looking trying to fix the general legend for all type of scale.
plotting legending
$endgroup$
add a comment
|
$begingroup$
I am writing a small report, wherein I have several plots, some plots are on a linear-linear scale, some are in log-linear scale, some in log-log. The problem I am facing is every time I change my scale it is becoming very difficult for me to adjust the legend. right now I am customized my legend using line command and circle command of graphics. Is there any way to fix this suppose my plot image size is 1500 (which is fixed for all of my plots), with respect to this can I set my legends.
. I don't have a
style1 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{2, 7}]}
style2 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{8, 20}]}
style3 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{4, 18, 40}]}
p1 = Plot[Sin[π*x], {x, 0, 1}, Evaluate@style1];
p2 = Plot[Sin[2 π*x], {x, 0, 1}, Evaluate@style2];
p3 = Plot[Sin[3 π*x], {x, 0, 1}, Evaluate@style3];
s1 = Graphics[{Thickness[0.004], AbsoluteDashing[{2, 7}],
Line[{{0, 14}, {1.5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (1)]),",
FontSize -> 30], {2.5, 14}]}];
s2 = Graphics[{Thickness[0.004], AbsoluteDashing[{8, 20}],
Line[{{3.5, 14}, {5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (2)]),",
FontSize -> 30], {6, 14}]}];
s3 = Graphics[{Thickness[0.004], AbsoluteDashing[{4, 18, 40}],
Line[{{7, 14}, {10, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (3)]),",
FontSize -> 30], {10.5, 14}]}];
Show[p1, p2, p3,s1,s2,s3, PlotRange -> All]
The above plot is on a linear-linear scale I looking trying to fix the general legend for all type of scale.
plotting legending
$endgroup$
$begingroup$
Please add the code you're using to generate the legend. Otherwise, it is impossible for anyone to tell what's the problem with your legend
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Can we use the above code as a reference code, because it is pretty big.
$endgroup$
– acoustics
9 hours ago
1
$begingroup$
I'm not asking for the full code with actual data (in fact, the example you have is much better) - but since your example image has a legend, and you are asking about how to position legends, it would help a lot if you could add the code you're currently using to create and position the legend. Even better would be if you could add the legend to the example above, and add a second example with e.g. log-log scaling and a legend that shows how the legend is no longer working in that case
$endgroup$
– Lukas Lang
9 hours ago
add a comment
|
$begingroup$
I am writing a small report, wherein I have several plots, some plots are on a linear-linear scale, some are in log-linear scale, some in log-log. The problem I am facing is every time I change my scale it is becoming very difficult for me to adjust the legend. right now I am customized my legend using line command and circle command of graphics. Is there any way to fix this suppose my plot image size is 1500 (which is fixed for all of my plots), with respect to this can I set my legends.
. I don't have a
style1 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{2, 7}]}
style2 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{8, 20}]}
style3 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{4, 18, 40}]}
p1 = Plot[Sin[π*x], {x, 0, 1}, Evaluate@style1];
p2 = Plot[Sin[2 π*x], {x, 0, 1}, Evaluate@style2];
p3 = Plot[Sin[3 π*x], {x, 0, 1}, Evaluate@style3];
s1 = Graphics[{Thickness[0.004], AbsoluteDashing[{2, 7}],
Line[{{0, 14}, {1.5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (1)]),",
FontSize -> 30], {2.5, 14}]}];
s2 = Graphics[{Thickness[0.004], AbsoluteDashing[{8, 20}],
Line[{{3.5, 14}, {5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (2)]),",
FontSize -> 30], {6, 14}]}];
s3 = Graphics[{Thickness[0.004], AbsoluteDashing[{4, 18, 40}],
Line[{{7, 14}, {10, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (3)]),",
FontSize -> 30], {10.5, 14}]}];
Show[p1, p2, p3,s1,s2,s3, PlotRange -> All]
The above plot is on a linear-linear scale I looking trying to fix the general legend for all type of scale.
plotting legending
$endgroup$
I am writing a small report, wherein I have several plots, some plots are on a linear-linear scale, some are in log-linear scale, some in log-log. The problem I am facing is every time I change my scale it is becoming very difficult for me to adjust the legend. right now I am customized my legend using line command and circle command of graphics. Is there any way to fix this suppose my plot image size is 1500 (which is fixed for all of my plots), with respect to this can I set my legends.
. I don't have a
style1 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{2, 7}]}
style2 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{8, 20}]}
style3 = PlotStyle -> {Black, Thickness[0.004],
AbsoluteDashing[{4, 18, 40}]}
p1 = Plot[Sin[π*x], {x, 0, 1}, Evaluate@style1];
p2 = Plot[Sin[2 π*x], {x, 0, 1}, Evaluate@style2];
p3 = Plot[Sin[3 π*x], {x, 0, 1}, Evaluate@style3];
s1 = Graphics[{Thickness[0.004], AbsoluteDashing[{2, 7}],
Line[{{0, 14}, {1.5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (1)]),",
FontSize -> 30], {2.5, 14}]}];
s2 = Graphics[{Thickness[0.004], AbsoluteDashing[{8, 20}],
Line[{{3.5, 14}, {5, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (2)]),",
FontSize -> 30], {6, 14}]}];
s3 = Graphics[{Thickness[0.004], AbsoluteDashing[{4, 18, 40}],
Line[{{7, 14}, {10, 14}}],
Text[StyleForm["!(*SubscriptBox[(β), (3)]),",
FontSize -> 30], {10.5, 14}]}];
Show[p1, p2, p3,s1,s2,s3, PlotRange -> All]
The above plot is on a linear-linear scale I looking trying to fix the general legend for all type of scale.
plotting legending
plotting legending
edited 9 hours ago
acoustics
asked 10 hours ago
acousticsacoustics
6141 silver badge10 bronze badges
6141 silver badge10 bronze badges
$begingroup$
Please add the code you're using to generate the legend. Otherwise, it is impossible for anyone to tell what's the problem with your legend
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Can we use the above code as a reference code, because it is pretty big.
$endgroup$
– acoustics
9 hours ago
1
$begingroup$
I'm not asking for the full code with actual data (in fact, the example you have is much better) - but since your example image has a legend, and you are asking about how to position legends, it would help a lot if you could add the code you're currently using to create and position the legend. Even better would be if you could add the legend to the example above, and add a second example with e.g. log-log scaling and a legend that shows how the legend is no longer working in that case
$endgroup$
– Lukas Lang
9 hours ago
add a comment
|
$begingroup$
Please add the code you're using to generate the legend. Otherwise, it is impossible for anyone to tell what's the problem with your legend
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Can we use the above code as a reference code, because it is pretty big.
$endgroup$
– acoustics
9 hours ago
1
$begingroup$
I'm not asking for the full code with actual data (in fact, the example you have is much better) - but since your example image has a legend, and you are asking about how to position legends, it would help a lot if you could add the code you're currently using to create and position the legend. Even better would be if you could add the legend to the example above, and add a second example with e.g. log-log scaling and a legend that shows how the legend is no longer working in that case
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Please add the code you're using to generate the legend. Otherwise, it is impossible for anyone to tell what's the problem with your legend
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Please add the code you're using to generate the legend. Otherwise, it is impossible for anyone to tell what's the problem with your legend
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Can we use the above code as a reference code, because it is pretty big.
$endgroup$
– acoustics
9 hours ago
$begingroup$
Can we use the above code as a reference code, because it is pretty big.
$endgroup$
– acoustics
9 hours ago
1
1
$begingroup$
I'm not asking for the full code with actual data (in fact, the example you have is much better) - but since your example image has a legend, and you are asking about how to position legends, it would help a lot if you could add the code you're currently using to create and position the legend. Even better would be if you could add the legend to the example above, and add a second example with e.g. log-log scaling and a legend that shows how the legend is no longer working in that case
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
I'm not asking for the full code with actual data (in fact, the example you have is much better) - but since your example image has a legend, and you are asking about how to position legends, it would help a lot if you could add the code you're currently using to create and position the legend. Even better would be if you could add the legend to the example above, and add a second example with e.g. log-log scaling and a legend that shows how the legend is no longer working in that case
$endgroup$
– Lukas Lang
9 hours ago
add a comment
|
1 Answer
1
active
oldest
votes
$begingroup$
Create a legend using your style1, style2, style3:
legend = LineLegend[Directive[#2] & @@@ {style1, style2, style3},
Subscript[β, #] & /@ Range[3], LegendLayout -> {"Row", 1}, LegendMarkerSize -> 60];
and use it as Epilog in Show controlling the position with the second argument of Inset:
Show[p1, p2, p3, PlotRange -> All, PlotRangePadding -> Scaled[.07],
Epilog -> Inset[legend, {.5, 1.1}]]

or place it Above the plot using Legended:
Legended[Show[p1, p2, p3, PlotRange -> All], Placed[legend, Above]]

$endgroup$
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
@acoustics, both should work. Try, for example,Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can useLogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].
$endgroup$
– kglr
7 hours ago
add a comment
|
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207113%2fhow-create-a-general-legend-which-always-remain-on-top-of-the-plot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Create a legend using your style1, style2, style3:
legend = LineLegend[Directive[#2] & @@@ {style1, style2, style3},
Subscript[β, #] & /@ Range[3], LegendLayout -> {"Row", 1}, LegendMarkerSize -> 60];
and use it as Epilog in Show controlling the position with the second argument of Inset:
Show[p1, p2, p3, PlotRange -> All, PlotRangePadding -> Scaled[.07],
Epilog -> Inset[legend, {.5, 1.1}]]

or place it Above the plot using Legended:
Legended[Show[p1, p2, p3, PlotRange -> All], Placed[legend, Above]]

$endgroup$
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
@acoustics, both should work. Try, for example,Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can useLogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].
$endgroup$
– kglr
7 hours ago
add a comment
|
$begingroup$
Create a legend using your style1, style2, style3:
legend = LineLegend[Directive[#2] & @@@ {style1, style2, style3},
Subscript[β, #] & /@ Range[3], LegendLayout -> {"Row", 1}, LegendMarkerSize -> 60];
and use it as Epilog in Show controlling the position with the second argument of Inset:
Show[p1, p2, p3, PlotRange -> All, PlotRangePadding -> Scaled[.07],
Epilog -> Inset[legend, {.5, 1.1}]]

or place it Above the plot using Legended:
Legended[Show[p1, p2, p3, PlotRange -> All], Placed[legend, Above]]

$endgroup$
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
@acoustics, both should work. Try, for example,Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can useLogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].
$endgroup$
– kglr
7 hours ago
add a comment
|
$begingroup$
Create a legend using your style1, style2, style3:
legend = LineLegend[Directive[#2] & @@@ {style1, style2, style3},
Subscript[β, #] & /@ Range[3], LegendLayout -> {"Row", 1}, LegendMarkerSize -> 60];
and use it as Epilog in Show controlling the position with the second argument of Inset:
Show[p1, p2, p3, PlotRange -> All, PlotRangePadding -> Scaled[.07],
Epilog -> Inset[legend, {.5, 1.1}]]

or place it Above the plot using Legended:
Legended[Show[p1, p2, p3, PlotRange -> All], Placed[legend, Above]]

$endgroup$
Create a legend using your style1, style2, style3:
legend = LineLegend[Directive[#2] & @@@ {style1, style2, style3},
Subscript[β, #] & /@ Range[3], LegendLayout -> {"Row", 1}, LegendMarkerSize -> 60];
and use it as Epilog in Show controlling the position with the second argument of Inset:
Show[p1, p2, p3, PlotRange -> All, PlotRangePadding -> Scaled[.07],
Epilog -> Inset[legend, {.5, 1.1}]]

or place it Above the plot using Legended:
Legended[Show[p1, p2, p3, PlotRange -> All], Placed[legend, Above]]

edited 9 hours ago
answered 9 hours ago
kglrkglr
219k10 gold badges250 silver badges503 bronze badges
219k10 gold badges250 silver badges503 bronze badges
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
@acoustics, both should work. Try, for example,Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can useLogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].
$endgroup$
– kglr
7 hours ago
add a comment
|
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
@acoustics, both should work. Try, for example,Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can useLogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].
$endgroup$
– kglr
7 hours ago
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
Does it work for Log-Linear scale, because last time I am trying to put , It was not adjusted properly.
$endgroup$
– acoustics
8 hours ago
$begingroup$
@acoustics, both should work. Try, for example,
Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can use LogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].$endgroup$
– kglr
7 hours ago
$begingroup$
@acoustics, both should work. Try, for example,
Legended[LogLinearPlot[Tanh[x], {x, 1, 100}], Placed[legend, {.5, 1}]]. For the first approach, you can use LogLinearPlot[Tanh[x], {x, 1, 100}, Epilog -> Inset[legend, Scaled@{.5, 1}]].$endgroup$
– kglr
7 hours ago
add a comment
|
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207113%2fhow-create-a-general-legend-which-always-remain-on-top-of-the-plot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Please add the code you're using to generate the legend. Otherwise, it is impossible for anyone to tell what's the problem with your legend
$endgroup$
– Lukas Lang
9 hours ago
$begingroup$
Can we use the above code as a reference code, because it is pretty big.
$endgroup$
– acoustics
9 hours ago
1
$begingroup$
I'm not asking for the full code with actual data (in fact, the example you have is much better) - but since your example image has a legend, and you are asking about how to position legends, it would help a lot if you could add the code you're currently using to create and position the legend. Even better would be if you could add the legend to the example above, and add a second example with e.g. log-log scaling and a legend that shows how the legend is no longer working in that case
$endgroup$
– Lukas Lang
9 hours ago