Area Plot

109 views
Skip to first unread message

Marlon de Castro Vasconcelos

unread,
Oct 20, 2020, 3:53:50 PM10/20/20
to ggplot2
Hi everyone

I try to make an area plot with FAO pesticides data, using Year(x), Value(y) and pesticide type. But…..


FAOSTAT_PESTICIDAS_10-16-2020.csv
Captura de Tela 2020-10-20 às 16.50.58.png

Ben Bolker

unread,
Oct 20, 2020, 4:11:13 PM10/20/20
to ggp...@googlegroups.com
@accidentalaRt !

ggplot() + geom_bar(data=df, stat='identity',
aes(
x=Year,
y=Value,
color=Item,
fill = Item),
position = 'stack')


seems to work OK
> --
> --
> You received this message because you are subscribed to the ggplot2
> mailing list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_hadley_devtools_wiki_Reproducibility&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=3_Lrr9EdGez1H5l2yea0j1xtKpljkhY3nO3H_hK-B8E&e=>
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__groups.google.com_group_ggplot2&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=VKE0Qh-fT2vgMVJ1kF_rQkrBJdzXz8B_G7UWlr2pxVI&e=>
>
> ---
> You received this message because you are subscribed to the Google
> Groups "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ggplot2+u...@googlegroups.com
> <mailto:ggplot2+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ggplot2/F6746A98-E56C-4B04-A35F-792FD35AE24A%40uergs.edu.br
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msgid_ggplot2_F6746A98-2DE56C-2D4B04-2DA35F-2D792FD35AE24A-2540uergs.edu.br-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dfooter&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=LMlZQ9iv5DF6Yy8uwX43TOqNeEDmL2aRgt7stYafBAE&e=>.
>
>
>
> I don’t know what I doing wrong
>
> Code
>
> ggplot() + geom_area(data=df, aes(
> x=Year,
> y=Value,
> color=Item,
>  fill = Item),
>  position = 'stack')
>
>
>
> Data
>
>
>
> --
> --
> You received this message because you are subscribed to the ggplot2
> mailing list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_hadley_devtools_wiki_Reproducibility&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=3_Lrr9EdGez1H5l2yea0j1xtKpljkhY3nO3H_hK-B8E&e=>
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__groups.google.com_group_ggplot2&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=VKE0Qh-fT2vgMVJ1kF_rQkrBJdzXz8B_G7UWlr2pxVI&e=>
>
> ---
> You received this message because you are subscribed to the Google
> Groups "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ggplot2+u...@googlegroups.com
> <mailto:ggplot2+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ggplot2/F6746A98-E56C-4B04-A35F-792FD35AE24A%40uergs.edu.br
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msgid_ggplot2_F6746A98-2DE56C-2D4B04-2DA35F-2D792FD35AE24A-2540uergs.edu.br-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dfooter&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=LMlZQ9iv5DF6Yy8uwX43TOqNeEDmL2aRgt7stYafBAE&e=>.
>
>
>
>
> Dr. Marlon de Castro Vasconcelos
> Prof. Assistant of Ecology
> State University of Rio Grande do Sul - UERGS
> Três Passos, Brazil
> Lattes: http://lattes.cnpq.br/5983932516722444
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__lattes.cnpq.br_5983932516722444&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=Nvy6JVln0mvJuxnnj5qwVKS6S8HmOBfEtKQD7Be58z8&e=>
> ORCID: https://orcid.org/0000-0003-4645-0157
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__orcid.org_0000-2D0003-2D4645-2D0157&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=CYUDOIfiz8yNY9sfM8sE0gCaWfjIfM_AZ0VEd5X0itI&e=>
>
>
>
>
>
>
> --
> --
> You received this message because you are subscribed to the ggplot2
> mailing list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_hadley_devtools_wiki_Reproducibility&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=3_Lrr9EdGez1H5l2yea0j1xtKpljkhY3nO3H_hK-B8E&e=>
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__groups.google.com_group_ggplot2&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=VKE0Qh-fT2vgMVJ1kF_rQkrBJdzXz8B_G7UWlr2pxVI&e=>
>
> ---
> You received this message because you are subscribed to the Google
> Groups "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ggplot2+u...@googlegroups.com
> <mailto:ggplot2+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ggplot2/F6746A98-E56C-4B04-A35F-792FD35AE24A%40uergs.edu.br
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_msgid_ggplot2_F6746A98-2DE56C-2D4B04-2DA35F-2D792FD35AE24A-2540uergs.edu.br-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dfooter&d=DwMFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=zImN_5GfvN5clExGCfuTCw&m=vg2EMvK7JEl94rTjzzBzzkY-WS4tHj52o-tDy8t2WR4&s=LMlZQ9iv5DF6Yy8uwX43TOqNeEDmL2aRgt7stYafBAE&e=>.

Marlon de Castro Vasconcelos

unread,
Oct 20, 2020, 5:04:29 PM10/20/20
to Ben Bolker, ggp...@googlegroups.com
Thanks a lot

I fell stupid….. (kkkkkk) to forgot  “stat = identity”…..




Dr. Marlon de Castro Vasconcelos
Prof. Assistant of Ecology
State University of Rio Grande do Sul - UERGS
Três Passos, Brazil
Reply all
Reply to author
Forward
0 new messages