Latex:pgfplots Multiple graphs grouped display

Source: Internet
Author: User

Reference: How can a title is placed for a group of pgfplots?,
Pgfplots Manual in 5.7 section grouping plots introduction

Source: When using latex to write a document, usually draw a variety of diagrams, drawing a lot of ways, such as can be painted in Excel, the use of professional drawing software origin, as well as a variety of visual graphics editing tools, these tools have a common feature is the need to draw a good diagram, You need to convert the diagram to PDF format and then reference it in Latex, with the following disadvantages:

    • You need to generate a PDF image frequently and crop the image using Acrobat;
    • The specifications of the figure, the thickness of the line, the size of the font is difficult to unify;
    • Later found that the problem, or the data needs to be modified, then you have to repeat the first step, more time-consuming;

For the pursuit of picture perfection and obsessive compulsive disorder, use pgfplots to solve these problems, because it is based on source code drawing, just modify the code.

Now want to display a group of photos, how to do it?

Workaround:
First introduce third-party libraries

\usepackage{pgfplots}% used for showing all the figure\pgfplotsset{    compat=1.5} \usepgfplotslibrary{groupplots}

Second, you can use Groupplot

\ begin{tikzpicture}\begin{groupplot}[group style={Group Size= 2  by 2},height=3cm,width=3cm]\nextgroupplot[title=one,xlabel={$ X$}]\addplot[blue] table {test.dat};\nextgroupplot[title=two]\addplot coordinates {(0,2) (2,0)};\nextgroupplot[]\addplot coordinates {(0,2) ( 2, 1)};\nextgroupplot[group/empty plot]% shows an empty diagram \ End{groupplot}\node (title)  at ($ (group c1r1.center)!  0.5! (group c2r1.center) + (0,2cm) $) {The Title};\ end{tikzpicture}

The effect is as follows:

Latex:pgfplots Multiple graphs grouped display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.