Unaligned Subfigures blocking each other
up vote
2
down vote
favorite
I have the following piecharts in two subfigures, however:
- One of them is blocking the legend as shown in the picture. Is there any workaround? I tried modifying
pgf-pie
(thanks Xu Yuan!)but to no avail. - Also, the two subfigures are not aligned horizontally even though I've added an extra command of
{b!}
Is it possible to have the smallest percentage visible by having a line drawn out (
text=pin
) alike since there's no space to label in the pie chart?
documentclass{scrbook}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{subcaption}
usepackage[dvipsnames]{xcolor}
usepackage{tikz}
usepackage{pgf-pie}
begin{document}
begin{figure*}[t!]
centering
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},text=legend,style={lines}]{60.8/Natural Gas,36.4/Petroleum,2.8/Others}
end{tikzpicture}
caption{2003}
end{subfigure}%
~
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},style={lines}]{95.15/,0.67/,4.18/}
end{tikzpicture}
caption{2017}
end{subfigure}
caption{Singapore's fuel mix for electricity generation}
end{figure*}
end{document}
Thank you in advanced!
align subfloats pgf-pie
|
show 3 more comments
up vote
2
down vote
favorite
I have the following piecharts in two subfigures, however:
- One of them is blocking the legend as shown in the picture. Is there any workaround? I tried modifying
pgf-pie
(thanks Xu Yuan!)but to no avail. - Also, the two subfigures are not aligned horizontally even though I've added an extra command of
{b!}
Is it possible to have the smallest percentage visible by having a line drawn out (
text=pin
) alike since there's no space to label in the pie chart?
documentclass{scrbook}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{subcaption}
usepackage[dvipsnames]{xcolor}
usepackage{tikz}
usepackage{pgf-pie}
begin{document}
begin{figure*}[t!]
centering
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},text=legend,style={lines}]{60.8/Natural Gas,36.4/Petroleum,2.8/Others}
end{tikzpicture}
caption{2003}
end{subfigure}%
~
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},style={lines}]{95.15/,0.67/,4.18/}
end{tikzpicture}
caption{2017}
end{subfigure}
caption{Singapore's fuel mix for electricity generation}
end{figure*}
end{document}
Thank you in advanced!
align subfloats pgf-pie
1
If you adddraw (current bounding box.south west) rectangle (current bounding box.north east);
before the firstend{tikzpicture}
, you will see that the picture is wider than the space you give it withbegin{subfigure}[b!]{0.5textwidth}
. So either give the picture more space or make it smaller.
– marmot
Dec 2 at 23:22
Thanks for your reply @marmot, this might sound not too clever but --> do you mind letting me know how can i make the space for picture bigger?
– thesilencer
Dec 2 at 23:25
Some time ago I looked at the internal macros ofpgf-pie
, and came up with a very rusty method to add pins:tex.stackexchange.com/a/451154/121799. I am definitely not claiming it is elegant, but that was the best I could come up with at that time. This does not mean much, but may suggest that having these pins may require more than adding a key somewhere. And you could draw these two pies in one picture, and shift them against each other, and then add the captions in nodes to have the desired vertical and horizontal alignment.
– marmot
Dec 2 at 23:29
It would be better if you attach the figures you are trying to include, that way people can work on it.
– zyy
Dec 3 at 2:41
1
@zyy The figures are the piecharts included in my MWE.
– thesilencer
Dec 3 at 15:25
|
show 3 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have the following piecharts in two subfigures, however:
- One of them is blocking the legend as shown in the picture. Is there any workaround? I tried modifying
pgf-pie
(thanks Xu Yuan!)but to no avail. - Also, the two subfigures are not aligned horizontally even though I've added an extra command of
{b!}
Is it possible to have the smallest percentage visible by having a line drawn out (
text=pin
) alike since there's no space to label in the pie chart?
documentclass{scrbook}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{subcaption}
usepackage[dvipsnames]{xcolor}
usepackage{tikz}
usepackage{pgf-pie}
begin{document}
begin{figure*}[t!]
centering
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},text=legend,style={lines}]{60.8/Natural Gas,36.4/Petroleum,2.8/Others}
end{tikzpicture}
caption{2003}
end{subfigure}%
~
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},style={lines}]{95.15/,0.67/,4.18/}
end{tikzpicture}
caption{2017}
end{subfigure}
caption{Singapore's fuel mix for electricity generation}
end{figure*}
end{document}
Thank you in advanced!
align subfloats pgf-pie
I have the following piecharts in two subfigures, however:
- One of them is blocking the legend as shown in the picture. Is there any workaround? I tried modifying
pgf-pie
(thanks Xu Yuan!)but to no avail. - Also, the two subfigures are not aligned horizontally even though I've added an extra command of
{b!}
Is it possible to have the smallest percentage visible by having a line drawn out (
text=pin
) alike since there's no space to label in the pie chart?
documentclass{scrbook}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{subcaption}
usepackage[dvipsnames]{xcolor}
usepackage{tikz}
usepackage{pgf-pie}
begin{document}
begin{figure*}[t!]
centering
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},text=legend,style={lines}]{60.8/Natural Gas,36.4/Petroleum,2.8/Others}
end{tikzpicture}
caption{2003}
end{subfigure}%
~
begin{subfigure}[b!]{0.5textwidth}
begin{tikzpicture}
tikzset{lines/.style={draw=white},}
pie[color={Orchid, GreenYellow, BurntOrange},sum=auto, after number=%,every only number node/.style={text=black},style={lines}]{95.15/,0.67/,4.18/}
end{tikzpicture}
caption{2017}
end{subfigure}
caption{Singapore's fuel mix for electricity generation}
end{figure*}
end{document}
Thank you in advanced!
align subfloats pgf-pie
align subfloats pgf-pie
asked Dec 2 at 23:12
thesilencer
1187
1187
1
If you adddraw (current bounding box.south west) rectangle (current bounding box.north east);
before the firstend{tikzpicture}
, you will see that the picture is wider than the space you give it withbegin{subfigure}[b!]{0.5textwidth}
. So either give the picture more space or make it smaller.
– marmot
Dec 2 at 23:22
Thanks for your reply @marmot, this might sound not too clever but --> do you mind letting me know how can i make the space for picture bigger?
– thesilencer
Dec 2 at 23:25
Some time ago I looked at the internal macros ofpgf-pie
, and came up with a very rusty method to add pins:tex.stackexchange.com/a/451154/121799. I am definitely not claiming it is elegant, but that was the best I could come up with at that time. This does not mean much, but may suggest that having these pins may require more than adding a key somewhere. And you could draw these two pies in one picture, and shift them against each other, and then add the captions in nodes to have the desired vertical and horizontal alignment.
– marmot
Dec 2 at 23:29
It would be better if you attach the figures you are trying to include, that way people can work on it.
– zyy
Dec 3 at 2:41
1
@zyy The figures are the piecharts included in my MWE.
– thesilencer
Dec 3 at 15:25
|
show 3 more comments
1
If you adddraw (current bounding box.south west) rectangle (current bounding box.north east);
before the firstend{tikzpicture}
, you will see that the picture is wider than the space you give it withbegin{subfigure}[b!]{0.5textwidth}
. So either give the picture more space or make it smaller.
– marmot
Dec 2 at 23:22
Thanks for your reply @marmot, this might sound not too clever but --> do you mind letting me know how can i make the space for picture bigger?
– thesilencer
Dec 2 at 23:25
Some time ago I looked at the internal macros ofpgf-pie
, and came up with a very rusty method to add pins:tex.stackexchange.com/a/451154/121799. I am definitely not claiming it is elegant, but that was the best I could come up with at that time. This does not mean much, but may suggest that having these pins may require more than adding a key somewhere. And you could draw these two pies in one picture, and shift them against each other, and then add the captions in nodes to have the desired vertical and horizontal alignment.
– marmot
Dec 2 at 23:29
It would be better if you attach the figures you are trying to include, that way people can work on it.
– zyy
Dec 3 at 2:41
1
@zyy The figures are the piecharts included in my MWE.
– thesilencer
Dec 3 at 15:25
1
1
If you add
draw (current bounding box.south west) rectangle (current bounding box.north east);
before the first end{tikzpicture}
, you will see that the picture is wider than the space you give it with begin{subfigure}[b!]{0.5textwidth}
. So either give the picture more space or make it smaller.– marmot
Dec 2 at 23:22
If you add
draw (current bounding box.south west) rectangle (current bounding box.north east);
before the first end{tikzpicture}
, you will see that the picture is wider than the space you give it with begin{subfigure}[b!]{0.5textwidth}
. So either give the picture more space or make it smaller.– marmot
Dec 2 at 23:22
Thanks for your reply @marmot, this might sound not too clever but --> do you mind letting me know how can i make the space for picture bigger?
– thesilencer
Dec 2 at 23:25
Thanks for your reply @marmot, this might sound not too clever but --> do you mind letting me know how can i make the space for picture bigger?
– thesilencer
Dec 2 at 23:25
Some time ago I looked at the internal macros of
pgf-pie
, and came up with a very rusty method to add pins:tex.stackexchange.com/a/451154/121799. I am definitely not claiming it is elegant, but that was the best I could come up with at that time. This does not mean much, but may suggest that having these pins may require more than adding a key somewhere. And you could draw these two pies in one picture, and shift them against each other, and then add the captions in nodes to have the desired vertical and horizontal alignment.– marmot
Dec 2 at 23:29
Some time ago I looked at the internal macros of
pgf-pie
, and came up with a very rusty method to add pins:tex.stackexchange.com/a/451154/121799. I am definitely not claiming it is elegant, but that was the best I could come up with at that time. This does not mean much, but may suggest that having these pins may require more than adding a key somewhere. And you could draw these two pies in one picture, and shift them against each other, and then add the captions in nodes to have the desired vertical and horizontal alignment.– marmot
Dec 2 at 23:29
It would be better if you attach the figures you are trying to include, that way people can work on it.
– zyy
Dec 3 at 2:41
It would be better if you attach the figures you are trying to include, that way people can work on it.
– zyy
Dec 3 at 2:41
1
1
@zyy The figures are the piecharts included in my MWE.
– thesilencer
Dec 3 at 15:25
@zyy The figures are the piecharts included in my MWE.
– thesilencer
Dec 3 at 15:25
|
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f462876%2funaligned-subfigures-blocking-each-other%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
1
If you add
draw (current bounding box.south west) rectangle (current bounding box.north east);
before the firstend{tikzpicture}
, you will see that the picture is wider than the space you give it withbegin{subfigure}[b!]{0.5textwidth}
. So either give the picture more space or make it smaller.– marmot
Dec 2 at 23:22
Thanks for your reply @marmot, this might sound not too clever but --> do you mind letting me know how can i make the space for picture bigger?
– thesilencer
Dec 2 at 23:25
Some time ago I looked at the internal macros of
pgf-pie
, and came up with a very rusty method to add pins:tex.stackexchange.com/a/451154/121799. I am definitely not claiming it is elegant, but that was the best I could come up with at that time. This does not mean much, but may suggest that having these pins may require more than adding a key somewhere. And you could draw these two pies in one picture, and shift them against each other, and then add the captions in nodes to have the desired vertical and horizontal alignment.– marmot
Dec 2 at 23:29
It would be better if you attach the figures you are trying to include, that way people can work on it.
– zyy
Dec 3 at 2:41
1
@zyy The figures are the piecharts included in my MWE.
– thesilencer
Dec 3 at 15:25