I have a problem to plot label (Year) only for significant values (in this
case spoz and sneg).
I use this code, but don't work with labels.
library(ggplot2)
ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+
  geom_bar(stat="identity",position="identity")+
  scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+
  theme_bw()
Thank you!

the data used is:

Year variable   value type
1   1901      neg    0.00  all
2   1902      neg    0.00  all
3   1903      neg    0.00  all
4   1904      neg    0.00  all
5   1905      neg -100.00  all
6   1906      neg -100.00  all
7   1907      neg  -50.00  all
8   1908      neg  -66.67  all
9   1909      neg    0.00  all
10  1910      neg  -66.67  all
11  1911      neg  -66.67  all
12  1912      neg    0.00  all
13  1913      neg  -50.00  all
14  1914      neg -100.00  all
15  1915      neg  -50.00  all
16  1916      neg  -83.33  all
17  1917      neg  -16.67  all
18  1918      neg  -50.00  all
19  1919      neg  -12.50  all
20  1920      neg  -25.00  all
21  1921      neg  -12.50  all
22  1922      neg  -33.33  all
23  1923      neg  -30.00  all
24  1924      neg  -33.33  all
25  1925      neg   -6.67  all
26  1926      neg  -13.33  all
27  1927      neg  -11.11  all
28  1928      neg  -38.10  all
29  1929      neg  -39.13  all
30  1930      neg  -33.33  all
31  1931      neg  -36.00  all
32  1932      neg  -34.62  all
33  1933      neg  -41.38  all
34  1934      neg  -32.26  all
35  1935      neg  -42.42  all
36  1936      neg  -30.30  all
37  1937      neg  -50.00  all
38  1938      neg  -52.78  all
39  1939      neg  -34.21  all
40  1940      neg  -15.38  all
41  1941      neg  -27.50  all
42  1942      neg  -58.54  all
43  1943      neg  -35.71  all
44  1944      neg  -29.55  all
45  1945      neg  -33.33  all
46  1946      neg  -30.00  all
47  1947      neg  -41.51  all
48  1948      neg  -27.78  all
49  1949      neg  -38.18  all
50  1950      neg  -17.86  all
51  1951      neg  -38.60  all
52  1952      neg  -18.97  all
53  1953      neg  -33.33  all
54  1954      neg  -25.00  all
55  1955      neg  -30.65  all
56  1956      neg  -34.92  all
57  1957      neg  -26.56  all
58  1958      neg  -24.62  all
59  1959      neg  -37.31  all
60  1960      neg  -40.00  all
61  1961      neg  -34.25  all
62  1962      neg  -45.21  all
63  1963      neg  -41.89  all
64  1964      neg  -35.14  all
65  1965      neg  -24.00  all
66  1966      neg  -29.33  all
67  1967      neg  -30.26  all
68  1968      neg  -46.75  all
69  1969      neg  -29.87  all
70  1970      neg  -42.31  all
71  1971      neg  -30.77  all
72  1972      neg  -50.00  all
73  1973      neg  -33.33  all
74  1974      neg  -27.85  all
75  1975      neg  -39.51  all
76  1976      neg  -53.09  all
77  1977      neg  -38.27  all
78  1978      neg  -59.26  all
79  1979      neg  -61.73  all
80  1980      neg  -67.07  all
81  1981      neg  -47.56  all
82  1982      neg  -26.83  all
83  1983      neg  -58.54  all
84  1984      neg  -63.41  all
85  1985      neg  -50.00  all
86  1986      neg  -42.68  all
87  1987      neg  -74.39  all
88  1988      neg  -52.44  all
89  1989      neg  -26.83  all
90  1990      neg  -29.27  all
91  1991      neg  -30.49  all
92  1992      neg  -15.85  all
93  1993      neg  -32.93  all
94  1994      neg  -54.88  all
95  1995      neg  -28.05  all
96  1996      neg  -45.12  all
97  1997      neg   -4.88  all
98  1998      neg   -7.32  all
99  1999      neg  -59.76  all
100 2000      neg  -64.63  all
101 2001      neg   -4.88  all
102 2002      neg  -30.49  all
103 2003      neg  -64.63  all
104 2004      neg    0.00  all
105 2005      neg  -63.41  all
106 2006      neg  -13.41  all
107 2007      neg  -70.73  all
108 2008      neg  -21.95  all
109 2009      neg  -51.22  all
110 2010      neg  -34.15  all
111 2011      neg  -28.05  all
112 1901      poz    0.00  all
113 1902      poz  100.00  all
114 1903      poz  100.00  all
115 1904      poz    0.00  all
116 1905      poz    0.00  all
117 1906      poz    0.00  all
118 1907      poz   50.00  all
119 1908      poz   33.33  all
120 1909      poz   33.33  all
121 1910      poz   33.33  all
122 1911      poz    0.00  all
123 1912      poz   33.33  all
124 1913      poz   25.00  all
125 1914      poz    0.00  all
126 1915      poz   16.67  all
127 1916      poz   16.67  all
128 1917      poz   83.33  all
129 1918      poz   50.00  all
130 1919      poz   75.00  all
131 1920      poz   62.50  all
132 1921      poz   50.00  all
133 1922      poz   22.22  all
134 1923      poz   40.00  all
135 1924      poz   26.67  all
136 1925      poz   66.67  all
137 1926      poz   60.00  all
138 1927      poz   50.00  all
139 1928      poz   33.33  all
140 1929      poz   39.13  all
141 1930      poz   25.00  all
142 1931      poz   24.00  all
143 1932      poz   50.00  all
144 1933      poz   34.48  all
145 1934      poz   22.58  all
146 1935      poz   39.39  all
147 1936      poz   36.36  all
148 1937      poz   17.65  all
149 1938      poz    5.56  all
150 1939      poz   36.84  all
151 1940      poz   56.41  all
152 1941      poz   50.00  all
153 1942      poz   19.51  all
154 1943      poz   47.62  all
155 1944      poz   43.18  all
156 1945      poz   31.11  all
157 1946      poz   44.00  all
158 1947      poz   41.51  all
159 1948      poz   44.44  all
160 1949      poz   50.91  all
161 1950      poz   57.14  all
162 1951      poz   33.33  all
163 1952      poz   50.00  all
164 1953      poz   35.00  all
165 1954      poz   45.00  all
166 1955      poz   45.16  all
167 1956      poz   23.81  all
168 1957      poz   48.44  all
169 1958      poz   33.85  all
170 1959      poz   32.84  all
171 1960      poz   22.86  all
172 1961      poz   34.25  all
173 1962      poz   23.29  all
174 1963      poz   21.62  all
175 1964      poz   27.03  all
176 1965      poz   45.33  all
177 1966      poz   33.33  all
178 1967      poz   35.53  all
179 1968      poz   20.78  all
180 1969      poz   42.86  all
181 1970      poz   21.79  all
182 1971      poz   38.46  all
183 1972      poz   24.36  all
184 1973      poz   24.36  all
185 1974      poz   36.71  all
186 1975      poz   33.33  all
187 1976      poz   23.46  all
188 1977      poz   34.57  all
189 1978      poz   20.99  all
190 1979      poz   12.35  all
191 1980      poz   12.20  all
192 1981      poz   24.39  all
193 1982      poz   53.66  all
194 1983      poz   25.61  all
195 1984      poz   17.07  all
196 1985      poz   26.83  all
197 1986      poz   30.49  all
198 1987      poz   15.85  all
199 1988      poz   30.49  all
200 1989      poz   57.32  all
201 1990      poz   53.66  all
202 1991      poz   52.44  all
203 1992      poz   67.07  all
204 1993      poz   45.12  all
205 1994      poz   32.93  all
206 1995      poz   46.34  all
207 1996      poz   34.15  all
208 1997      poz   85.37  all
209 1998      poz   79.27  all
210 1999      poz   28.05  all
211 2000      poz   20.73  all
212 2001      poz   74.39  all
213 2002      poz   31.71  all
214 2003      poz   15.85  all
215 2004      poz   92.68  all
216 2005      poz   10.98  all
217 2006      poz   50.00  all
218 2007      poz   10.98  all
219 2008      poz   46.34  all
220 2009      poz   14.63  all
221 2010      poz   34.15  all
222 2011      poz   41.46  all
223 1901     sneg      NA sneg
224 1902     sneg      NA sneg
225 1903     sneg      NA sneg
226 1904     sneg      NA sneg
227 1905     sneg -100.00 sneg
228 1906     sneg -100.00 sneg
229 1907     sneg      NA sneg
230 1908     sneg  -66.67 sneg
231 1909     sneg      NA sneg
232 1910     sneg  -66.67 sneg
233 1911     sneg  -66.67 sneg
234 1912     sneg      NA sneg
235 1913     sneg      NA sneg
236 1914     sneg -100.00 sneg
237 1915     sneg      NA sneg
238 1916     sneg  -83.33 sneg
239 1917     sneg      NA sneg
240 1918     sneg      NA sneg
241 1919     sneg      NA sneg
242 1920     sneg      NA sneg
243 1921     sneg      NA sneg
244 1922     sneg      NA sneg
245 1923     sneg      NA sneg
246 1924     sneg      NA sneg
247 1925     sneg      NA sneg
248 1926     sneg      NA sneg
249 1927     sneg      NA sneg
250 1928     sneg      NA sneg
251 1929     sneg      NA sneg
252 1930     sneg      NA sneg
253 1931     sneg      NA sneg
254 1932     sneg      NA sneg
255 1933     sneg      NA sneg
256 1934     sneg      NA sneg
257 1935     sneg      NA sneg
258 1936     sneg      NA sneg
259 1937     sneg      NA sneg
260 1938     sneg  -52.78 sneg
261 1939     sneg      NA sneg
262 1940     sneg      NA sneg
263 1941     sneg      NA sneg
264 1942     sneg  -58.54 sneg
265 1943     sneg      NA sneg
266 1944     sneg      NA sneg
267 1945     sneg      NA sneg
268 1946     sneg      NA sneg
269 1947     sneg      NA sneg
270 1948     sneg      NA sneg
271 1949     sneg      NA sneg
272 1950     sneg      NA sneg
273 1951     sneg      NA sneg
274 1952     sneg      NA sneg
275 1953     sneg      NA sneg
276 1954     sneg      NA sneg
277 1955     sneg      NA sneg
278 1956     sneg      NA sneg
279 1957     sneg      NA sneg
280 1958     sneg      NA sneg
281 1959     sneg      NA sneg
282 1960     sneg      NA sneg
283 1961     sneg      NA sneg
284 1962     sneg      NA sneg
285 1963     sneg      NA sneg
286 1964     sneg      NA sneg
287 1965     sneg      NA sneg
288 1966     sneg      NA sneg
289 1967     sneg      NA sneg
290 1968     sneg      NA sneg
291 1969     sneg      NA sneg
292 1970     sneg      NA sneg
293 1971     sneg      NA sneg
294 1972     sneg      NA sneg
295 1973     sneg      NA sneg
296 1974     sneg      NA sneg
297 1975     sneg      NA sneg
298 1976     sneg  -53.09 sneg
299 1977     sneg      NA sneg
300 1978     sneg  -59.26 sneg
301 1979     sneg  -61.73 sneg
302 1980     sneg  -67.07 sneg
303 1981     sneg      NA sneg
304 1982     sneg      NA sneg
305 1983     sneg  -58.54 sneg
306 1984     sneg  -63.41 sneg
307 1985     sneg      NA sneg
308 1986     sneg      NA sneg
309 1987     sneg  -74.39 sneg
310 1988     sneg  -52.44 sneg
311 1989     sneg      NA sneg
312 1990     sneg      NA sneg
313 1991     sneg      NA sneg
314 1992     sneg      NA sneg
315 1993     sneg      NA sneg
316 1994     sneg  -54.88 sneg
317 1995     sneg      NA sneg
318 1996     sneg      NA sneg
319 1997     sneg      NA sneg
320 1998     sneg      NA sneg
321 1999     sneg  -59.76 sneg
322 2000     sneg  -64.63 sneg
323 2001     sneg      NA sneg
324 2002     sneg      NA sneg
325 2003     sneg  -64.63 sneg
326 2004     sneg      NA sneg
327 2005     sneg  -63.41 sneg
328 2006     sneg      NA sneg
329 2007     sneg  -70.73 sneg
330 2008     sneg      NA sneg
331 2009     sneg  -51.22 sneg
332 2010     sneg      NA sneg
333 2011     sneg      NA sneg
334 1901     spoz      NA spoz
335 1902     spoz  100.00 spoz
336 1903     spoz  100.00 spoz
337 1904     spoz      NA spoz
338 1905     spoz      NA spoz
339 1906     spoz      NA spoz
340 1907     spoz      NA spoz
341 1908     spoz      NA spoz
342 1909     spoz      NA spoz
343 1910     spoz      NA spoz
344 1911     spoz      NA spoz
345 1912     spoz      NA spoz
346 1913     spoz      NA spoz
347 1914     spoz      NA spoz
348 1915     spoz      NA spoz
349 1916     spoz      NA spoz
350 1917     spoz   83.33 spoz
351 1918     spoz      NA spoz
352 1919     spoz   75.00 spoz
353 1920     spoz   62.50 spoz
354 1921     spoz      NA spoz
355 1922     spoz      NA spoz
356 1923     spoz      NA spoz
357 1924     spoz      NA spoz
358 1925     spoz   66.67 spoz
359 1926     spoz   60.00 spoz
360 1927     spoz      NA spoz
361 1928     spoz      NA spoz
362 1929     spoz      NA spoz
363 1930     spoz      NA spoz
364 1931     spoz      NA spoz
365 1932     spoz      NA spoz
366 1933     spoz      NA spoz
367 1934     spoz      NA spoz
368 1935     spoz      NA spoz
369 1936     spoz      NA spoz
370 1937     spoz      NA spoz
371 1938     spoz      NA spoz
372 1939     spoz      NA spoz
373 1940     spoz   56.41 spoz
374 1941     spoz      NA spoz
375 1942     spoz      NA spoz
376 1943     spoz      NA spoz
377 1944     spoz      NA spoz
378 1945     spoz      NA spoz
379 1946     spoz      NA spoz
380 1947     spoz      NA spoz
381 1948     spoz      NA spoz
382 1949     spoz   50.91 spoz
383 1950     spoz   57.14 spoz
384 1951     spoz      NA spoz
385 1952     spoz      NA spoz
386 1953     spoz      NA spoz
387 1954     spoz      NA spoz
388 1955     spoz      NA spoz
389 1956     spoz      NA spoz
390 1957     spoz      NA spoz
391 1958     spoz      NA spoz
392 1959     spoz      NA spoz
393 1960     spoz      NA spoz
394 1961     spoz      NA spoz
395 1962     spoz      NA spoz
396 1963     spoz      NA spoz
397 1964     spoz      NA spoz
398 1965     spoz      NA spoz
399 1966     spoz      NA spoz
400 1967     spoz      NA spoz
401 1968     spoz      NA spoz
402 1969     spoz      NA spoz
403 1970     spoz      NA spoz
404 1971     spoz      NA spoz
405 1972     spoz      NA spoz
406 1973     spoz      NA spoz
407 1974     spoz      NA spoz
408 1975     spoz      NA spoz
409 1976     spoz      NA spoz
410 1977     spoz      NA spoz
411 1978     spoz      NA spoz
412 1979     spoz      NA spoz
413 1980     spoz      NA spoz
414 1981     spoz      NA spoz
415 1982     spoz   53.66 spoz
416 1983     spoz      NA spoz
417 1984     spoz      NA spoz
418 1985     spoz      NA spoz
419 1986     spoz      NA spoz
420 1987     spoz      NA spoz
421 1988     spoz      NA spoz
422 1989     spoz   57.32 spoz
423 1990     spoz   53.66 spoz
424 1991     spoz   52.44 spoz
425 1992     spoz   67.07 spoz
426 1993     spoz      NA spoz
427 1994     spoz      NA spoz
428 1995     spoz      NA spoz
429 1996     spoz      NA spoz
430 1997     spoz   85.37 spoz
431 1998     spoz   79.27 spoz
432 1999     spoz      NA spoz
433 2000     spoz      NA spoz
434 2001     spoz   74.39 spoz
435 2002     spoz      NA spoz
436 2003     spoz      NA spoz
437 2004     spoz   92.68 spoz
438 2005     spoz      NA spoz
439 2006     spoz      NA spoz
440 2007     spoz      NA spoz
441 2008     spoz      NA spoz
442 2009     spoz      NA spoz
443 2010     spoz      NA spoz
444 2011     spoz      NA spoz

-- 
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone     +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
                       +4 0766 71 76 58
FAX:                +4 0230 52 16 64
silvic.usv.ro

	[[alternative HTML version deleted]]

