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

Can two people see the same photon?

Dinosaur Word Search, Letter Solve, and Unscramble

Does a random sequence of vectors span a Hilbert space?

Table formatting with tabularx?

Can I cut the hair of a conjured korred with a blade made of precious material to harvest that material from the korred?

How to resize main filesystem

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

The Nth Gryphon Number

How does the body cool itself in a stillsuit?

What should one know about term logic before studying propositional and predicate logic?

Russian equivalents of おしゃれは足元から (Every good outfit starts with the shoes)

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

How do I say "this must not happen"?

Should man-made satellites feature an intelligent inverted "cow catcher"?

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

Sally's older brother

Problem with display of presentation

Marquee sign letters

Plotting a Maclaurin series

How to ask rejected full-time candidates to apply to teach individual courses?

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

What helicopter has the most rotor blades?

What is the proper term for etching or digging of wall to hide conduit of cables

How to achieve cat-like agility?



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

          Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

          How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

          Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...