Weird diagonal under legends with Tikzpicturenode command while defining a coordinate in TikZplotting two...

Doomsday-clock for my fantasy planet

Is Social Media Science Fiction?

Why do UK politicians seemingly ignore opinion polls on Brexit?

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

What does 'script /dev/null' do?

What to wear for invited talk in Canada

"My colleague's body is amazing"

Patience, young "Padovan"

Is there any use for defining additional entity types in a SOQL FROM clause?

Is there a familial term for apples and pears?

Why airport relocation isn't done gradually?

Email Account under attack (really) - anything I can do?

Does a dangling wire really electrocute me if I'm standing in water?

Are cabin dividers used to "hide" the flex of the airplane?

Is this food a bread or a loaf?

Pristine Bit Checking

What is the offset in a seaplane's hull?

What is it called when one voice type sings a 'solo'?

Domain expired, GoDaddy holds it and is asking more money

Can I legally use front facing blue light in the UK?

What is GPS' 19 year rollover and does it present a cybersecurity issue?

Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?

COUNT(*) or MAX(id) - which is faster?

Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore



Weird diagonal under legends with Tikzpicture


node command while defining a coordinate in TikZplotting two time series with boundsGrouped bar chartHow do i get the x axis on top but keep a line on the bottomPolar Plots - layout and extraction of crucial parametersAdding legends to tikzpictureHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate origin













0















My code for tikzpicture:



begin{tikzpicture} [domain=0:4]
begin{axis}[ axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot [ fill=red, opacity=.4, domain=1:6, samples=100, color=red, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$D(lambda)$}
addplot [ fill=blue, opacity=.4, domain=1:6, samples=100, color=blue, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$f(lambda)$}

addplot [ domain=1:6, fill=yellow!25, opacity=.4, samples=100, color=green, thick, mark=none ] {sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}


is giving a weird diagonal at right:



enter image description here



Why is it happening? How could I obtain a straight line under the legends?










share|improve this question

























  • (1) welcome, (2) in order for us to help you please expand your sniplet to a full (but minimal) example, that we can copy and use as is in order for get the image you posted.

    – daleif
    19 hours ago











  • Besides how is this question related to LyX?

    – daleif
    19 hours ago











  • I am compiling with Lyx. I mentioned just for help.

    – gibarian
    19 hours ago











  • The effect comes from -- (axis cs:0,40), which is very high up but not above the end point of the plot.

    – marmot
    19 hours ago
















0















My code for tikzpicture:



begin{tikzpicture} [domain=0:4]
begin{axis}[ axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot [ fill=red, opacity=.4, domain=1:6, samples=100, color=red, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$D(lambda)$}
addplot [ fill=blue, opacity=.4, domain=1:6, samples=100, color=blue, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$f(lambda)$}

addplot [ domain=1:6, fill=yellow!25, opacity=.4, samples=100, color=green, thick, mark=none ] {sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}


is giving a weird diagonal at right:



enter image description here



Why is it happening? How could I obtain a straight line under the legends?










share|improve this question

























  • (1) welcome, (2) in order for us to help you please expand your sniplet to a full (but minimal) example, that we can copy and use as is in order for get the image you posted.

    – daleif
    19 hours ago











  • Besides how is this question related to LyX?

    – daleif
    19 hours ago











  • I am compiling with Lyx. I mentioned just for help.

    – gibarian
    19 hours ago











  • The effect comes from -- (axis cs:0,40), which is very high up but not above the end point of the plot.

    – marmot
    19 hours ago














0












0








0








My code for tikzpicture:



begin{tikzpicture} [domain=0:4]
begin{axis}[ axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot [ fill=red, opacity=.4, domain=1:6, samples=100, color=red, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$D(lambda)$}
addplot [ fill=blue, opacity=.4, domain=1:6, samples=100, color=blue, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$f(lambda)$}

addplot [ domain=1:6, fill=yellow!25, opacity=.4, samples=100, color=green, thick, mark=none ] {sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}


is giving a weird diagonal at right:



enter image description here



Why is it happening? How could I obtain a straight line under the legends?










share|improve this question
















My code for tikzpicture:



begin{tikzpicture} [domain=0:4]
begin{axis}[ axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot [ fill=red, opacity=.4, domain=1:6, samples=100, color=red, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$D(lambda)$}
addplot [ fill=blue, opacity=.4, domain=1:6, samples=100, color=blue, thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))} -- (axis cs:0,40) closedcycle;
addlegendentry{$f(lambda)$}

addplot [ domain=1:6, fill=yellow!25, opacity=.4, samples=100, color=green, thick, mark=none ] {sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}


is giving a weird diagonal at right:



enter image description here



Why is it happening? How could I obtain a straight line under the legends?







pgfplots






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 19 hours ago









JouleV

11.7k22561




11.7k22561










asked 19 hours ago









gibariangibarian

32




32













  • (1) welcome, (2) in order for us to help you please expand your sniplet to a full (but minimal) example, that we can copy and use as is in order for get the image you posted.

    – daleif
    19 hours ago











  • Besides how is this question related to LyX?

    – daleif
    19 hours ago











  • I am compiling with Lyx. I mentioned just for help.

    – gibarian
    19 hours ago











  • The effect comes from -- (axis cs:0,40), which is very high up but not above the end point of the plot.

    – marmot
    19 hours ago



















  • (1) welcome, (2) in order for us to help you please expand your sniplet to a full (but minimal) example, that we can copy and use as is in order for get the image you posted.

    – daleif
    19 hours ago











  • Besides how is this question related to LyX?

    – daleif
    19 hours ago











  • I am compiling with Lyx. I mentioned just for help.

    – gibarian
    19 hours ago











  • The effect comes from -- (axis cs:0,40), which is very high up but not above the end point of the plot.

    – marmot
    19 hours ago

















(1) welcome, (2) in order for us to help you please expand your sniplet to a full (but minimal) example, that we can copy and use as is in order for get the image you posted.

– daleif
19 hours ago





(1) welcome, (2) in order for us to help you please expand your sniplet to a full (but minimal) example, that we can copy and use as is in order for get the image you posted.

– daleif
19 hours ago













Besides how is this question related to LyX?

– daleif
19 hours ago





Besides how is this question related to LyX?

– daleif
19 hours ago













I am compiling with Lyx. I mentioned just for help.

– gibarian
19 hours ago





I am compiling with Lyx. I mentioned just for help.

– gibarian
19 hours ago













The effect comes from -- (axis cs:0,40), which is very high up but not above the end point of the plot.

– marmot
19 hours ago





The effect comes from -- (axis cs:0,40), which is very high up but not above the end point of the plot.

– marmot
19 hours ago










1 Answer
1






active

oldest

votes


















1














The effect comes from -- (axis cs:0,40), which is very high up but not vertically above the end point of the plot. This is one way to get a vertical line.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
begin{document}
begin{tikzpicture} [domain=0:4]
begin{axis}[axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot[fill=red, opacity=.4,domain=1:6, samples=100,color=red,
thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))}
coordinate[pos=0] (aux0) |- (aux0)
closedcycle;
addlegendentry{$D(lambda)$}
addplot[fill=blue, opacity=.4,domain=1:6,samples=100,color=blue,
thick, mark=none] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))}
|- (aux0)closedcycle;
addlegendentry{$f(lambda)$}

addplot[domain=3.2:6, fill=yellow!25,
opacity=.4, samples=100, color=green, thick, mark=none ]
{sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

    – daleif
    19 hours ago











  • @daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

    – marmot
    14 hours ago












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
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/3.0/"u003ecc by-sa 3.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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483757%2fweird-diagonal-under-legends-with-tikzpicture%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









1














The effect comes from -- (axis cs:0,40), which is very high up but not vertically above the end point of the plot. This is one way to get a vertical line.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
begin{document}
begin{tikzpicture} [domain=0:4]
begin{axis}[axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot[fill=red, opacity=.4,domain=1:6, samples=100,color=red,
thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))}
coordinate[pos=0] (aux0) |- (aux0)
closedcycle;
addlegendentry{$D(lambda)$}
addplot[fill=blue, opacity=.4,domain=1:6,samples=100,color=blue,
thick, mark=none] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))}
|- (aux0)closedcycle;
addlegendentry{$f(lambda)$}

addplot[domain=3.2:6, fill=yellow!25,
opacity=.4, samples=100, color=green, thick, mark=none ]
{sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

    – daleif
    19 hours ago











  • @daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

    – marmot
    14 hours ago
















1














The effect comes from -- (axis cs:0,40), which is very high up but not vertically above the end point of the plot. This is one way to get a vertical line.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
begin{document}
begin{tikzpicture} [domain=0:4]
begin{axis}[axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot[fill=red, opacity=.4,domain=1:6, samples=100,color=red,
thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))}
coordinate[pos=0] (aux0) |- (aux0)
closedcycle;
addlegendentry{$D(lambda)$}
addplot[fill=blue, opacity=.4,domain=1:6,samples=100,color=blue,
thick, mark=none] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))}
|- (aux0)closedcycle;
addlegendentry{$f(lambda)$}

addplot[domain=3.2:6, fill=yellow!25,
opacity=.4, samples=100, color=green, thick, mark=none ]
{sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

    – daleif
    19 hours ago











  • @daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

    – marmot
    14 hours ago














1












1








1







The effect comes from -- (axis cs:0,40), which is very high up but not vertically above the end point of the plot. This is one way to get a vertical line.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
begin{document}
begin{tikzpicture} [domain=0:4]
begin{axis}[axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot[fill=red, opacity=.4,domain=1:6, samples=100,color=red,
thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))}
coordinate[pos=0] (aux0) |- (aux0)
closedcycle;
addlegendentry{$D(lambda)$}
addplot[fill=blue, opacity=.4,domain=1:6,samples=100,color=blue,
thick, mark=none] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))}
|- (aux0)closedcycle;
addlegendentry{$f(lambda)$}

addplot[domain=3.2:6, fill=yellow!25,
opacity=.4, samples=100, color=green, thick, mark=none ]
{sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}
end{document}


enter image description here






share|improve this answer













The effect comes from -- (axis cs:0,40), which is very high up but not vertically above the end point of the plot. This is one way to get a vertical line.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
begin{document}
begin{tikzpicture} [domain=0:4]
begin{axis}[axis lines = left, xlabel = $lambda$, ylabel = {$x$}, ]
addplot[fill=red, opacity=.4,domain=1:6, samples=100,color=red,
thick, mark=none ] {sqrt((0.1*x^(8)+x^(6)+0.3*x^(2)+3)/(x^(8)))}
coordinate[pos=0] (aux0) |- (aux0)
closedcycle;
addlegendentry{$D(lambda)$}
addplot[fill=blue, opacity=.4,domain=1:6,samples=100,color=blue,
thick, mark=none] {sqrt((0.1*x^(8)+x^(6)/3+0.1*x^(2)+5/3)/(x^(8)))}
|- (aux0)closedcycle;
addlegendentry{$f(lambda)$}

addplot[domain=3.2:6, fill=yellow!25,
opacity=.4, samples=100, color=green, thick, mark=none ]
{sqrt((0.1*x^(8)-x^(6)-0.3*x^(2)-1)/(x^(8)))} closedcycle;

addlegendentry{$g(lambda)$}
end{axis}
end{tikzpicture}
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 19 hours ago









marmotmarmot

116k5147277




116k5147277













  • Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

    – daleif
    19 hours ago











  • @daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

    – marmot
    14 hours ago



















  • Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

    – daleif
    19 hours ago











  • @daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

    – marmot
    14 hours ago

















Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

– daleif
19 hours ago





Hmm, took me a while to understand the coordinate[pos=0] (aux0) |- (aux0), one might easily think that ` (aux0) |- (aux0)` is what is being evaluated.

– daleif
19 hours ago













@daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

– marmot
14 hours ago





@daleif Yes, this is TikZ syntax, and a similar question came up e.g. here.

– marmot
14 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX 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.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483757%2fweird-diagonal-under-legends-with-tikzpicture%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

Schneeberg (Smreczany) Bibliografia | Menu...

Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...