How to add two separate legends for two axes? Announcing the arrival of Valued Associate #679:...
Extract all GPU name, model and GPU ram
51k Euros annually for a family of 4 in Berlin: Is it enough?
Identifying polygons that intersect with another layer using QGIS?
How do I keep my slimes from escaping their pens?
List *all* the tuples!
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Can a non-EU citizen traveling with me come with me through the EU passport line?
Why aren't air breathing engines used as small first stages
Echoing a tail command produces unexpected output?
List of Python versions
How to bypass password on Windows XP account?
What does F' and F" mean?
Ring Automorphisms that fix 1.
porting install scripts : can rpm replace apt?
Can an alien society believe that their star system is the universe?
If a contract sometimes uses the wrong name, is it still valid?
What is the meaning of the new sigil in Game of Thrones Season 8 intro?
Apollo command module space walk?
Why did the rest of the Eastern Bloc not invade Yugoslavia?
Why light coming from distant stars is not discrete?
Why didn't this character "real die" when they blew their stack out in Altered Carbon?
How come Sam didn't become Lord of Horn Hill?
How to call a function with default parameter through a pointer to function that is the return of another function?
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
How to add two separate legends for two axes?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How can I use two x axes in pgfplots?Grouped bar chartLegends for scaled pgfplotsSpecifying different scales for the axespgfplots ignores “thick” option for axesexample: pgfplots groupplot with two x-axesHow to add multiple x axes with different scaling?How to add two waveforms in pgfplotsCenter the axes in the coordinate originHow to add two tables with PGFPlots?
I want to add two separate legends for two axes as the picture shows ().
However, my situation is a little more complicated. I have three entries that need to be labeled in the two legends -- one for the left axis and the other two for the right axis. Meanwhile, one of them has lines as background which should also be depicted in the (right) legend.
How to create such two separate legends. Specifically, the left legend is a blue rectangle followed by some words while the right legend contains two lines -- one is a red rectangle and the other is a red rectangle with dashed lines followed by some words.
usepackage{pgfplots}
pgfplotsset{compat=1.14}
usepackage{tikz}
usetikzlibrary{patterns}
begin{figure}[tb]
centering
hspace*{-0.2cm}
begin{tikzpicture}[font=footnotesize]
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=6,
bar shift=-5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-\item List},
x tick label style={align=center,font=scriptsize},
axis y line*=left,
/pgf/bar width=7pt,
]
addplot coordinates
{(Launch,4.25) (Options,4.5) (Text Input,3.25) (Text\Display,4) (Fixed-item\List,4.33) (Dynamic-\item List,5.25)};
end{axis}
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=25,
bar shift=5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-item\List},
xtick=empty,
axis y line*=right,
/pgf/bar width=7pt,
]
addplot +[
draw=red,fill=red!30!white,
postaction={pattern=north east lines}
] coordinates
{(Launch,4) (Options,5.5) (Text Input,3.75) (Text\Display,4) (Fixed-item\List,7.77) (Dynamic-item\List,4.5)};
addplot +[draw=red,fill=red!30!white] coordinates
{(Launch,9) (Options,6) (Text Input,8) (Text\Display,6.5) (Fixed-item\List,14.55) (Dynamic-item\List,5)};
end{axis}
end{tikzpicture}
end{figure}
pgfplots
New contributor
add a comment |
I want to add two separate legends for two axes as the picture shows ().
However, my situation is a little more complicated. I have three entries that need to be labeled in the two legends -- one for the left axis and the other two for the right axis. Meanwhile, one of them has lines as background which should also be depicted in the (right) legend.
How to create such two separate legends. Specifically, the left legend is a blue rectangle followed by some words while the right legend contains two lines -- one is a red rectangle and the other is a red rectangle with dashed lines followed by some words.
usepackage{pgfplots}
pgfplotsset{compat=1.14}
usepackage{tikz}
usetikzlibrary{patterns}
begin{figure}[tb]
centering
hspace*{-0.2cm}
begin{tikzpicture}[font=footnotesize]
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=6,
bar shift=-5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-\item List},
x tick label style={align=center,font=scriptsize},
axis y line*=left,
/pgf/bar width=7pt,
]
addplot coordinates
{(Launch,4.25) (Options,4.5) (Text Input,3.25) (Text\Display,4) (Fixed-item\List,4.33) (Dynamic-\item List,5.25)};
end{axis}
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=25,
bar shift=5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-item\List},
xtick=empty,
axis y line*=right,
/pgf/bar width=7pt,
]
addplot +[
draw=red,fill=red!30!white,
postaction={pattern=north east lines}
] coordinates
{(Launch,4) (Options,5.5) (Text Input,3.75) (Text\Display,4) (Fixed-item\List,7.77) (Dynamic-item\List,4.5)};
addplot +[draw=red,fill=red!30!white] coordinates
{(Launch,9) (Options,6) (Text Input,8) (Text\Display,6.5) (Fixed-item\List,14.55) (Dynamic-item\List,5)};
end{axis}
end{tikzpicture}
end{figure}
pgfplots
New contributor
add a comment |
I want to add two separate legends for two axes as the picture shows ().
However, my situation is a little more complicated. I have three entries that need to be labeled in the two legends -- one for the left axis and the other two for the right axis. Meanwhile, one of them has lines as background which should also be depicted in the (right) legend.
How to create such two separate legends. Specifically, the left legend is a blue rectangle followed by some words while the right legend contains two lines -- one is a red rectangle and the other is a red rectangle with dashed lines followed by some words.
usepackage{pgfplots}
pgfplotsset{compat=1.14}
usepackage{tikz}
usetikzlibrary{patterns}
begin{figure}[tb]
centering
hspace*{-0.2cm}
begin{tikzpicture}[font=footnotesize]
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=6,
bar shift=-5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-\item List},
x tick label style={align=center,font=scriptsize},
axis y line*=left,
/pgf/bar width=7pt,
]
addplot coordinates
{(Launch,4.25) (Options,4.5) (Text Input,3.25) (Text\Display,4) (Fixed-item\List,4.33) (Dynamic-\item List,5.25)};
end{axis}
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=25,
bar shift=5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-item\List},
xtick=empty,
axis y line*=right,
/pgf/bar width=7pt,
]
addplot +[
draw=red,fill=red!30!white,
postaction={pattern=north east lines}
] coordinates
{(Launch,4) (Options,5.5) (Text Input,3.75) (Text\Display,4) (Fixed-item\List,7.77) (Dynamic-item\List,4.5)};
addplot +[draw=red,fill=red!30!white] coordinates
{(Launch,9) (Options,6) (Text Input,8) (Text\Display,6.5) (Fixed-item\List,14.55) (Dynamic-item\List,5)};
end{axis}
end{tikzpicture}
end{figure}
pgfplots
New contributor
I want to add two separate legends for two axes as the picture shows ().
However, my situation is a little more complicated. I have three entries that need to be labeled in the two legends -- one for the left axis and the other two for the right axis. Meanwhile, one of them has lines as background which should also be depicted in the (right) legend.
How to create such two separate legends. Specifically, the left legend is a blue rectangle followed by some words while the right legend contains two lines -- one is a red rectangle and the other is a red rectangle with dashed lines followed by some words.
usepackage{pgfplots}
pgfplotsset{compat=1.14}
usepackage{tikz}
usetikzlibrary{patterns}
begin{figure}[tb]
centering
hspace*{-0.2cm}
begin{tikzpicture}[font=footnotesize]
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=6,
bar shift=-5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-\item List},
x tick label style={align=center,font=scriptsize},
axis y line*=left,
/pgf/bar width=7pt,
]
addplot coordinates
{(Launch,4.25) (Options,4.5) (Text Input,3.25) (Text\Display,4) (Fixed-item\List,4.33) (Dynamic-\item List,5.25)};
end{axis}
begin{axis}[ybar stacked,
height=4.5cm,width=9cm,
ymin=0,ymax=25,
bar shift=5.5pt,
symbolic x coords={Launch,Options,Text Input,Text\Display,Fixed-item\List,Dynamic-item\List},
xtick=empty,
axis y line*=right,
/pgf/bar width=7pt,
]
addplot +[
draw=red,fill=red!30!white,
postaction={pattern=north east lines}
] coordinates
{(Launch,4) (Options,5.5) (Text Input,3.75) (Text\Display,4) (Fixed-item\List,7.77) (Dynamic-item\List,4.5)};
addplot +[draw=red,fill=red!30!white] coordinates
{(Launch,9) (Options,6) (Text Input,8) (Text\Display,6.5) (Fixed-item\List,14.55) (Dynamic-item\List,5)};
end{axis}
end{tikzpicture}
end{figure}
pgfplots
pgfplots
New contributor
New contributor
New contributor
asked 5 mins ago
Sheffiled GESheffiled GE
12
12
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
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
});
}
});
Sheffiled GE is a new contributor. Be nice, and check out our Code of Conduct.
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%2ftex.stackexchange.com%2fquestions%2f485232%2fhow-to-add-two-separate-legends-for-two-axes%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sheffiled GE is a new contributor. Be nice, and check out our Code of Conduct.
Sheffiled GE is a new contributor. Be nice, and check out our Code of Conduct.
Sheffiled GE is a new contributor. Be nice, and check out our Code of Conduct.
Sheffiled GE is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2ftex.stackexchange.com%2fquestions%2f485232%2fhow-to-add-two-separate-legends-for-two-axes%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