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
Is ideal gas incompressible?
Results relying on higher derived algebraic geometry
Keeping the dodos out of the field
A nasty indefinite integral
Why do testers need root cause analysis?
Is it OK to look at the list of played moves during the game to determine the status of the 50 move rule?
Why did Nick Fury not hesitate in blowing up the plane he thought was carrying a nuke?
Why is this python script running in background consuming 100 % CPU?
Shell builtin `printf` line limit?
Passport queue length in UK in relation to arrival method
Does the fact that we can only measure the two-way speed of light undermine the axiom of invariance?
Is there an idiom that means that you are in a very strong negotiation position in a negotiation?
How could the B-29 bomber back up under its own power?
Nunc est bibendum: gerund or gerundive?
Are there historical examples of audiences drawn to a work that was "so bad it's good"?
Way of refund if scammed?
Computing elements of a 1000 x 60 matrix exhausts RAM
Make the `diff` command look only for differences from a specified range of lines
What defines a person who is circumcised "of the heart"?
What is the required burn to keep a satellite at a Lagrangian point?
Can a UK national work as a paid shop assistant in the USA?
Is it normal to "extract a paper" from a master thesis?
nginx conf: http2 module not working in Chrome in ubuntu 18.04
What is the winged creature on the back of the Mordenkainen's Tome of Foes book?
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
May 15 at 3:23
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 May 15 at 4:40
Niroshan
asked May 15 at 2:56
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
May 15 at 3:23
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
May 15 at 3:23
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
May 15 at 3:23
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
May 15 at 3:23
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 May 15 at 3:39
ZarkoZarko
135k872179
135k872179
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 May 15 at 3:26
M. Al JumailyM. Al Jumaily
1,1061210
1,1061210
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 May 15 at 4:38
answered May 15 at 4:30
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
May 15 at 3:23