Changing order of draw operation in PGFPlots Announcing the arrival of Valued Associate #679:...

How does TikZ render an arc?

Getting representations of the Lie group out of representations of its Lie algebra

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

How do Java 8 default methods hеlp with lambdas?

Weaponising the Grasp-at-a-Distance spell

3D Masyu - A Die

Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?

What helicopter has the most rotor blades?

Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?

Google .dev domain strangely redirects to https

Sally's older brother

Is there a verb for listening stealthily?

Short story about astronauts fertilizing soil with their own bodies

Flight departed from the gate 5 min before scheduled departure time. Refund options

By what mechanism was the 2017 UK General Election called?

What are some likely causes to domain member PC losing contact to domain controller?

Any stored/leased 737s that could substitute for grounded MAXs?

Understanding piped commands in GNU/Linux

Inverse square law not accurate for non-point masses?

Besides transaction validation, are there any other uses of the Script language in Bitcoin

Where and when has Thucydides been studied?

Diophantine equation 3^a+1=3^b+5^c

Determine whether an integer is a palindrome

Why are current probes so expensive?



Changing order of draw operation in PGFPlots



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Can Pgfplots extra tick grid line be drawn behind the axis line?plotting two time series with boundsGrouped bar chartoverlapping labels in tikzPGFPLOTS: Insert a boxplot outside the chart axis labels, much like GNU RHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate origin












0















I've developed a pgfplots ybar chart with white horizontal grid lines over the vertical bars to help the reader judge the length of the bars. The "base" of the ybar chart (the x-axis) is set to y=1 so that I can see whether the normalized results are above or below the axis at y=1. My problem is that I'm having trouble drawing the black x-axis line at y=1 without it being overwritten by a white grid line.



documentclass[border=10pt]{standalone}
usepackage{pgfplots}
usepackage{pgfplotstable}
pgfplotsset{compat=newest}

begin{document}
pgfplotstableread[col sep=comma,header=false]{
Cat A, 1.06
Cat B, 0.92
Cat C, 1.01
Cat D, 1.04
Cat E, 0.88
}datatable
begin{tikzpicture}
begin{axis}[
ybar,
enlarge x limits=0.2,
height=4cm,
ymax=0.125,
ymin=-0.125,
xticklabels from table={datatable}{0},
xtick=data,
ytick={-0.1,-0.05,...,0.1},
yticklabels={0.90,0.95,1.00,1.05,1.10},
ytick pos=left,
ymajorgrids=true,
major grid style={thin,color=white},
axis on top,
ylabel={Normalized value},
x axis line style={draw opacity=0},
xtick style={draw=none},
xticklabel style={
rotate=90,
anchor=east,
}
]
addplot [fill=black,draw=none] table [x expr=coordindex, y expr=thisrowno{1}-1] {datatable};
draw [black,thin] (rel axis cs:0,0.5) -- (rel axis cs:1,0.5);
end{axis}
end{tikzpicture}
end{document}


clip1



If I remove axis on top, the x-axis is drawn correctly, but then I lose the white grid lines over the vertical bars.



clip2



How can I change my plot such that the x-axis is drawn last or in such a way that it is drawn on top of the grid line?









share







New contributor




jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I've developed a pgfplots ybar chart with white horizontal grid lines over the vertical bars to help the reader judge the length of the bars. The "base" of the ybar chart (the x-axis) is set to y=1 so that I can see whether the normalized results are above or below the axis at y=1. My problem is that I'm having trouble drawing the black x-axis line at y=1 without it being overwritten by a white grid line.



    documentclass[border=10pt]{standalone}
    usepackage{pgfplots}
    usepackage{pgfplotstable}
    pgfplotsset{compat=newest}

    begin{document}
    pgfplotstableread[col sep=comma,header=false]{
    Cat A, 1.06
    Cat B, 0.92
    Cat C, 1.01
    Cat D, 1.04
    Cat E, 0.88
    }datatable
    begin{tikzpicture}
    begin{axis}[
    ybar,
    enlarge x limits=0.2,
    height=4cm,
    ymax=0.125,
    ymin=-0.125,
    xticklabels from table={datatable}{0},
    xtick=data,
    ytick={-0.1,-0.05,...,0.1},
    yticklabels={0.90,0.95,1.00,1.05,1.10},
    ytick pos=left,
    ymajorgrids=true,
    major grid style={thin,color=white},
    axis on top,
    ylabel={Normalized value},
    x axis line style={draw opacity=0},
    xtick style={draw=none},
    xticklabel style={
    rotate=90,
    anchor=east,
    }
    ]
    addplot [fill=black,draw=none] table [x expr=coordindex, y expr=thisrowno{1}-1] {datatable};
    draw [black,thin] (rel axis cs:0,0.5) -- (rel axis cs:1,0.5);
    end{axis}
    end{tikzpicture}
    end{document}


    clip1



    If I remove axis on top, the x-axis is drawn correctly, but then I lose the white grid lines over the vertical bars.



    clip2



    How can I change my plot such that the x-axis is drawn last or in such a way that it is drawn on top of the grid line?









    share







    New contributor




    jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I've developed a pgfplots ybar chart with white horizontal grid lines over the vertical bars to help the reader judge the length of the bars. The "base" of the ybar chart (the x-axis) is set to y=1 so that I can see whether the normalized results are above or below the axis at y=1. My problem is that I'm having trouble drawing the black x-axis line at y=1 without it being overwritten by a white grid line.



      documentclass[border=10pt]{standalone}
      usepackage{pgfplots}
      usepackage{pgfplotstable}
      pgfplotsset{compat=newest}

      begin{document}
      pgfplotstableread[col sep=comma,header=false]{
      Cat A, 1.06
      Cat B, 0.92
      Cat C, 1.01
      Cat D, 1.04
      Cat E, 0.88
      }datatable
      begin{tikzpicture}
      begin{axis}[
      ybar,
      enlarge x limits=0.2,
      height=4cm,
      ymax=0.125,
      ymin=-0.125,
      xticklabels from table={datatable}{0},
      xtick=data,
      ytick={-0.1,-0.05,...,0.1},
      yticklabels={0.90,0.95,1.00,1.05,1.10},
      ytick pos=left,
      ymajorgrids=true,
      major grid style={thin,color=white},
      axis on top,
      ylabel={Normalized value},
      x axis line style={draw opacity=0},
      xtick style={draw=none},
      xticklabel style={
      rotate=90,
      anchor=east,
      }
      ]
      addplot [fill=black,draw=none] table [x expr=coordindex, y expr=thisrowno{1}-1] {datatable};
      draw [black,thin] (rel axis cs:0,0.5) -- (rel axis cs:1,0.5);
      end{axis}
      end{tikzpicture}
      end{document}


      clip1



      If I remove axis on top, the x-axis is drawn correctly, but then I lose the white grid lines over the vertical bars.



      clip2



      How can I change my plot such that the x-axis is drawn last or in such a way that it is drawn on top of the grid line?









      share







      New contributor




      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I've developed a pgfplots ybar chart with white horizontal grid lines over the vertical bars to help the reader judge the length of the bars. The "base" of the ybar chart (the x-axis) is set to y=1 so that I can see whether the normalized results are above or below the axis at y=1. My problem is that I'm having trouble drawing the black x-axis line at y=1 without it being overwritten by a white grid line.



      documentclass[border=10pt]{standalone}
      usepackage{pgfplots}
      usepackage{pgfplotstable}
      pgfplotsset{compat=newest}

      begin{document}
      pgfplotstableread[col sep=comma,header=false]{
      Cat A, 1.06
      Cat B, 0.92
      Cat C, 1.01
      Cat D, 1.04
      Cat E, 0.88
      }datatable
      begin{tikzpicture}
      begin{axis}[
      ybar,
      enlarge x limits=0.2,
      height=4cm,
      ymax=0.125,
      ymin=-0.125,
      xticklabels from table={datatable}{0},
      xtick=data,
      ytick={-0.1,-0.05,...,0.1},
      yticklabels={0.90,0.95,1.00,1.05,1.10},
      ytick pos=left,
      ymajorgrids=true,
      major grid style={thin,color=white},
      axis on top,
      ylabel={Normalized value},
      x axis line style={draw opacity=0},
      xtick style={draw=none},
      xticklabel style={
      rotate=90,
      anchor=east,
      }
      ]
      addplot [fill=black,draw=none] table [x expr=coordindex, y expr=thisrowno{1}-1] {datatable};
      draw [black,thin] (rel axis cs:0,0.5) -- (rel axis cs:1,0.5);
      end{axis}
      end{tikzpicture}
      end{document}


      clip1



      If I remove axis on top, the x-axis is drawn correctly, but then I lose the white grid lines over the vertical bars.



      clip2



      How can I change my plot such that the x-axis is drawn last or in such a way that it is drawn on top of the grid line?







      pgfplots





      share







      New contributor




      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      jg95624jg95624

      11




      11




      New contributor




      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      jg95624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          jg95624 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f485995%2fchanging-order-of-draw-operation-in-pgfplots%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          jg95624 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          jg95624 is a new contributor. Be nice, and check out our Code of Conduct.













          jg95624 is a new contributor. Be nice, and check out our Code of Conduct.












          jg95624 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f485995%2fchanging-order-of-draw-operation-in-pgfplots%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

          Schneeberg (Smreczany) Bibliografia | Menu...

          Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...