How can I force my subfigures to be aligned?











up vote
1
down vote

favorite












I have 4 images and I'd like them all to be aligned along their vertical and horizontal edges. The problem is that the caption on the top right image takes up 2 lines, but the caption on the top left image only takes up 1 line, causing them to be misaligned. It looks like thisenter image description here



How can I force them to be aligned? I am using the following packages and template:



documentclass[annual]{acmsiggraph}
usepackage{graphicx}
usepackage{caption}
usepackage{subcaption}

begin{document}

begin{figure}[htbp]
centering
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald}
caption{Original image.}
label{fig:pearl-original}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_gray}
caption{The image after blurring and extracting the luminance channel.}
label{fig:pearl-human}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_x.png}
caption{The image after applying a vertical sobel filter.}
label{fig:pearl-paint}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_y.png}
caption{The image after applying a horizonal sobel filter}
label{fig:pearl-paint}
end{subfigure}
caption{Different stages of the image processing pipeline.}
label{fig:pipeline}
end{figure}

end{document}









share|improve this question
























  • Welcome to TeX.SE! Please make your code snippets compilable!
    – Kurt
    Dec 2 at 22:59










  • instead begin{subfigure}[b]{0.2linewidth} try begin{subfigure}[t]{0.2linewidth}.
    – Zarko
    Dec 2 at 23:29












  • That worked. Thanks!!
    – jim jammo
    Dec 2 at 23:47










  • @jimjammo, i convert my comment to an answer.
    – Zarko
    Dec 2 at 23:56















up vote
1
down vote

favorite












I have 4 images and I'd like them all to be aligned along their vertical and horizontal edges. The problem is that the caption on the top right image takes up 2 lines, but the caption on the top left image only takes up 1 line, causing them to be misaligned. It looks like thisenter image description here



How can I force them to be aligned? I am using the following packages and template:



documentclass[annual]{acmsiggraph}
usepackage{graphicx}
usepackage{caption}
usepackage{subcaption}

begin{document}

begin{figure}[htbp]
centering
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald}
caption{Original image.}
label{fig:pearl-original}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_gray}
caption{The image after blurring and extracting the luminance channel.}
label{fig:pearl-human}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_x.png}
caption{The image after applying a vertical sobel filter.}
label{fig:pearl-paint}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_y.png}
caption{The image after applying a horizonal sobel filter}
label{fig:pearl-paint}
end{subfigure}
caption{Different stages of the image processing pipeline.}
label{fig:pipeline}
end{figure}

end{document}









share|improve this question
























  • Welcome to TeX.SE! Please make your code snippets compilable!
    – Kurt
    Dec 2 at 22:59










  • instead begin{subfigure}[b]{0.2linewidth} try begin{subfigure}[t]{0.2linewidth}.
    – Zarko
    Dec 2 at 23:29












  • That worked. Thanks!!
    – jim jammo
    Dec 2 at 23:47










  • @jimjammo, i convert my comment to an answer.
    – Zarko
    Dec 2 at 23:56













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have 4 images and I'd like them all to be aligned along their vertical and horizontal edges. The problem is that the caption on the top right image takes up 2 lines, but the caption on the top left image only takes up 1 line, causing them to be misaligned. It looks like thisenter image description here



How can I force them to be aligned? I am using the following packages and template:



documentclass[annual]{acmsiggraph}
usepackage{graphicx}
usepackage{caption}
usepackage{subcaption}

begin{document}

begin{figure}[htbp]
centering
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald}
caption{Original image.}
label{fig:pearl-original}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_gray}
caption{The image after blurring and extracting the luminance channel.}
label{fig:pearl-human}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_x.png}
caption{The image after applying a vertical sobel filter.}
label{fig:pearl-paint}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_y.png}
caption{The image after applying a horizonal sobel filter}
label{fig:pearl-paint}
end{subfigure}
caption{Different stages of the image processing pipeline.}
label{fig:pipeline}
end{figure}

end{document}









share|improve this question















I have 4 images and I'd like them all to be aligned along their vertical and horizontal edges. The problem is that the caption on the top right image takes up 2 lines, but the caption on the top left image only takes up 1 line, causing them to be misaligned. It looks like thisenter image description here



How can I force them to be aligned? I am using the following packages and template:



documentclass[annual]{acmsiggraph}
usepackage{graphicx}
usepackage{caption}
usepackage{subcaption}

begin{document}

begin{figure}[htbp]
centering
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald}
caption{Original image.}
label{fig:pearl-original}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_gray}
caption{The image after blurring and extracting the luminance channel.}
label{fig:pearl-human}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_x.png}
caption{The image after applying a vertical sobel filter.}
label{fig:pearl-paint}
end{subfigure}
~ %add desired spacing between images, e. g. ~, quad, qquad, hfill etc.
%(or a blank line to force the subfigure onto a new line)
begin{subfigure}[b]{0.2textwidth}
includegraphics[width=textwidth]{images/donald_sobel_y.png}
caption{The image after applying a horizonal sobel filter}
label{fig:pearl-paint}
end{subfigure}
caption{Different stages of the image processing pipeline.}
label{fig:pipeline}
end{figure}

end{document}






graphics subfloats






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 2 at 23:05

























asked Dec 2 at 22:57









jim jammo

62




62












  • Welcome to TeX.SE! Please make your code snippets compilable!
    – Kurt
    Dec 2 at 22:59










  • instead begin{subfigure}[b]{0.2linewidth} try begin{subfigure}[t]{0.2linewidth}.
    – Zarko
    Dec 2 at 23:29












  • That worked. Thanks!!
    – jim jammo
    Dec 2 at 23:47










  • @jimjammo, i convert my comment to an answer.
    – Zarko
    Dec 2 at 23:56


















  • Welcome to TeX.SE! Please make your code snippets compilable!
    – Kurt
    Dec 2 at 22:59










  • instead begin{subfigure}[b]{0.2linewidth} try begin{subfigure}[t]{0.2linewidth}.
    – Zarko
    Dec 2 at 23:29












  • That worked. Thanks!!
    – jim jammo
    Dec 2 at 23:47










  • @jimjammo, i convert my comment to an answer.
    – Zarko
    Dec 2 at 23:56
















Welcome to TeX.SE! Please make your code snippets compilable!
– Kurt
Dec 2 at 22:59




Welcome to TeX.SE! Please make your code snippets compilable!
– Kurt
Dec 2 at 22:59












instead begin{subfigure}[b]{0.2linewidth} try begin{subfigure}[t]{0.2linewidth}.
– Zarko
Dec 2 at 23:29






instead begin{subfigure}[b]{0.2linewidth} try begin{subfigure}[t]{0.2linewidth}.
– Zarko
Dec 2 at 23:29














That worked. Thanks!!
– jim jammo
Dec 2 at 23:47




That worked. Thanks!!
– jim jammo
Dec 2 at 23:47












@jimjammo, i convert my comment to an answer.
– Zarko
Dec 2 at 23:56




@jimjammo, i convert my comment to an answer.
– Zarko
Dec 2 at 23:56










2 Answers
2






active

oldest

votes

















up vote
1
down vote













You could use begin{subfigure}[t]{0.4linewidth}, that's [t] instead of [b].



I tried with following packages and template:



documentclass{article}
usepackage{caption}
usepackage{graphicx}
usepackage{subcaption}
captionsetup{compatibility=false}

begin{document}


begin{figure}[h!t!b]
centering
begin{subfigure}[t]{0.4linewidth} includegraphics[width=linewidth]{"image".png}
caption{image1}
end{subfigure}
begin{subfigure}[t]{0.4linewidth}
includegraphics[width=linewidth]{"image".png}
caption{image2 has a very long caption to be fit}
end{subfigure}\
begin{subfigure}[t]{0.4linewidth}
includegraphics[width=linewidth]{"image".png}
caption{image3}
end{subfigure}
begin{subfigure}[t]{0.4linewidth}
includegraphics[width=linewidth]{"image".png}
caption{image4}
end{subfigure}

caption{Different Images}
label{Images}
end{figure}


end{document}


enter image description here






share|improve this answer




























    up vote
    0
    down vote













    if the images the same height and caption of different length, than is sensible to align the top of images:



    documentclass{article}     % i haven't your document style,
    % however a proposed solution work witha anyone
    usepackage[demo]{graphicx}
    usepackage{caption}
    usepackage{subcaption}

    %-------------------------------------- only for show page layout
    usepackage{showframe}
    renewcommandShowFrameLinethickness{0.25pt}
    renewcommand*ShowFrameColor{color{red}}
    %---------------------------------------------------------------%
    usepackage{lipsum}

    begin{document}
    begin{figure}[htbp]
    centering
    % images in the first row
    begin{subfigure}[t]{0.2linewidth}
    includegraphics[width=linewidth]{images/donald}
    caption{Original image.}
    label{fig:pearl-original}
    end{subfigure}
    ~
    begin{subfigure}[t]{0.2linewidth}
    includegraphics[width=linewidth]{images/donald_gray}
    caption{The image after blurring and extracting the luminance channel.}
    label{fig:pearl-human}
    end{subfigure}

    % images in the second row
    begin{subfigure}[t]{0.2linewidth}
    includegraphics[width=linewidth]{images/donald_sobel_x.png}
    caption{The image after applying a vertical sobel filter.}
    label{fig:pearl-paint}
    end{subfigure}
    ~
    begin{subfigure}[t]{0.2linewidth}
    includegraphics[width=linewidth]{images/donald_sobel_y.png}
    caption{The image after applying a horizonal sobel filter}
    label{fig:pearl-paint}
    end{subfigure}
    caption{Different stages of the image processing pipeline.}
    label{fig:pipeline}
    end{figure}
    end{document}


    enter image description here



    (red lines indicate page layout)



    edit: by accident i upload two different codes. also i miss that you like to have images in two rows (this is not evident from your code. now corrected.



    in case, that your document has two columns, than for the width of subfigures select



    begin{subfigure}[t]{0.4linewidth}


    or



    begin{subfigure}[t]{0.4columnwidth}


    enter image description here






    share|improve this answer























      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',
      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
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462872%2fhow-can-i-force-my-subfigures-to-be-aligned%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      You could use begin{subfigure}[t]{0.4linewidth}, that's [t] instead of [b].



      I tried with following packages and template:



      documentclass{article}
      usepackage{caption}
      usepackage{graphicx}
      usepackage{subcaption}
      captionsetup{compatibility=false}

      begin{document}


      begin{figure}[h!t!b]
      centering
      begin{subfigure}[t]{0.4linewidth} includegraphics[width=linewidth]{"image".png}
      caption{image1}
      end{subfigure}
      begin{subfigure}[t]{0.4linewidth}
      includegraphics[width=linewidth]{"image".png}
      caption{image2 has a very long caption to be fit}
      end{subfigure}\
      begin{subfigure}[t]{0.4linewidth}
      includegraphics[width=linewidth]{"image".png}
      caption{image3}
      end{subfigure}
      begin{subfigure}[t]{0.4linewidth}
      includegraphics[width=linewidth]{"image".png}
      caption{image4}
      end{subfigure}

      caption{Different Images}
      label{Images}
      end{figure}


      end{document}


      enter image description here






      share|improve this answer

























        up vote
        1
        down vote













        You could use begin{subfigure}[t]{0.4linewidth}, that's [t] instead of [b].



        I tried with following packages and template:



        documentclass{article}
        usepackage{caption}
        usepackage{graphicx}
        usepackage{subcaption}
        captionsetup{compatibility=false}

        begin{document}


        begin{figure}[h!t!b]
        centering
        begin{subfigure}[t]{0.4linewidth} includegraphics[width=linewidth]{"image".png}
        caption{image1}
        end{subfigure}
        begin{subfigure}[t]{0.4linewidth}
        includegraphics[width=linewidth]{"image".png}
        caption{image2 has a very long caption to be fit}
        end{subfigure}\
        begin{subfigure}[t]{0.4linewidth}
        includegraphics[width=linewidth]{"image".png}
        caption{image3}
        end{subfigure}
        begin{subfigure}[t]{0.4linewidth}
        includegraphics[width=linewidth]{"image".png}
        caption{image4}
        end{subfigure}

        caption{Different Images}
        label{Images}
        end{figure}


        end{document}


        enter image description here






        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          You could use begin{subfigure}[t]{0.4linewidth}, that's [t] instead of [b].



          I tried with following packages and template:



          documentclass{article}
          usepackage{caption}
          usepackage{graphicx}
          usepackage{subcaption}
          captionsetup{compatibility=false}

          begin{document}


          begin{figure}[h!t!b]
          centering
          begin{subfigure}[t]{0.4linewidth} includegraphics[width=linewidth]{"image".png}
          caption{image1}
          end{subfigure}
          begin{subfigure}[t]{0.4linewidth}
          includegraphics[width=linewidth]{"image".png}
          caption{image2 has a very long caption to be fit}
          end{subfigure}\
          begin{subfigure}[t]{0.4linewidth}
          includegraphics[width=linewidth]{"image".png}
          caption{image3}
          end{subfigure}
          begin{subfigure}[t]{0.4linewidth}
          includegraphics[width=linewidth]{"image".png}
          caption{image4}
          end{subfigure}

          caption{Different Images}
          label{Images}
          end{figure}


          end{document}


          enter image description here






          share|improve this answer












          You could use begin{subfigure}[t]{0.4linewidth}, that's [t] instead of [b].



          I tried with following packages and template:



          documentclass{article}
          usepackage{caption}
          usepackage{graphicx}
          usepackage{subcaption}
          captionsetup{compatibility=false}

          begin{document}


          begin{figure}[h!t!b]
          centering
          begin{subfigure}[t]{0.4linewidth} includegraphics[width=linewidth]{"image".png}
          caption{image1}
          end{subfigure}
          begin{subfigure}[t]{0.4linewidth}
          includegraphics[width=linewidth]{"image".png}
          caption{image2 has a very long caption to be fit}
          end{subfigure}\
          begin{subfigure}[t]{0.4linewidth}
          includegraphics[width=linewidth]{"image".png}
          caption{image3}
          end{subfigure}
          begin{subfigure}[t]{0.4linewidth}
          includegraphics[width=linewidth]{"image".png}
          caption{image4}
          end{subfigure}

          caption{Different Images}
          label{Images}
          end{figure}


          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 3 at 0:14









          Lily G

          512




          512






















              up vote
              0
              down vote













              if the images the same height and caption of different length, than is sensible to align the top of images:



              documentclass{article}     % i haven't your document style,
              % however a proposed solution work witha anyone
              usepackage[demo]{graphicx}
              usepackage{caption}
              usepackage{subcaption}

              %-------------------------------------- only for show page layout
              usepackage{showframe}
              renewcommandShowFrameLinethickness{0.25pt}
              renewcommand*ShowFrameColor{color{red}}
              %---------------------------------------------------------------%
              usepackage{lipsum}

              begin{document}
              begin{figure}[htbp]
              centering
              % images in the first row
              begin{subfigure}[t]{0.2linewidth}
              includegraphics[width=linewidth]{images/donald}
              caption{Original image.}
              label{fig:pearl-original}
              end{subfigure}
              ~
              begin{subfigure}[t]{0.2linewidth}
              includegraphics[width=linewidth]{images/donald_gray}
              caption{The image after blurring and extracting the luminance channel.}
              label{fig:pearl-human}
              end{subfigure}

              % images in the second row
              begin{subfigure}[t]{0.2linewidth}
              includegraphics[width=linewidth]{images/donald_sobel_x.png}
              caption{The image after applying a vertical sobel filter.}
              label{fig:pearl-paint}
              end{subfigure}
              ~
              begin{subfigure}[t]{0.2linewidth}
              includegraphics[width=linewidth]{images/donald_sobel_y.png}
              caption{The image after applying a horizonal sobel filter}
              label{fig:pearl-paint}
              end{subfigure}
              caption{Different stages of the image processing pipeline.}
              label{fig:pipeline}
              end{figure}
              end{document}


              enter image description here



              (red lines indicate page layout)



              edit: by accident i upload two different codes. also i miss that you like to have images in two rows (this is not evident from your code. now corrected.



              in case, that your document has two columns, than for the width of subfigures select



              begin{subfigure}[t]{0.4linewidth}


              or



              begin{subfigure}[t]{0.4columnwidth}


              enter image description here






              share|improve this answer



























                up vote
                0
                down vote













                if the images the same height and caption of different length, than is sensible to align the top of images:



                documentclass{article}     % i haven't your document style,
                % however a proposed solution work witha anyone
                usepackage[demo]{graphicx}
                usepackage{caption}
                usepackage{subcaption}

                %-------------------------------------- only for show page layout
                usepackage{showframe}
                renewcommandShowFrameLinethickness{0.25pt}
                renewcommand*ShowFrameColor{color{red}}
                %---------------------------------------------------------------%
                usepackage{lipsum}

                begin{document}
                begin{figure}[htbp]
                centering
                % images in the first row
                begin{subfigure}[t]{0.2linewidth}
                includegraphics[width=linewidth]{images/donald}
                caption{Original image.}
                label{fig:pearl-original}
                end{subfigure}
                ~
                begin{subfigure}[t]{0.2linewidth}
                includegraphics[width=linewidth]{images/donald_gray}
                caption{The image after blurring and extracting the luminance channel.}
                label{fig:pearl-human}
                end{subfigure}

                % images in the second row
                begin{subfigure}[t]{0.2linewidth}
                includegraphics[width=linewidth]{images/donald_sobel_x.png}
                caption{The image after applying a vertical sobel filter.}
                label{fig:pearl-paint}
                end{subfigure}
                ~
                begin{subfigure}[t]{0.2linewidth}
                includegraphics[width=linewidth]{images/donald_sobel_y.png}
                caption{The image after applying a horizonal sobel filter}
                label{fig:pearl-paint}
                end{subfigure}
                caption{Different stages of the image processing pipeline.}
                label{fig:pipeline}
                end{figure}
                end{document}


                enter image description here



                (red lines indicate page layout)



                edit: by accident i upload two different codes. also i miss that you like to have images in two rows (this is not evident from your code. now corrected.



                in case, that your document has two columns, than for the width of subfigures select



                begin{subfigure}[t]{0.4linewidth}


                or



                begin{subfigure}[t]{0.4columnwidth}


                enter image description here






                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  if the images the same height and caption of different length, than is sensible to align the top of images:



                  documentclass{article}     % i haven't your document style,
                  % however a proposed solution work witha anyone
                  usepackage[demo]{graphicx}
                  usepackage{caption}
                  usepackage{subcaption}

                  %-------------------------------------- only for show page layout
                  usepackage{showframe}
                  renewcommandShowFrameLinethickness{0.25pt}
                  renewcommand*ShowFrameColor{color{red}}
                  %---------------------------------------------------------------%
                  usepackage{lipsum}

                  begin{document}
                  begin{figure}[htbp]
                  centering
                  % images in the first row
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald}
                  caption{Original image.}
                  label{fig:pearl-original}
                  end{subfigure}
                  ~
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald_gray}
                  caption{The image after blurring and extracting the luminance channel.}
                  label{fig:pearl-human}
                  end{subfigure}

                  % images in the second row
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald_sobel_x.png}
                  caption{The image after applying a vertical sobel filter.}
                  label{fig:pearl-paint}
                  end{subfigure}
                  ~
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald_sobel_y.png}
                  caption{The image after applying a horizonal sobel filter}
                  label{fig:pearl-paint}
                  end{subfigure}
                  caption{Different stages of the image processing pipeline.}
                  label{fig:pipeline}
                  end{figure}
                  end{document}


                  enter image description here



                  (red lines indicate page layout)



                  edit: by accident i upload two different codes. also i miss that you like to have images in two rows (this is not evident from your code. now corrected.



                  in case, that your document has two columns, than for the width of subfigures select



                  begin{subfigure}[t]{0.4linewidth}


                  or



                  begin{subfigure}[t]{0.4columnwidth}


                  enter image description here






                  share|improve this answer














                  if the images the same height and caption of different length, than is sensible to align the top of images:



                  documentclass{article}     % i haven't your document style,
                  % however a proposed solution work witha anyone
                  usepackage[demo]{graphicx}
                  usepackage{caption}
                  usepackage{subcaption}

                  %-------------------------------------- only for show page layout
                  usepackage{showframe}
                  renewcommandShowFrameLinethickness{0.25pt}
                  renewcommand*ShowFrameColor{color{red}}
                  %---------------------------------------------------------------%
                  usepackage{lipsum}

                  begin{document}
                  begin{figure}[htbp]
                  centering
                  % images in the first row
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald}
                  caption{Original image.}
                  label{fig:pearl-original}
                  end{subfigure}
                  ~
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald_gray}
                  caption{The image after blurring and extracting the luminance channel.}
                  label{fig:pearl-human}
                  end{subfigure}

                  % images in the second row
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald_sobel_x.png}
                  caption{The image after applying a vertical sobel filter.}
                  label{fig:pearl-paint}
                  end{subfigure}
                  ~
                  begin{subfigure}[t]{0.2linewidth}
                  includegraphics[width=linewidth]{images/donald_sobel_y.png}
                  caption{The image after applying a horizonal sobel filter}
                  label{fig:pearl-paint}
                  end{subfigure}
                  caption{Different stages of the image processing pipeline.}
                  label{fig:pipeline}
                  end{figure}
                  end{document}


                  enter image description here



                  (red lines indicate page layout)



                  edit: by accident i upload two different codes. also i miss that you like to have images in two rows (this is not evident from your code. now corrected.



                  in case, that your document has two columns, than for the width of subfigures select



                  begin{subfigure}[t]{0.4linewidth}


                  or



                  begin{subfigure}[t]{0.4columnwidth}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 3 at 3:08

























                  answered Dec 2 at 23:56









                  Zarko

                  118k865155




                  118k865155






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462872%2fhow-can-i-force-my-subfigures-to-be-aligned%23new-answer', 'question_page');
                      }
                      );

                      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







                      Popular posts from this blog

                      How to change which sound is reproduced for terminal bell?

                      Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                      Can I use Tabulator js library in my java Spring + Thymeleaf project?