# How to enlarge figures to take maximum available space?

TeX - LaTeX Asked by SHAONI NANDI on December 14, 2020

I am trying to put two figures side by side using minipage. But the figures are shrinking and not using the full page width. How to get figures that use the full page width?

begin{figure}[h]
begin{minipage}{0.5textwidth}
includegraphics[width=columnwidth]{P1.jpg}
end{minipage}
begin{minipage}{0.5textwidth}
includegraphics[width=columnwidth]{P2.jpg}
end{minipage}
end{figure}


There is no need to use minipage.

documentclass{article}
usepackage{graphicx}

usepackage{showframe,lipsum} % just for the example

begin{document}

lipsum[1][1-3]

begin{figure}[htp]

includegraphics[width=0.49textwidth]{example-image-a}hfill
includegraphics[width=0.49textwidth]{example-image-b}

caption{Two side by side figures filling the space, with some separation}

end{figure}

lipsum[1][4-5]
begin{figure}[htp]

includegraphics[width=0.5textwidth]{example-image-a}%
includegraphics[width=0.5textwidth]{example-image-b}

caption{Two side by side figures filling the space, with no separation}

end{figure}

lipsum[1][6-7]

end{document}


Answered by egreg on December 14, 2020

Using max textwidth with minor space between the figures

begin{figure}[h]
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-b}
end{minipage}
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-a}
end{minipage}%
end{figure}


If no space required between the figures put a % after the first minipage

begin{figure}[h]
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-b}
end{minipage}%
begin{minipage}{0.5textwidth}
includegraphics[width=textwidth]{image-a}
end{minipage}%
end{figure}


edit --to prevent protruding image in to margin--with respect to suggestion by @mico

begin{figure}[h]
begin{minipage}{0.4975textwidth}
includegraphics[width=textwidth]{image-b}
end{minipage}hfill
begin{minipage}{0.4975textwidth}
includegraphics[width=textwidth]{image-a}
end{minipage}%
end{figure}


Answered by js bibra on December 14, 2020

## Related Questions

### how to insert keys from token list in command

0  Asked on December 12, 2020 by aleksandr-kozlovskiy

### How do I cite author in LaTeX with BibLaTeX?

1  Asked on December 12, 2020 by ccile

### Environment (or similar) which replaces symbol with command

1  Asked on December 12, 2020 by ryan-greenblatt

### Broken longrightarrow

1  Asked on December 12, 2020

### How to use Arabic symbols as mathematical variables?

1  Asked on December 12, 2020 by wjmccann

### Reverse the direction of pause in a matrix

2  Asked on December 12, 2020

### How to align pspictures two on a row and the third on the second row

1  Asked on December 12, 2020

### How to determine the kind of atom of a given mathematical symbol?

0  Asked on December 12, 2020 by matemticos-chibchas

### csname silences errors

1  Asked on December 12, 2020 by caagr98

### latexdiff with cite commands gives output with apparently mismatched braces

1  Asked on December 12, 2020

### How to fix the Underfull vbox badness has occurred while output is active on my memoir chapter style?

2  Asked on December 12, 2020

### My question is about to generating cross table and mid table arrows as shown in fig. I have tried many options but not getting accurate result

3  Asked on December 12, 2020 by aliasgar-rangwala

### pstricks package not showing ouput despite no erros in tex window

0  Asked on December 12, 2020

### No room for a new write in LuaLaTeX

1  Asked on December 12, 2020 by aubrey-blumsohn

### revtex4-1 and colortbl doesn’t fill cells

2  Asked on December 12, 2020 by sven

### Tables with Pweave

4  Asked on December 12, 2020 by lars20070

### BibTeX author tag string limitation

1  Asked on December 12, 2020

### Calculating definite integral of smooth function in pgfplots

3  Asked on December 12, 2020

### Latexdiff and biblatex citation commands

1  Asked on December 12, 2020 by avs

### Weird vertical spacing with custom tcolorbox and tabular environment

1  Asked on December 11, 2020 by alex-eastman