I have a problem, and I don't know how I can solve this :(

Could you please help me?

The parameter "Fim de Vida" does not plote in graficMy Grafic.

enter code here\usepackage{xcolor}
        show sum on top/.style={
            /pgfplots/scatter/@post marker code/.append code={%
                \path let \p1=($(normalized axis cs:%
                            \pgfkeysvalueof{/data point/x},%
                            \pgfkeysvalueof{/data point/y})%
                            -(normalized axis cs:\pgfkeysvalueof{/data point/x},0)$)
                in node[
                    at={(normalized axis cs:%
                            \pgfkeysvalueof{/data point/x},%
                            \pgfkeysvalueof{/data point/y})%
                {\pgfmathprintnumber{\pgfkeysvalueof{/data point/y}}};
Year    OneCol  SecCol  ThirdCol ForthCol FifthCol SixthCol
1    6.58E-08 1.44E-08 5.42E-08 4.02E-08 2.30E-08 -6.02E-09 
2    2.42E-09 3.17E-10 1.19E-09 8.85E-10 5.07E-10 -1.22E-10
3    1.53E-08 3.17E-10 1.19E-09 8.85E-10 5.54E-10 6.88E-10

      bar width=0.26cm,
      tick label style={/pgf/number format/1000 sep=,font=\footnotesize},
      ybar stacked,
      stack negative=on previous, %<- moved down
      bar width=1em,
      axis on top,
      ymajorgrids = true,
      enlarge x limits={true, abs value=0.75},
      nodes near coords={},
      legend style={
      draw=none },
      xticklabels={Cenário Um, Cenário Dois, Cenário Três}
      \addplot [fill=cyan!70,draw=black!70] table [y index=1] {\datatable};
      \addplot [fill=green!90,draw=black!70] table [y index=2] {\datatable};
      \addplot [fill=teal!90,draw=black!70]table [y index=3] {\datatable};
      \addplot [fill=violet!90,draw=black!70]table [y index=4] {\datatable};
      \addplot [fill=lime!90,draw=black!70]table [y index=5] {\datatable};
      \addplot [fill=magenta!90,draw=black!70]table [y index=6] {\datatable};
  \legend{Bateria, Estrutura,Motor,Pneu,Uso,Final de Vida}
  \caption{Impacts by category relative to baseline building with conventional building envelope}

Try replacing stack negative=on previous with stack negative=separate.

But note that one of the negative values is very close to zero. You will not be able to see it in the graph.

| improve this answer | |
  • It workssss =) Thank you very much – Thaise Campos Aug 17 '19 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.