当前位置:网站首页>Latex combines multiple subgraphs
Latex combines multiple subgraphs
2022-07-22 04:30:00 【V, Chao】
20210413 -
0. introduction
Recently in use latex Write a paper , This kind of halfway monk , Many contents need to be checked on site . Can't , Who wants to use less at ordinary times . This article aims at placing subgraphs , That is to put multiple pictures in the article , These pictures essentially belong to the same big picture , The assumption is 3 individual , That's it 3 Subtext , Horizontally distributed in this line .
Although I checked a lot yesterday , But in the end, many are not applicable , The general grammatical structure is clear , It's just that some details are not well understood . In this article, let's briefly record this process .
1. To solve the process
1.1 Starting plan
This part comes from Overleaf Official documents of [1], The introduction was quite detailed , On the first code .
\usepackage{caption}
\usepackage{subcaption}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph1}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph2}
\caption{$y=3sinx$}
\label{fig:three sin x}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph3}
\caption{$y=5/x$}
\label{fig:five over x}
\end{subfigure}
\caption{Three simple graphs}
\label{fig:three graphs}
\end{figure}
The effect that the above code can achieve is as follows .
The picture above , That is the result I want , Then record the code separately .
1) Load the library
Although the above code uses two , But in practice , Only use subcaption
It's OK, too .
2) Subgraph environment
The environment part of the subgraph is the most important , Different from the single image loading environment , When referring to many articles , It is precisely because these parts are not well understood , So it's not very right to use .
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{graph1}
\caption{$y=x$}
\label{fig:y equals x}
\end{subfigure}
This control symbol [b] At present, I'm not sure what it means , I think it should be with ht The same meaning , however botom Words , What does it mean for a subgraph ? incomprehension .{0.3\textwidth}
This sentence refers to setting the width of each subgraph to 0.3\textwidth
, That is, the width of the document 0.3. If you want several subgraphs to be the same , Then we must ensure that their width and sum are less than \textwidth
; Also consider the spacing between the graphs .width=\textwidth
This sentence is more obvious , To specify the width of the subgraph , It should be noted that , Here has become the front 0.3\textwidth
, Because the environment is limited .
3) Line up
If the picture is on one line , Then you need to add ~
perhaps \hfill
These commands are used to fill in two pictures without line breaks , Or fill in nothing directly , As long as the width is enough ; If you want a new line , Leave a blank line .
The above code understands what it means , But I'm not satisfied with the interval between the two pictures , I went on to find other content .
(Overleaf The example given in the official website document of is very good , I have found the answer I want from this website many times )
1.2 Further reduce the horizontal space
First, review Latex Length information in [3], Then ask and answer [2] Found the answer . Question and answer [2] There are three solutions , Maximum length , Equal length , Fixed length . This time, a fixed length is used .
\centering
\subcaptionbox{3a\label{fig3:a}}{\includegraphics[width=1.6in]{example-image-c}}\hspace{1em}%
\subcaptionbox{3b\label{fig3:b}}{\includegraphics[width=1.6in]{example-image-c}}
Don't pay attention to the inserted picture or title , Just pay attention to the interval ,\hspace{1em}%
, In length information [3] Can be seen in ,1em Is under the current font size , A capital M The amount of space occupied ; But even so , The key part here is the later one %
, Get rid of this thing , Or wrap this part , Can not achieve a relatively small space .
Specifically % What's the function , Always feel [2] What is said in is not clear enough .
( Solved the problem for the time being , Then continue to work first )
Multi graph related content
- Subfigures side by side with captions
Picture title , For its , Adopted [t] The way . - Reduce space between subfigure and the subfigure captions
Reduce the space between subgraphs and subtitles .
Reference resources
[1]How to Write a Thesis in LaTeX (Part 3): Figures, Subfigures and Tables
[2]Reduction of Space between two Sub-figures
[3]Latex Length information in
边栏推荐
- Luo min decided to gamble again with 10 billion yuan in cash in the store
- In addition to swagger, the API management tools for team collaboration also include Yapi
- 下载工具-谷歌插件 tampermonkey 和 greasyfork
- highcharts图表及报表展示、导出数据
- Judge whether it is a complete binary tree
- Wuxi launched a major investigation of potential food safety hazards in Pizza Hut stores in the city
- 菜鸟同事贵我2k,原是背了涨薪秘籍?(赶紧收藏!)
- 5.引用类型和值类型作为函数参数?
- 编码gbk的不可映射字符
- 日期函数格式转换
猜你喜欢
[comprehensive pen test] difficulty 3.5/5, multi solution popular binary tree pen test
如何恢复初次写博客时出现的-使用CSDN-markdown编辑器模板
Binary search tree and bidirectional linked list
Latex多个子图进行组合
oracle ebs form表单常用对象及其关系
suricata的简单探究
(resolved) for camerads, HR = m_ pGraph-> Connect(m_pCameraOutput, m_pGrabberInput); Solutions to implementation failures
js中的转义字符?
C# 使用Timer和ProgressBar控件制作一个倒计时器
Interview must ask: from entering URL to page display, what happened? (detailed and easy to understand, organized and easy to remember)
随机推荐
yarn的安装与使用
Judge whether to balance binary tree
Welcome to CSDN markdown editor - first use of editing template
Why do Internet manufacturers love to "deliver takeout"?
Defineexpose, the parent component gets the attribute value in the child component
The MathType DLL cannot be found. Please reinstall math problem solved
首发!这份字节大佬亲码算法面试大厂进阶宝典,让你轻松刷爆LeetCode!
嵌套交叉验证
下载工具proayee-down的使用方法
814. Binary tree pruning: simple recursive problem
When uploading jars on the nexus management page, jars can be pulled to the project normally. Jars published using the deploy of idea lifecycle can only be pulled to POM. 401 problem
(resolved) for camerads, HR = m_ pGraph-> Connect(m_pCameraOutput, m_pGrabberInput); Solutions to implementation failures
写页面注意的问题
Admin组件
Argocd user management, RBAC control, command line login, APP synchronization
找鞍点
Provincial and urban linkage data
快速判断一个文件是否有病毒
Celebrity Catering: a pig killing dish for hunting fans
[zero base] reduce bugs by 50% in only 30 minutes