Aligning group plot titles horizontallyGrouped bar chartbar width not recognized in group plotCentering group plot figureHow 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 plotPgfplots for every group plotSpy glasses in a group plotCenter the axes in the coordinate origin
Why is the marginal distribution/marginal probability described as "marginal"?
Could there be something like aerobatic smoke trails in the vacuum of space?
Does this "yield your space to an ally" rule my 3.5 group uses appear anywhere in the official rules?
Is a "local" version of 3-SAT NP-hard?
Testing if os.path.exists with ArcPy?
Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?
Which creature is depicted in this Xanathar's Guide illustration of a war mage?
Given 0s on Assignments with suspected and dismissed cheating?
How to not get blinded by an attack at dawn
How could it be that 80% of townspeople were farmers during the Edo period in Japan?
Six inch, clear plastic binary counting puzzle
Should I communicate in my applications that I'm unemployed out of choice rather than because nobody will have me?
Will consteval functions allow template parameters dependent on function arguments?
Polynomial division: Is this trick obvious?
Why did Varys remove his rings?
Do high-wing aircraft represent more difficult engineering challenges than low-wing aircraft?
Understanding Deutch's Algorithm
Are there microwaves to heat baby food at Brussels airport?
Can I say: "When was your train leaving?" if the train leaves in the future?
Assembly writer vs compiler in VLIW architecture
Why when I add jam to my tea it stops producing thin "membrane" on top?
Why does SSL Labs now consider CBC suites weak?
Do people who work at research institutes consider themselves "academics"?
Why can't I share a one use code with anyone else?
Aligning group plot titles horizontally
Grouped bar chartbar width not recognized in group plotCentering group plot figureHow 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 plotPgfplots for every group plotSpy glasses in a group plotCenter the axes in the coordinate origin
I'm trying to figure out why my plot titles are not horizontally aligned. I tried several sources but could not find an option to control title alignment. Below image is what I get. As you can see Kingsbury and Northcote are not on the same level.
This is my latex code
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
tikz-pgf pgfplots groupplots
add a comment |
I'm trying to figure out why my plot titles are not horizontally aligned. I tried several sources but could not find an option to control title alignment. Below image is what I get. As you can see Kingsbury and Northcote are not on the same level.
This is my latex code
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
tikz-pgf pgfplots groupplots
1
because the "Northop" hasnt leter "y". if you will addvphantomy
to it, words will become aligned as you like to have. however, you can definetitle
style in which you addtext depth=0.5ex
.
– Zarko
3 hours ago
add a comment |
I'm trying to figure out why my plot titles are not horizontally aligned. I tried several sources but could not find an option to control title alignment. Below image is what I get. As you can see Kingsbury and Northcote are not on the same level.
This is my latex code
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
tikz-pgf pgfplots groupplots
I'm trying to figure out why my plot titles are not horizontally aligned. I tried several sources but could not find an option to control title alignment. Below image is what I get. As you can see Kingsbury and Northcote are not on the same level.
This is my latex code
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
tikz-pgf pgfplots groupplots
tikz-pgf pgfplots groupplots
edited 2 hours ago
Niroshan
asked 3 hours ago
NiroshanNiroshan
2361310
2361310
1
because the "Northop" hasnt leter "y". if you will addvphantomy
to it, words will become aligned as you like to have. however, you can definetitle
style in which you addtext depth=0.5ex
.
– Zarko
3 hours ago
add a comment |
1
because the "Northop" hasnt leter "y". if you will addvphantomy
to it, words will become aligned as you like to have. however, you can definetitle
style in which you addtext depth=0.5ex
.
– Zarko
3 hours ago
1
1
because the "Northop" hasnt leter "y". if you will add
vphantomy
to it, words will become aligned as you like to have. however, you can define title
style in which you add text depth=0.5ex
.– Zarko
3 hours ago
because the "Northop" hasnt leter "y". if you will add
vphantomy
to it, words will become aligned as you like to have. however, you can define title
style in which you add text depth=0.5ex
.– Zarko
3 hours ago
add a comment |
3 Answers
3
active
oldest
votes
As I mentioned in my comment, change your groupplot
settings to:
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style = text depth=0.5ex % <--- added
]%
and you will get desired result:
add a comment |
You can add title style=text depth = 0pt
to your nextgroupplot[...]
options to both of the plots and you will have everything aligned horizontally.
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title style=text depth = 0pt, % NEED THIS!
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title style=text depth = 0pt, % NEED THIS!
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
add a comment |
An alternative to previous two answers is anchoring the title text to top (north) and adding some distance between the titles and the plots with title style=anchor=north, yshift=2ex
.
The reason for the problem is explained in Zarko's comment. That is why the title with "g" and "y" is higher than the other one. My solution is aligning the title text to top of the letters rather than to the bottom. But this cause the plot to overlap with the title. So we have to add some distance between them with yshift.
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style=anchor=north, yshift=2ex % <--- FIX
]%
add a comment |
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
);
);
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%2f490898%2faligning-group-plot-titles-horizontally%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
As I mentioned in my comment, change your groupplot
settings to:
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style = text depth=0.5ex % <--- added
]%
and you will get desired result:
add a comment |
As I mentioned in my comment, change your groupplot
settings to:
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style = text depth=0.5ex % <--- added
]%
and you will get desired result:
add a comment |
As I mentioned in my comment, change your groupplot
settings to:
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style = text depth=0.5ex % <--- added
]%
and you will get desired result:
As I mentioned in my comment, change your groupplot
settings to:
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style = text depth=0.5ex % <--- added
]%
and you will get desired result:
answered 3 hours ago
ZarkoZarko
134k872178
134k872178
add a comment |
add a comment |
You can add title style=text depth = 0pt
to your nextgroupplot[...]
options to both of the plots and you will have everything aligned horizontally.
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title style=text depth = 0pt, % NEED THIS!
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title style=text depth = 0pt, % NEED THIS!
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
add a comment |
You can add title style=text depth = 0pt
to your nextgroupplot[...]
options to both of the plots and you will have everything aligned horizontally.
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title style=text depth = 0pt, % NEED THIS!
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title style=text depth = 0pt, % NEED THIS!
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
add a comment |
You can add title style=text depth = 0pt
to your nextgroupplot[...]
options to both of the plots and you will have everything aligned horizontally.
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title style=text depth = 0pt, % NEED THIS!
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title style=text depth = 0pt, % NEED THIS!
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
You can add title style=text depth = 0pt
to your nextgroupplot[...]
options to both of the plots and you will have everything aligned horizontally.
documentclass[preview]standalone
usepackagefilecontents
usepackagepgfplots
usepackagetikz
usepgfplotslibrarygroupplots
pgfplotssetcompat=newest
usepackagecaption,subcaption
beginfilecontents*cossim.csv
SAE,Kingsbury large,Kingsbury very small,Northcote large,Northcote very small
0.01,0.999968942313215,0.999999495420309,0.99996093797435,0.999999519021115
0.02,0.999871138637117,0.999998360123856,0.999845179891564,0.999997875670629
0.03,0.999719561898977,0.999995711779553,0.999650464340874,0.999995691207506
0.04,0.999501451940394,0.999992937485087,0.999380356722573,0.999991943604557
0.05,0.999209403163912,0.99998965609147,0.999026294939076,0.999988236057768
0.06,0.998864174035993,0.999986379082264,0.998602080363523,0.999982264001694
0.07,0.998482447668418,0.999979693720795,0.998095945546854,0.999975630444692
endfilecontents*
begindocument
pgfplotsset
axis background/.style=fill=mygrey,
tick style=mygrey2,
tick label style=mygrey2,
grid=both,
ytick pos=left,
tick style=
major grid style=style=white,line width=1pt,
minor grid style=mygrey3,
tick align=outside,
,
commonstyle/.style=
draw=white,
mark=*,
,
midystyle/.style =
yticklabels=,,,
ytick style=draw=none,
ylabel = ,
,
midxstyle/.style =
xtick style=draw=none,
xlabel = ,
,
cossimstyle/.style =
ymin = 0.998,
,
definecolormygreyRGB229,229,229
definecolormygrey2RGB127,127,127
definecolormygrey3RGB240,240,240
definecolorcLargeRGB31,120,180
definecolorcVerySmallRGB253,191,111
begintikzpicture%
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
]%
%%%%% ROW1 Start %%%%%
nextgroupplot[%
commonstyle,
midxstyle,
cossimstyle,
legend to name=mainplot,%
legend style=legend columns=4,%
ylabel=Cosine similarity,%
title style=text depth = 0pt, % NEED THIS!
title=Kingsbury,
]%
addplot[color=cLarge] table [x=SAE, y=Kingsbury large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Kingsbury very small,
col sep=comma]cossim.csv;%
nextgroupplot[%
commonstyle,
midystyle,
midxstyle,
cossimstyle,
title style=text depth = 0pt, % NEED THIS!
title=Northcote,
]%
addplot[color=cLarge] table [x=SAE, y=Northcote large, col
sep=comma]cossim.csv;%
addplot[color=cVerySmall] table [x=SAE, y=Northcote very small,
col sep=comma]cossim.csv;%
endgroupplot
endtikzpicture
enddocument
answered 3 hours ago
M. Al JumailyM. Al Jumaily
1,0901210
1,0901210
add a comment |
add a comment |
An alternative to previous two answers is anchoring the title text to top (north) and adding some distance between the titles and the plots with title style=anchor=north, yshift=2ex
.
The reason for the problem is explained in Zarko's comment. That is why the title with "g" and "y" is higher than the other one. My solution is aligning the title text to top of the letters rather than to the bottom. But this cause the plot to overlap with the title. So we have to add some distance between them with yshift.
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style=anchor=north, yshift=2ex % <--- FIX
]%
add a comment |
An alternative to previous two answers is anchoring the title text to top (north) and adding some distance between the titles and the plots with title style=anchor=north, yshift=2ex
.
The reason for the problem is explained in Zarko's comment. That is why the title with "g" and "y" is higher than the other one. My solution is aligning the title text to top of the letters rather than to the bottom. But this cause the plot to overlap with the title. So we have to add some distance between them with yshift.
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style=anchor=north, yshift=2ex % <--- FIX
]%
add a comment |
An alternative to previous two answers is anchoring the title text to top (north) and adding some distance between the titles and the plots with title style=anchor=north, yshift=2ex
.
The reason for the problem is explained in Zarko's comment. That is why the title with "g" and "y" is higher than the other one. My solution is aligning the title text to top of the letters rather than to the bottom. But this cause the plot to overlap with the title. So we have to add some distance between them with yshift.
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style=anchor=north, yshift=2ex % <--- FIX
]%
An alternative to previous two answers is anchoring the title text to top (north) and adding some distance between the titles and the plots with title style=anchor=north, yshift=2ex
.
The reason for the problem is explained in Zarko's comment. That is why the title with "g" and "y" is higher than the other one. My solution is aligning the title text to top of the letters rather than to the bottom. But this cause the plot to overlap with the title. So we have to add some distance between them with yshift.
begingroupplot[%
group style=%
group name=QuantileError,%
group size= 2 by 1,%
horizontal sep = 0.1cm,
,%
width=0.3textwidth,
height=0.4textwidth,
legend cell align=left, %
legend style=draw=white, fill=mygrey3,%
every axis label/.style=font=small,%
ticklabel style = font=tiny,%
yticklabel style=/pgf/number
format/.cd,fixed,precision=4,zerofill,/tikz/.cd,%
x tick label style=rotate=90, anchor=east,
scaled x ticks=false,
xticklabel style=/pgf/number
format/.cd,fixed,precision=2,zerofill,/tikz/.cd,
title style=anchor=north, yshift=2ex % <--- FIX
]%
edited 2 hours ago
answered 2 hours ago
NiroshanNiroshan
2361310
2361310
add a comment |
add a comment |
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%2f490898%2faligning-group-plot-titles-horizontally%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
because the "Northop" hasnt leter "y". if you will add
vphantomy
to it, words will become aligned as you like to have. however, you can definetitle
style in which you addtext depth=0.5ex
.– Zarko
3 hours ago