Axis environment problem: how to determine a domain in which x and y axes are to be drawn?












3














Let's suppose that I want to put a neat graph of the sinus function in my document. Its source code is:



documentclass{standalone}

usepackage{pgfplots}
usepackage{tikz}

usetikzlibrary{calc}

begin{document}

begin{tikzpicture}
begin{axis}[
xmin=-11, xmax=11,
ymin=-1.2, ymax=1.2,
grid=both,
axis lines=middle,
minor tick num=9,
axis line style={latex-latex},
ticklabel style={font=tiny},
axis equal
]

addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};

end{axis}
end{tikzpicture}

end{document}


And it produces the following result:



enter image description here



So far so good. But let's say I want to cram my graph into a single page nicely, without it taking too much space. For this reason, I want to "cut" y axis on both sides, in other words, I want to force the graph to only be rendered on an interval (a,b) (on y axis) without changing the aspect ratio of the graph or its size.



For this purpose, I wrote ymin=-1.2, ymax=1.2, as you can see in my MWE. But this has no effect on the graph! Why? I searched the internet for a solution to my problem for a long time, but found none.



Please, provide me a technique with which I will be able to achieve this task. This goes for limiting the interval on which the whole axis is rendered for x axis as well, not just y axis (which won't be used in this case, but could definitely be useful in my future endeavours). Thank you in advance!










share|improve this question



























    3














    Let's suppose that I want to put a neat graph of the sinus function in my document. Its source code is:



    documentclass{standalone}

    usepackage{pgfplots}
    usepackage{tikz}

    usetikzlibrary{calc}

    begin{document}

    begin{tikzpicture}
    begin{axis}[
    xmin=-11, xmax=11,
    ymin=-1.2, ymax=1.2,
    grid=both,
    axis lines=middle,
    minor tick num=9,
    axis line style={latex-latex},
    ticklabel style={font=tiny},
    axis equal
    ]

    addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};

    end{axis}
    end{tikzpicture}

    end{document}


    And it produces the following result:



    enter image description here



    So far so good. But let's say I want to cram my graph into a single page nicely, without it taking too much space. For this reason, I want to "cut" y axis on both sides, in other words, I want to force the graph to only be rendered on an interval (a,b) (on y axis) without changing the aspect ratio of the graph or its size.



    For this purpose, I wrote ymin=-1.2, ymax=1.2, as you can see in my MWE. But this has no effect on the graph! Why? I searched the internet for a solution to my problem for a long time, but found none.



    Please, provide me a technique with which I will be able to achieve this task. This goes for limiting the interval on which the whole axis is rendered for x axis as well, not just y axis (which won't be used in this case, but could definitely be useful in my future endeavours). Thank you in advance!










    share|improve this question

























      3












      3








      3


      1





      Let's suppose that I want to put a neat graph of the sinus function in my document. Its source code is:



      documentclass{standalone}

      usepackage{pgfplots}
      usepackage{tikz}

      usetikzlibrary{calc}

      begin{document}

      begin{tikzpicture}
      begin{axis}[
      xmin=-11, xmax=11,
      ymin=-1.2, ymax=1.2,
      grid=both,
      axis lines=middle,
      minor tick num=9,
      axis line style={latex-latex},
      ticklabel style={font=tiny},
      axis equal
      ]

      addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};

      end{axis}
      end{tikzpicture}

      end{document}


      And it produces the following result:



      enter image description here



      So far so good. But let's say I want to cram my graph into a single page nicely, without it taking too much space. For this reason, I want to "cut" y axis on both sides, in other words, I want to force the graph to only be rendered on an interval (a,b) (on y axis) without changing the aspect ratio of the graph or its size.



      For this purpose, I wrote ymin=-1.2, ymax=1.2, as you can see in my MWE. But this has no effect on the graph! Why? I searched the internet for a solution to my problem for a long time, but found none.



      Please, provide me a technique with which I will be able to achieve this task. This goes for limiting the interval on which the whole axis is rendered for x axis as well, not just y axis (which won't be used in this case, but could definitely be useful in my future endeavours). Thank you in advance!










      share|improve this question













      Let's suppose that I want to put a neat graph of the sinus function in my document. Its source code is:



      documentclass{standalone}

      usepackage{pgfplots}
      usepackage{tikz}

      usetikzlibrary{calc}

      begin{document}

      begin{tikzpicture}
      begin{axis}[
      xmin=-11, xmax=11,
      ymin=-1.2, ymax=1.2,
      grid=both,
      axis lines=middle,
      minor tick num=9,
      axis line style={latex-latex},
      ticklabel style={font=tiny},
      axis equal
      ]

      addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};

      end{axis}
      end{tikzpicture}

      end{document}


      And it produces the following result:



      enter image description here



      So far so good. But let's say I want to cram my graph into a single page nicely, without it taking too much space. For this reason, I want to "cut" y axis on both sides, in other words, I want to force the graph to only be rendered on an interval (a,b) (on y axis) without changing the aspect ratio of the graph or its size.



      For this purpose, I wrote ymin=-1.2, ymax=1.2, as you can see in my MWE. But this has no effect on the graph! Why? I searched the internet for a solution to my problem for a long time, but found none.



      Please, provide me a technique with which I will be able to achieve this task. This goes for limiting the interval on which the whole axis is rendered for x axis as well, not just y axis (which won't be used in this case, but could definitely be useful in my future endeavours). Thank you in advance!







      tikz-pgf pgfplots graphs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 8 at 18:18









      Gregor Perčič

      981211




      981211






















          2 Answers
          2






          active

          oldest

          votes


















          4














          The reason ymin/ymax doesn't work is I think that you have axis equal, and you haven't changed the width/height of the axis, so the default size is used.



          If you remove axis equal the y-limits will apply, but the x and y unit vectors will not be equal, which you want, if I understand correctly.



          So instead try setting the size, by adding something like width=10cm,height=4cm to the axis options.



          enter image description here



          documentclass[border=5mm]{standalone}

          usepackage{pgfplots}
          begin{document}

          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-1.2, ymax=1.2,
          width=10cm,height=4cm,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=2,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal
          ]

          addplot[line width=0.7pt, blue, samples=500, domain=-11:11]{sin((x*180)/pi)};

          end{axis}
          end{tikzpicture}

          end{document}





          share|improve this answer























          • Great solution. How do I preserve my minor grid count though?
            – Gregor Perčič
            Dec 8 at 18:36










          • @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
            – Torbjørn T.
            Dec 8 at 18:39










          • No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
            – Gregor Perčič
            Dec 8 at 18:41










          • @GregorPerčič minor x tick num=8, minor y tick num=2,?
            – Torbjørn T.
            Dec 8 at 18:43










          • Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
            – Gregor Perčič
            Dec 8 at 18:46





















          3














          Use axis equal image instead of axis equal.



          enter image description here



          documentclass[border=3mm]{standalone}
          usepackage{pgfplots}
          usepackage{tikz}
          usetikzlibrary{calc}

          begin{document}
          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-2, ymax=2,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=1,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal image
          ]
          addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};
          end{axis}
          end{tikzpicture}
          end{document}





          share|improve this answer























          • Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
            – Gregor Perčič
            Dec 8 at 18:40










          • @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
            – nidhin
            Dec 8 at 18:54










          • I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
            – Gregor Perčič
            Dec 8 at 18:59











          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463844%2faxis-environment-problem-how-to-determine-a-domain-in-which-x-and-y-axes-are-to%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          The reason ymin/ymax doesn't work is I think that you have axis equal, and you haven't changed the width/height of the axis, so the default size is used.



          If you remove axis equal the y-limits will apply, but the x and y unit vectors will not be equal, which you want, if I understand correctly.



          So instead try setting the size, by adding something like width=10cm,height=4cm to the axis options.



          enter image description here



          documentclass[border=5mm]{standalone}

          usepackage{pgfplots}
          begin{document}

          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-1.2, ymax=1.2,
          width=10cm,height=4cm,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=2,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal
          ]

          addplot[line width=0.7pt, blue, samples=500, domain=-11:11]{sin((x*180)/pi)};

          end{axis}
          end{tikzpicture}

          end{document}





          share|improve this answer























          • Great solution. How do I preserve my minor grid count though?
            – Gregor Perčič
            Dec 8 at 18:36










          • @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
            – Torbjørn T.
            Dec 8 at 18:39










          • No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
            – Gregor Perčič
            Dec 8 at 18:41










          • @GregorPerčič minor x tick num=8, minor y tick num=2,?
            – Torbjørn T.
            Dec 8 at 18:43










          • Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
            – Gregor Perčič
            Dec 8 at 18:46


















          4














          The reason ymin/ymax doesn't work is I think that you have axis equal, and you haven't changed the width/height of the axis, so the default size is used.



          If you remove axis equal the y-limits will apply, but the x and y unit vectors will not be equal, which you want, if I understand correctly.



          So instead try setting the size, by adding something like width=10cm,height=4cm to the axis options.



          enter image description here



          documentclass[border=5mm]{standalone}

          usepackage{pgfplots}
          begin{document}

          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-1.2, ymax=1.2,
          width=10cm,height=4cm,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=2,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal
          ]

          addplot[line width=0.7pt, blue, samples=500, domain=-11:11]{sin((x*180)/pi)};

          end{axis}
          end{tikzpicture}

          end{document}





          share|improve this answer























          • Great solution. How do I preserve my minor grid count though?
            – Gregor Perčič
            Dec 8 at 18:36










          • @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
            – Torbjørn T.
            Dec 8 at 18:39










          • No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
            – Gregor Perčič
            Dec 8 at 18:41










          • @GregorPerčič minor x tick num=8, minor y tick num=2,?
            – Torbjørn T.
            Dec 8 at 18:43










          • Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
            – Gregor Perčič
            Dec 8 at 18:46
















          4












          4








          4






          The reason ymin/ymax doesn't work is I think that you have axis equal, and you haven't changed the width/height of the axis, so the default size is used.



          If you remove axis equal the y-limits will apply, but the x and y unit vectors will not be equal, which you want, if I understand correctly.



          So instead try setting the size, by adding something like width=10cm,height=4cm to the axis options.



          enter image description here



          documentclass[border=5mm]{standalone}

          usepackage{pgfplots}
          begin{document}

          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-1.2, ymax=1.2,
          width=10cm,height=4cm,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=2,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal
          ]

          addplot[line width=0.7pt, blue, samples=500, domain=-11:11]{sin((x*180)/pi)};

          end{axis}
          end{tikzpicture}

          end{document}





          share|improve this answer














          The reason ymin/ymax doesn't work is I think that you have axis equal, and you haven't changed the width/height of the axis, so the default size is used.



          If you remove axis equal the y-limits will apply, but the x and y unit vectors will not be equal, which you want, if I understand correctly.



          So instead try setting the size, by adding something like width=10cm,height=4cm to the axis options.



          enter image description here



          documentclass[border=5mm]{standalone}

          usepackage{pgfplots}
          begin{document}

          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-1.2, ymax=1.2,
          width=10cm,height=4cm,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=2,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal
          ]

          addplot[line width=0.7pt, blue, samples=500, domain=-11:11]{sin((x*180)/pi)};

          end{axis}
          end{tikzpicture}

          end{document}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 8 at 18:47

























          answered Dec 8 at 18:26









          Torbjørn T.

          154k13245435




          154k13245435












          • Great solution. How do I preserve my minor grid count though?
            – Gregor Perčič
            Dec 8 at 18:36










          • @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
            – Torbjørn T.
            Dec 8 at 18:39










          • No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
            – Gregor Perčič
            Dec 8 at 18:41










          • @GregorPerčič minor x tick num=8, minor y tick num=2,?
            – Torbjørn T.
            Dec 8 at 18:43










          • Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
            – Gregor Perčič
            Dec 8 at 18:46




















          • Great solution. How do I preserve my minor grid count though?
            – Gregor Perčič
            Dec 8 at 18:36










          • @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
            – Torbjørn T.
            Dec 8 at 18:39










          • No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
            – Gregor Perčič
            Dec 8 at 18:41










          • @GregorPerčič minor x tick num=8, minor y tick num=2,?
            – Torbjørn T.
            Dec 8 at 18:43










          • Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
            – Gregor Perčič
            Dec 8 at 18:46


















          Great solution. How do I preserve my minor grid count though?
          – Gregor Perčič
          Dec 8 at 18:36




          Great solution. How do I preserve my minor grid count though?
          – Gregor Perčič
          Dec 8 at 18:36












          @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
          – Torbjørn T.
          Dec 8 at 18:39




          @GregorPerčič As mentioned in a comment in my code, I changed the minor grid count. Just change it back, or to a more suitable number (as in nidhin's answer, which I think is better than mine). I changed it because it was, to my eyes, far too dense.
          – Torbjørn T.
          Dec 8 at 18:39












          No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
          – Gregor Perčič
          Dec 8 at 18:41




          No no, I find the squeezed lines horrible as well. What I meant so say is how do I preserve the equal spacing of both vertical and horizontal lines of the grid. I'd like to have my grid exactly the same way it is in my provided picture.
          – Gregor Perčič
          Dec 8 at 18:41












          @GregorPerčič minor x tick num=8, minor y tick num=2,?
          – Torbjørn T.
          Dec 8 at 18:43




          @GregorPerčič minor x tick num=8, minor y tick num=2,?
          – Torbjørn T.
          Dec 8 at 18:43












          Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
          – Gregor Perčič
          Dec 8 at 18:46






          Thank you! I'm embarrassed that I didn't figure it out sooner! I just had to look at your code (at first I didn't notice the "x" subargument). minor x tick num=9, minor y tick num=1, will do for me.
          – Gregor Perčič
          Dec 8 at 18:46













          3














          Use axis equal image instead of axis equal.



          enter image description here



          documentclass[border=3mm]{standalone}
          usepackage{pgfplots}
          usepackage{tikz}
          usetikzlibrary{calc}

          begin{document}
          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-2, ymax=2,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=1,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal image
          ]
          addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};
          end{axis}
          end{tikzpicture}
          end{document}





          share|improve this answer























          • Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
            – Gregor Perčič
            Dec 8 at 18:40










          • @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
            – nidhin
            Dec 8 at 18:54










          • I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
            – Gregor Perčič
            Dec 8 at 18:59
















          3














          Use axis equal image instead of axis equal.



          enter image description here



          documentclass[border=3mm]{standalone}
          usepackage{pgfplots}
          usepackage{tikz}
          usetikzlibrary{calc}

          begin{document}
          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-2, ymax=2,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=1,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal image
          ]
          addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};
          end{axis}
          end{tikzpicture}
          end{document}





          share|improve this answer























          • Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
            – Gregor Perčič
            Dec 8 at 18:40










          • @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
            – nidhin
            Dec 8 at 18:54










          • I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
            – Gregor Perčič
            Dec 8 at 18:59














          3












          3








          3






          Use axis equal image instead of axis equal.



          enter image description here



          documentclass[border=3mm]{standalone}
          usepackage{pgfplots}
          usepackage{tikz}
          usetikzlibrary{calc}

          begin{document}
          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-2, ymax=2,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=1,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal image
          ]
          addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};
          end{axis}
          end{tikzpicture}
          end{document}





          share|improve this answer














          Use axis equal image instead of axis equal.



          enter image description here



          documentclass[border=3mm]{standalone}
          usepackage{pgfplots}
          usepackage{tikz}
          usetikzlibrary{calc}

          begin{document}
          begin{tikzpicture}
          begin{axis}[
          xmin=-11, xmax=11,
          ymin=-2, ymax=2,
          grid=both,
          axis lines=middle,
          minor x tick num=9,
          minor y tick num=1,
          axis line style={latex-latex},
          ticklabel style={font=tiny},
          axis equal image
          ]
          addplot[line width=0.7pt, blue, samples=500][domain=-11:11]{sin((x*180)/pi)};
          end{axis}
          end{tikzpicture}
          end{document}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 8 at 18:53

























          answered Dec 8 at 18:32









          nidhin

          3,342927




          3,342927












          • Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
            – Gregor Perčič
            Dec 8 at 18:40










          • @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
            – nidhin
            Dec 8 at 18:54










          • I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
            – Gregor Perčič
            Dec 8 at 18:59


















          • Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
            – Gregor Perčič
            Dec 8 at 18:40










          • @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
            – nidhin
            Dec 8 at 18:54










          • I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
            – Gregor Perčič
            Dec 8 at 18:59
















          Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
          – Gregor Perčič
          Dec 8 at 18:40




          Thank you for your answer. But how do I keep the "grid ratio" equal? The minor grid count on y axis is not spaced in the same way as on x axis. I'd like them to be the same.
          – Gregor Perčič
          Dec 8 at 18:40












          @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
          – nidhin
          Dec 8 at 18:54




          @GregorPerčič One way is to adjust the minor tick nums. See edited answer.
          – nidhin
          Dec 8 at 18:54












          I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
          – Gregor Perčič
          Dec 8 at 18:59




          I've already discussed this solution under Torbjørn's answer. Thank you nonetheless!
          – Gregor Perčič
          Dec 8 at 18:59


















          draft saved

          draft discarded




















































          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f463844%2faxis-environment-problem-how-to-determine-a-domain-in-which-x-and-y-axes-are-to%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

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents