我產生與gnuplot的陰謀用下面的代碼:epslatex的水平放置GNUPLOT圖
set logscale y
set xlabel "iteration"
set ylabel "$\\varepsilon$"
set terminal epslatex color size 3.5,3.5
set out 'l2_errors_with_iteration_cc=00001_dt=1200_test.tex'
plot "l2_errors_with_iteration_cc=.00001_damping=0.9_dt=0.1200.txt" using 1:2 title 'current' with lines lw 4
set out
quit
數據如下:
0 2.03616944439
0 2.03616944439
2 0.25330118741
3 0.22665346605
4 0.20262719150
5 0.18101252740
6 0.16160551934
7 0.14420900466
8 0.12863525831
9 0.11470804565
10 0.10226380345
11 0.09115208853
12 0.08123549251
13 0.07238919637
14 0.06450029952
15 0.05746702167
16 0.05119784692
17 0.04561065697
18 0.04063188453
19 0.03619570607
20 0.03224328518
21 0.02872207183
22 0.02558515939
23 0.02279069871
24 0.02030136683
25 0.01808388719
26 0.01610859780
27 0.01434906324
28 0.01278172704
29 0.01138560027
30 0.01014198331
31 0.00903421712
32 0.00804746131
33 0.00716849603
34 0.00638554533
35 0.00568811962
36 0.00506687532
37 0.00451348969
38 0.00402054934
39 0.00358145092
40 0.00319031255
41 0.00284189508
42 0.00253153177
43 0.00225506578
44 0.00200879445
45 0.00178941964
46 0.00159400355
47 0.00141992933
48 0.00126486603
49 0.00112673731
50 0.00100369368
51 0.00089408768
52 0.00079645182
53 0.00070947891
54 0.00063200454
55 0.00056299152
56 0.00050151594
57 0.00044675483
58 0.00039797511
59 0.00035452379
60 0.00031581922
61 0.00028134330
62 0.00025063454
63 0.00022328189
64 0.00019891921
65 0.00017722041
66 0.00015789505
67 0.00014068445
68 0.00012535825
69 0.00011171132
70 0.00009956099
71 0.00008874462
72 0.00007911742
73 0.00007055053
74 0.00006292926
75 0.00005615155
76 0.00005012662
77 0.00004477376
78 0.00004002118
79 0.00003580510
80 0.00003206884
81 0.00002876204
82 0.00002583994
83 0.00002326277
84 0.00002099512
85 0.00001900543
86 0.00001726544
87 0.00001574978
88 0.00001443551
89 0.00001330171
90 0.000
91 0.00001150022
92 0.00001079827
93 0.00001020797
94 0.00000971499
95 0.00000930611
96 0.00000896921
97 0.00000869333
98 0.00000846870
99 0.00000828674
100 0.00000814002
101 0.00000802220
102 0.00000792792
103 0.00000785271
104 0.00000779289
105 0.00000774543
106 0.00000770786
107 0.00000767818
108 0.00000765479
109 0.00000763639
110 0.00000762194
111 0.00000761064
112 0.00000760180
113 0.00000759492
114 0.00000758957
115 0.00000758544
116 0.00000758225
117 0.00000757980
它產生一個非常好的情節與的幫助以下tex文件:
% GNUPLOT: LaTeX picture with Postscript
\begingroup
\makeatletter
\providecommand\color[2][]{%
\GenericError{(gnuplot) \space\space\space\@spaces}{%
Package color not loaded in conjunction with
terminal option `colourtext'%
}{See the gnuplot documentation for explanation.%
}{Either use 'blacktext' in gnuplot or load the package
color.sty in LaTeX.}%
\renewcommand\color[2][]{}%
}%
\providecommand\includegraphics[2][]{%
\GenericError{(gnuplot) \space\space\space\@spaces}{%
Package graphicx or graphics not loaded%
}{See the gnuplot documentation for explanation.%
}{The gnuplot epslatex terminal needs graphicx.sty or graphics.sty.}%
\renewcommand\includegraphics[2][]{}%
}%
\providecommand\rotatebox[2]{#2}%
\@ifundefined{ifGPcolor}{%
\newif\ifGPcolor
\GPcolortrue
}{}%
\@ifundefined{ifGPblacktext}{%
\newif\ifGPblacktext
\GPblacktexttrue
}{}%
% define a \[email protected]@macro without @ in the name:
\let\gplgaddtomacro\[email protected]@macro
% define empty templates for all commands taking text:
\gdef\gplbacktext{}%
\gdef\gplfronttext{}%
\makeatother
\ifGPblacktext
% no textcolor at all
\def\colorrgb#1{}%
\def\colorgray#1{}%
\else
% gray or color?
\ifGPcolor
\def\colorrgb#1{\color[rgb]{#1}}%
\def\colorgray#1{\color[gray]{#1}}%
\expandafter\def\csname LTw\endcsname{\color{white}}%
\expandafter\def\csname LTb\endcsname{\color{black}}%
\expandafter\def\csname LTa\endcsname{\color{black}}%
\expandafter\def\csname LT0\endcsname{\color[rgb]{1,0,0}}%
\expandafter\def\csname LT1\endcsname{\color[rgb]{0,1,0}}%
\expandafter\def\csname LT2\endcsname{\color[rgb]{0,0,1}}%
\expandafter\def\csname LT3\endcsname{\color[rgb]{1,0,1}}%
\expandafter\def\csname LT4\endcsname{\color[rgb]{0,1,1}}%
\expandafter\def\csname LT5\endcsname{\color[rgb]{1,1,0}}%
\expandafter\def\csname LT6\endcsname{\color[rgb]{0,0,0}}%
\expandafter\def\csname LT7\endcsname{\color[rgb]{1,0.3,0}}%
\expandafter\def\csname LT8\endcsname{\color[rgb]{0.5,0.5,0.5}}%
\else
% gray
\def\colorrgb#1{\color{black}}%
\def\colorgray#1{\color[gray]{#1}}%
\expandafter\def\csname LTw\endcsname{\color{white}}%
\expandafter\def\csname LTb\endcsname{\color{black}}%
\expandafter\def\csname LTa\endcsname{\color{black}}%
\expandafter\def\csname LT0\endcsname{\color{black}}%
\expandafter\def\csname LT1\endcsname{\color{black}}%
\expandafter\def\csname LT2\endcsname{\color{black}}%
\expandafter\def\csname LT3\endcsname{\color{black}}%
\expandafter\def\csname LT4\endcsname{\color{black}}%
\expandafter\def\csname LT5\endcsname{\color{black}}%
\expandafter\def\csname LT6\endcsname{\color{black}}%
\expandafter\def\csname LT7\endcsname{\color{black}}%
\expandafter\def\csname LT8\endcsname{\color{black}}%
\fi
\fi
\setlength{\unitlength}{0.0500bp}%
\begin{picture}(5040.00,5040.00)%
\gplgaddtomacro\gplbacktext{%
\csname LTb\endcsname%
\put(1342,704){\makebox(0,0)[r]{\strut{} 1e-06}}%
\put(1342,1286){\makebox(0,0)[r]{\strut{} 1e-05}}%
\put(1342,1867){\makebox(0,0)[r]{\strut{} 0.0001}}%
\put(1342,2449){\makebox(0,0)[r]{\strut{} 0.001}}%
\put(1342,3030){\makebox(0,0)[r]{\strut{} 0.01}}%
\put(1342,3612){\makebox(0,0)[r]{\strut{} 0.1}}%
\put(1342,4193){\makebox(0,0)[r]{\strut{} 1}}%
\put(1342,4775){\makebox(0,0)[r]{\strut{} 10}}%
\put(1474,484){\makebox(0,0){\strut{} 0}}%
\put(2002,484){\makebox(0,0){\strut{} 20}}%
\put(2530,484){\makebox(0,0){\strut{} 40}}%
\put(3059,484){\makebox(0,0){\strut{} 60}}%
\put(3587,484){\makebox(0,0){\strut{} 80}}%
\put(4115,484){\makebox(0,0){\strut{} 100}}%
\put(4643,484){\makebox(0,0){\strut{} 120}}%
\put(176,2739){\rotatebox{-270}{\makebox(0,0){\strut{}$\varepsilon$}}}%
\put(3058,154){\makebox(0,0){\strut{}iteration}}%
}%
\gplgaddtomacro\gplfronttext{%
\csname LTb\endcsname%
\put(3656,4602){\makebox(0,0)[r]{\strut{}current}}%
}%
\gplbacktext
\put(0,0){\includegraphics{l2_errors_with_iteration_cc=00001_dt=1200_test.pdf}}%
\gplfronttext
\end{picture}%
\endgroup
然後用以下代碼生成我的文檔:
\documentclass[aps,showpacs,twocolumn,10pt,pra]{revtex4-1}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{float}
\begin{document}
\section{Introduction} \label{sec:Introduction}
\blindtext
\blindtext
\blindtext
\begin{figure}[H]
\centering
\input{l2_errors_with_iteration_cc=00001_dt=1200_test.tex}
\caption{Here we see the error plotted as a function of iteration.}%
\end{figure}
\end{document}
現在,這個問題。在上面的代碼中,我可以改變這一行:
\begin{picture}(5040.00,5040.00)%
更具體地說第一個數字,使其變大或變小。將其縮小可將結果圖移至右側。因此,將它放大應該將數字向左移動。但是,它沒有。爲什麼?我想這樣做是因爲我認爲劇情左邊的空間太多了,ylabel看起來很孤獨。我可以改變這一行移動它:
\put(176,2739){\rotatebox{-270}{\makebox(0,0){\strut{}$\varepsilon$}}}%
增加(或減少)的176至我所希望的任何值,但這並不改變的事實,似乎有更多的空間比需要有是。有趣的是,增加或減少第二個5040.00 - 實際上,只要人們喜歡,就會將情節向上或向下移動(就我測試過的情況而言),這就是爲什麼我覺得這可能是一個錯誤。
對於大型抽搐格式也是如此,參見例如。 http://stackoverflow.com/a/20522516/2604213。對於LaTeX格式,Gnuplot無法正確確定標籤的位置和邊距。 – Christoph
你能分享'set terminal epslatex'這行嗎? – Bernhard
不知道你的意思..我包括這行'集終端epslatex顏色大小3.5,3.5' – juggler