AnswerBun.com

Problem with of alignment with 4 tikzpictures in a figure environment

Good afternoon,

I just to need to shift all of these for graphs a little bit more to the left, and spacing (vertically) the former two with respect to the latter. I tried with hspace, but it produces the following:enter image description here

documentclass{article}

linespread{1.3}
usepackage[margin=1.5in]{geometry}
usepackage{pgfplots}
usetikzlibrary{patterns}
begin{document}pgfplotsset{compat=1.17}

begin{figure}
hspace{-2cm}
begin{tikzpicture}
begin{axis}[
compat=newest,
axis lines = left,
xlabel = {$text{A&D}/100k$},
ylabel = {$gp$},
xmin = 0,
ymin = 0,
xmax = 325,
ymax = 325,
xtick={0,80},
ytick={160+20/3,240+20/3},
title = {Tourists, Peak},
]
addplot[
domain = 0:240,
samples = 190,
thick,
]
{240 + 20/3 - x};
draw [dotted] (0,160+20/3) -- (80,160+20/3) -- (80,0);
draw[pattern= north east lines,pattern color = green] (0,160+20/3) -- (0,240+20/3)-- (80,160+20/3);
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[
compat=newest,
axis lines = left,
xlabel = {$text{A&D}/100k$},
ylabel = {$gp$},
xmin = 0,
ymin = 0,
xmax = 325,
ymax = 325,
xtick={0,20},
ytick={120+10/3,180+10/3},
title = {Tourists, Off-Peak},
]
addplot[
domain = 0:300,
samples = 190,
thick,
]
{180 + 10/3 - 3*x};
draw [dotted] (0,120+10/3) -- (20,120+10/3) -- (20,0);
draw[pattern= north east lines,pattern color = green] (0,120+10/3) -- (0,180+10/3)-- (20,120+10/3);
end{axis}
end{tikzpicture}
hspace{-2cm}
begin{tikzpicture}
begin{axis}[
compat=newest,
axis lines = left,
xlabel = {$text{A&D} / 100k$},
ylabel = {$gp$},
xmin = 0,
ymin = 0,
xmax = 60,
ymax = 730,
xtick={0,20},
ytick={40+20/3,160+20/3,560+20/3},
title = {Locals, Peak},
]
addplot[
domain = 0:75,
samples = 190,
thick,
]
{560 + 20/3 - 20*x};
draw [dotted] (0,160+20/3) -- (20,160+20/3) -- (20,0);
draw [dotted] (0,40+20/3) -- (26, 40 + 20/3) -- (26,0);
draw [pattern = north east lines, pattern color = green](0, 40 + 20/3) -- (0,560 + 20/3) -- (20, 160 + 20/3) -- (20, 40 + 20/3);
draw [pattern = north east lines, pattern color = red](20, 40 + 20/3) -- (20, 160 + 20/3) -- (26,40 + 20/3);
end{axis}
end{tikzpicture}
begin{tikzpicture}
begin{axis}[
compat=newest,
axis lines = left,
xlabel = {$text{A&D} / 100k$},
ylabel = {$gp$},
xmin = 0,
ymin = 0,
xmax = 60,
ymax = 730,
xtick={0,30},
ytick={30+10/3,120+10/3,420+10/3},
title = {Locals, Off-Peak},
]
addplot[
domain = 0:75,
samples = 190,
thick,
]
{420 + 10/3 - 10*x};
draw [dotted] (0,120+10/3) -- (30,120+20/3) -- (30,0);
draw [dotted] (0,30+10/3) -- (39, 30 + 10/3) -- (39,0);
draw [pattern = north east lines, pattern color = green](0, 30 + 10/3) -- (0,420 + 10/3) -- (30, 120 + 10/3) -- (30, 30 + 10/3);
draw [pattern = north east lines, pattern color = red](30, 30 + 10/3) -- (30, 120 + 10/3) -- (39,30 + 10/3);
end{axis}
end{tikzpicture}
end{figure}

end{document}

TeX - LaTeX Asked by Matteo Bulgarelli on January 2, 2021

0 Answers

Add your own answers!

Related Questions

Footnotes without numbering and without horizontal rule

1  Asked on November 14, 2020 by mr-gold

 

Text going past page

0  Asked on November 14, 2020 by palestina

       

Input{xxx} : file not found

0  Asked on November 14, 2020 by mattia-galanti

   

curved lower arrow?

2  Asked on November 10, 2020

 

How might one create a nice looking table in Latex?

4  Asked on November 10, 2020 by exploring

 

How to add shading to a node in a graph

1  Asked on November 9, 2020

 

`counterwithin` not work with custom counters

1  Asked on November 9, 2020 by rabbittac

   

Using raisebox to change nested underlining

0  Asked on November 9, 2020 by latexerexetal

 

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.