-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfig2b.tex
185 lines (173 loc) · 6.13 KB
/
fig2b.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}
% the figures style are inspired by \url{https://www.nature.com/articles/nature14122/figures/12}.
% For the use of draw group line, refer to https://tex.stackexchange.com/questions/55554/how-can-i-mix-an-ybar-and-an-ybar-stacked-with-pgfplots
\begin{document}
\begin{tikzpicture}
\pgfplotsset{my error bar/.style={error bars/.cd,y dir =both, y explicit}}
\pgfplotsset{
subplotStyle/.style n args ={1}{
axis x line = bottom, % change the default axis box.
axis y line = left,
width = 0.25\linewidth ,
height = 0.4\linewidth ,
ybar=0,
bar width = 0.02\linewidth ,
ytick={0,5,...,45},
ymin=0,ymax=45,
nodes={scale=0.5},
xtick=data,
}
}
\newcommand{\subplotxoffset}{0.4cm}
% plot1 ---------------------------
\newcommand{\subplotName}{shGFP}
\begin{axis}[
name=plot1,
ylabel=S phase(\%),
symbolic x coords={\subplotName},
subplotStyle={45},
]
\addplot [draw=none,fill=gray!100,my error bar] coordinates {(\subplotName,25)+-(0,4)};
\addplot [draw=none,fill=gray!70,my error bar] coordinates {(\subplotName,20)+-(0,3)};
\addplot [draw=none,fill=gray!40,my error bar] coordinates {(\subplotName,10)+-(0,1)};
\addplot [
nodes near coords={**},
nodes near coords style = {
yshift=15pt,xshift=10pt,
},
fill=blue!40,
my error bar,
] coordinates {(\subplotName,35)+-(0,4)};
\end{axis}
% plot2 ----------------------------
\renewcommand{\subplotName}{shEGFR}
\begin{axis}[
name=plot2,
at = {($(plot1.east)+(\subplotxoffset,0)$)},
anchor=west,
%enlargelimits=0.05,
symbolic x coords={\subplotName},
subplotStyle={45},
]
\addplot [draw=none,fill=gray!100,my error bar] coordinates {(\subplotName,20)+-(0,4)};
\addplot [draw=none,fill=gray!70,my error bar] coordinates {(\subplotName,20)+-(0,3)};
\addplot [draw=none,fill=gray!40,my error bar] coordinates {(\subplotName,35)+-(0,1)};
\addplot [fill=red!40,my error bar] coordinates {(\subplotName,40)+-(0,3)};
\end{axis}
% plot3 --------------------------------
\renewcommand{\subplotName}{BRG1 oe}
\begin{axis}[
name=plot3,
at = {($(plot2.east)+(\subplotxoffset,0)$)},
anchor=west,
%enlargelimits=0.05,
symbolic x coords={\subplotName},
subplotStyle={45},
]
\addplot [draw=none,fill=gray!100,my error bar] coordinates {(\subplotName,20)+-(0,4)};
\addplot [draw=none,fill=gray!70,my error bar] coordinates {(\subplotName,20)+-(0,3)};
\addplot [draw=none,fill=gray!40,my error bar] coordinates {(\subplotName,25)+-(0,1)};
\addplot [
nodes near coords={*},
nodes near coords style = {
yshift=5pt,xshift=10pt,
},
fill=red!40,my error bar
] coordinates {(\subplotName,10)+-(0,2)};
\end{axis}
\renewcommand{\subplotName}{Empty Vector}
\begin{axis}[
name=plot4,
at = {($(plot3.east)+(\subplotxoffset,0)$)},
anchor=west,
%enlargelimits=0.05,
symbolic x coords={\subplotName},
subplotStyle={45},
ymax=35,
]
\addplot [draw=none,fill=gray!100,my error bar] coordinates {(\subplotName,5)+-(0,1)};
\addplot [draw=none,fill=gray!70,my error bar] coordinates {(\subplotName,6)+-(0,1.2)};
\addplot [draw=none,fill=gray!40,my error bar] coordinates {(\subplotName,22)+-(0,1)};
\addplot [
nodes near coords={**},
nodes near coords style = {
yshift=0pt,xshift=10pt,
},
fill=red!40,my error bar]
coordinates {(\subplotName,10)+-(0,0.5)};
\end{axis}
% plot5 -----------------------------------
\renewcommand{\subplotName}{shBRG1}
\begin{axis}[
name=plot5,
at = {($(plot4.east)+(\subplotxoffset,0)$)},
anchor=west,
%enlargelimits=0.05,
symbolic x coords={\subplotName},
subplotStyle={45},
ymax=35,
]
\addplot [draw=none,fill=gray!100,my error bar] coordinates {(\subplotName,11)+-(0,1)};
\addplot [draw=none,fill=gray!70,my error bar] coordinates {(\subplotName,10)+-(0,1.2)};
\addplot [draw=none,fill=gray!40,my error bar] coordinates {(\subplotName,12)+-(0,1)};
\addplot [
nodes near coords={*},
nodes near coords style = {
yshift=5pt,xshift=10pt,
},
fill=blue!40,my error bar
] coordinates {(\subplotName,28)+-(0,2)};
\end{axis}
% plot6 -----------------------------------
\renewcommand{\subplotName}{EGFR oe}
\begin{axis}[
name=plot6,
at = {($(plot5.east)+(\subplotxoffset,0)$)},
anchor=west,
%enlargelimits=0.05,
symbolic x coords={\subplotName},
subplotStyle={45},
ymax=35,
%% the legends to be placed outside
legend image code/.code={
\draw [#1] (0cm,-0.1cm) rectangle (0.2cm,0.1cm);
},
legend style={
legend columns=-1,
draw=none,
fill=none,
},
legend entries={Vehicle,DZNep,Etoposide,Etoposide+DZNep},
legend to name=commonLegendb,
]
\addplot [draw=none,fill=gray!100,my error bar] coordinates {(\subplotName,5)+-(0,1)};
\addplot [draw=none,fill=gray!70,my error bar] coordinates {(\subplotName,8)+-(0,1.2)};
\addplot [draw=none,fill=gray!40,my error bar] coordinates {(\subplotName,6)+-(0,0.8)};
\addplot [
nodes near coords={**},
nodes near coords style = {
yshift=0pt,xshift=10pt,
},
fill=blue!40,my error bar
]
coordinates {(\subplotName,15)+-(0,0.5)};
\end{axis}
%% end of the plots ----------------------
% plot the title for the two groups
\node [scale=0.8] (title1) at ($(plot1.north)!0.5!(plot3.north)+(0,15pt)$) {HCC15 - Sensitized Line};
\node [scale=0.8] (title2) at ($(plot4.north)!0.5!(plot6.north)+(0,15pt)$) {H460 - Protected Line};
% self draw the legend ---------------
\node [matrix,fill=none,draw=none] (mylegendnode) at ($(title1.north)!0.5!(title2.north)+(0,8pt)$)
{
\node [fill=gray!100,shape=rectangle,label=right:Vehicle]{}; &[4mm]
\node [fill=gray!70,shape=rectangle,label=right:DZNep]{}; &[4mm]
\node [fill=gray!40,shape=rectangle,label=right:Etoposide]{}; &[4mm]
\node [fill=red!40,shape=rectangle]{}; &
\node [fill=blue!40,shape=rectangle,label=right:Etoposide+DZNep]{}; \\
};
% draw legend with pgfplot function (Not work well)--------------
%\node [scale=0.8] (mylegendnode) at ($(title1.north)!0.5!(title2.north)+(0,8pt)$) {\pgfplotslegendfromname{commonLegendb}};
\end{tikzpicture}
\end{document}