Reducing math font in tikz pgf plot












4














my tick numbers are overlapping, reducing the fontsize with 'tiny' just change the size of the x but the subindex keeps the same size. How can I reduce the size also of the subindexes in the tick labels?



Sample



documentclass[10pt,a4paper]{article}
usepackage{tikz}
usepackage{pgfplots}
usetikzlibrary{shapes,arrows,positioning,calc}

pgfplotsset{compat=1.16,
integral axis/.style={
axis lines=middle,
enlarge y limits=upper,
axis equal image, width=12cm,
xlabel=$x$, ylabel=$y$,
ytick=empty,
xticklabel style={font=small, text height=1.5ex, anchor=north},
samples=100
},
integral/.style={
domain=2:8,
samples=7
},
integral fill/.style={
integral,
draw=none, fill=#1,
},
integral fill/.default=cyan!10,
integral line/.style={
integral,
very thick,
draw=#1
},
integral line/.default=black,
every tick label/.append style={font=large}
}



begin{document}
begin{figure}
begin{tikzpicture}[
% The function that is used for all the plots
declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
]
begin{axis}[
integral axis,
ymin=0,
xmin=0.75, xmax=9.25,
domain=1.5:8.5,
xtick={2,2.5,3,3.5,...,8},
xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
axis on top
]
addplot [integral fill=cyan!15] {f(x)} closedcycle;
addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
addplot [integral line=black] {f(x)};
addplot [integral, ycomb] {f(x)};
end{axis}
end{tikzpicture}
end{figure}
end{document}









share|improve this question






















  • How about rotating the tick labels instead of making them smaller?
    – marmot
    Dec 13 at 9:07










  • Hi mr. Marmot, nice Idea, how to do it?
    – Lin
    Dec 13 at 9:08










  • You could just add xticklabel style={rotate=-45,anchor=north west} to the options of the axis.
    – marmot
    Dec 13 at 9:17
















4














my tick numbers are overlapping, reducing the fontsize with 'tiny' just change the size of the x but the subindex keeps the same size. How can I reduce the size also of the subindexes in the tick labels?



Sample



documentclass[10pt,a4paper]{article}
usepackage{tikz}
usepackage{pgfplots}
usetikzlibrary{shapes,arrows,positioning,calc}

pgfplotsset{compat=1.16,
integral axis/.style={
axis lines=middle,
enlarge y limits=upper,
axis equal image, width=12cm,
xlabel=$x$, ylabel=$y$,
ytick=empty,
xticklabel style={font=small, text height=1.5ex, anchor=north},
samples=100
},
integral/.style={
domain=2:8,
samples=7
},
integral fill/.style={
integral,
draw=none, fill=#1,
},
integral fill/.default=cyan!10,
integral line/.style={
integral,
very thick,
draw=#1
},
integral line/.default=black,
every tick label/.append style={font=large}
}



begin{document}
begin{figure}
begin{tikzpicture}[
% The function that is used for all the plots
declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
]
begin{axis}[
integral axis,
ymin=0,
xmin=0.75, xmax=9.25,
domain=1.5:8.5,
xtick={2,2.5,3,3.5,...,8},
xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
axis on top
]
addplot [integral fill=cyan!15] {f(x)} closedcycle;
addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
addplot [integral line=black] {f(x)};
addplot [integral, ycomb] {f(x)};
end{axis}
end{tikzpicture}
end{figure}
end{document}









share|improve this question






















  • How about rotating the tick labels instead of making them smaller?
    – marmot
    Dec 13 at 9:07










  • Hi mr. Marmot, nice Idea, how to do it?
    – Lin
    Dec 13 at 9:08










  • You could just add xticklabel style={rotate=-45,anchor=north west} to the options of the axis.
    – marmot
    Dec 13 at 9:17














4












4








4







my tick numbers are overlapping, reducing the fontsize with 'tiny' just change the size of the x but the subindex keeps the same size. How can I reduce the size also of the subindexes in the tick labels?



Sample



documentclass[10pt,a4paper]{article}
usepackage{tikz}
usepackage{pgfplots}
usetikzlibrary{shapes,arrows,positioning,calc}

pgfplotsset{compat=1.16,
integral axis/.style={
axis lines=middle,
enlarge y limits=upper,
axis equal image, width=12cm,
xlabel=$x$, ylabel=$y$,
ytick=empty,
xticklabel style={font=small, text height=1.5ex, anchor=north},
samples=100
},
integral/.style={
domain=2:8,
samples=7
},
integral fill/.style={
integral,
draw=none, fill=#1,
},
integral fill/.default=cyan!10,
integral line/.style={
integral,
very thick,
draw=#1
},
integral line/.default=black,
every tick label/.append style={font=large}
}



begin{document}
begin{figure}
begin{tikzpicture}[
% The function that is used for all the plots
declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
]
begin{axis}[
integral axis,
ymin=0,
xmin=0.75, xmax=9.25,
domain=1.5:8.5,
xtick={2,2.5,3,3.5,...,8},
xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
axis on top
]
addplot [integral fill=cyan!15] {f(x)} closedcycle;
addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
addplot [integral line=black] {f(x)};
addplot [integral, ycomb] {f(x)};
end{axis}
end{tikzpicture}
end{figure}
end{document}









share|improve this question













my tick numbers are overlapping, reducing the fontsize with 'tiny' just change the size of the x but the subindex keeps the same size. How can I reduce the size also of the subindexes in the tick labels?



Sample



documentclass[10pt,a4paper]{article}
usepackage{tikz}
usepackage{pgfplots}
usetikzlibrary{shapes,arrows,positioning,calc}

pgfplotsset{compat=1.16,
integral axis/.style={
axis lines=middle,
enlarge y limits=upper,
axis equal image, width=12cm,
xlabel=$x$, ylabel=$y$,
ytick=empty,
xticklabel style={font=small, text height=1.5ex, anchor=north},
samples=100
},
integral/.style={
domain=2:8,
samples=7
},
integral fill/.style={
integral,
draw=none, fill=#1,
},
integral fill/.default=cyan!10,
integral line/.style={
integral,
very thick,
draw=#1
},
integral line/.default=black,
every tick label/.append style={font=large}
}



begin{document}
begin{figure}
begin{tikzpicture}[
% The function that is used for all the plots
declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
]
begin{axis}[
integral axis,
ymin=0,
xmin=0.75, xmax=9.25,
domain=1.5:8.5,
xtick={2,2.5,3,3.5,...,8},
xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
axis on top
]
addplot [integral fill=cyan!15] {f(x)} closedcycle;
addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
addplot [integral line=black] {f(x)};
addplot [integral, ycomb] {f(x)};
end{axis}
end{tikzpicture}
end{figure}
end{document}






tikz-pgf tikz-styles






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 13 at 8:48









Lin

3117




3117












  • How about rotating the tick labels instead of making them smaller?
    – marmot
    Dec 13 at 9:07










  • Hi mr. Marmot, nice Idea, how to do it?
    – Lin
    Dec 13 at 9:08










  • You could just add xticklabel style={rotate=-45,anchor=north west} to the options of the axis.
    – marmot
    Dec 13 at 9:17


















  • How about rotating the tick labels instead of making them smaller?
    – marmot
    Dec 13 at 9:07










  • Hi mr. Marmot, nice Idea, how to do it?
    – Lin
    Dec 13 at 9:08










  • You could just add xticklabel style={rotate=-45,anchor=north west} to the options of the axis.
    – marmot
    Dec 13 at 9:17
















How about rotating the tick labels instead of making them smaller?
– marmot
Dec 13 at 9:07




How about rotating the tick labels instead of making them smaller?
– marmot
Dec 13 at 9:07












Hi mr. Marmot, nice Idea, how to do it?
– Lin
Dec 13 at 9:08




Hi mr. Marmot, nice Idea, how to do it?
– Lin
Dec 13 at 9:08












You could just add xticklabel style={rotate=-45,anchor=north west} to the options of the axis.
– marmot
Dec 13 at 9:17




You could just add xticklabel style={rotate=-45,anchor=north west} to the options of the axis.
– marmot
Dec 13 at 9:17










2 Answers
2






active

oldest

votes


















0














You can use the scalerel package and scaleto,



$x_{scaleto{0}{3pt}}$


Will produce



enter image description here



Where $x_{0}$ produces



enter image description here






share|improve this answer





























    3














    I'd probably do



    documentclass[10pt,a4paper]{article}
    usepackage{tikz}
    usepackage{pgfplots}
    usetikzlibrary{shapes,arrows,positioning,calc}

    pgfplotsset{compat=1.16,
    integral axis/.style={
    axis lines=middle,
    enlarge y limits=upper,
    axis equal image, width=12cm,
    xlabel=$x$, ylabel=$y$,
    ytick=empty,
    xticklabel style={font=small, text height=1.5ex, anchor=north},
    samples=100
    },
    integral/.style={
    domain=2:8,
    samples=7
    },
    integral fill/.style={
    integral,
    draw=none, fill=#1,
    },
    integral fill/.default=cyan!10,
    integral line/.style={
    integral,
    very thick,
    draw=#1
    },
    integral line/.default=black,
    every tick label/.append style={font=large}
    }



    begin{document}
    begin{figure}
    begin{tikzpicture}[
    % The function that is used for all the plots
    declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
    ]
    begin{axis}[
    integral axis,
    ymin=0,
    xmin=0.75, xmax=9.25,
    domain=1.5:8.5,
    xtick={2,2.5,3,3.5,...,8},
    xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
    axis on top,
    xticklabel style={rotate=-45,anchor=north west,yshift=5pt}
    ]
    addplot [integral fill=cyan!15] {f(x)} closedcycle;
    addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
    addplot [integral line=black] {f(x)};
    addplot [integral, ycomb] {f(x)};
    end{axis}
    end{tikzpicture}
    end{figure}
    end{document}


    enter image description here






    share|improve this answer





















      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%2f464655%2freducing-math-font-in-tikz-pgf-plot%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









      0














      You can use the scalerel package and scaleto,



      $x_{scaleto{0}{3pt}}$


      Will produce



      enter image description here



      Where $x_{0}$ produces



      enter image description here






      share|improve this answer


























        0














        You can use the scalerel package and scaleto,



        $x_{scaleto{0}{3pt}}$


        Will produce



        enter image description here



        Where $x_{0}$ produces



        enter image description here






        share|improve this answer
























          0












          0








          0






          You can use the scalerel package and scaleto,



          $x_{scaleto{0}{3pt}}$


          Will produce



          enter image description here



          Where $x_{0}$ produces



          enter image description here






          share|improve this answer












          You can use the scalerel package and scaleto,



          $x_{scaleto{0}{3pt}}$


          Will produce



          enter image description here



          Where $x_{0}$ produces



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 13 at 9:15









          William Miller

          1162




          1162























              3














              I'd probably do



              documentclass[10pt,a4paper]{article}
              usepackage{tikz}
              usepackage{pgfplots}
              usetikzlibrary{shapes,arrows,positioning,calc}

              pgfplotsset{compat=1.16,
              integral axis/.style={
              axis lines=middle,
              enlarge y limits=upper,
              axis equal image, width=12cm,
              xlabel=$x$, ylabel=$y$,
              ytick=empty,
              xticklabel style={font=small, text height=1.5ex, anchor=north},
              samples=100
              },
              integral/.style={
              domain=2:8,
              samples=7
              },
              integral fill/.style={
              integral,
              draw=none, fill=#1,
              },
              integral fill/.default=cyan!10,
              integral line/.style={
              integral,
              very thick,
              draw=#1
              },
              integral line/.default=black,
              every tick label/.append style={font=large}
              }



              begin{document}
              begin{figure}
              begin{tikzpicture}[
              % The function that is used for all the plots
              declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
              ]
              begin{axis}[
              integral axis,
              ymin=0,
              xmin=0.75, xmax=9.25,
              domain=1.5:8.5,
              xtick={2,2.5,3,3.5,...,8},
              xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
              axis on top,
              xticklabel style={rotate=-45,anchor=north west,yshift=5pt}
              ]
              addplot [integral fill=cyan!15] {f(x)} closedcycle;
              addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
              addplot [integral line=black] {f(x)};
              addplot [integral, ycomb] {f(x)};
              end{axis}
              end{tikzpicture}
              end{figure}
              end{document}


              enter image description here






              share|improve this answer


























                3














                I'd probably do



                documentclass[10pt,a4paper]{article}
                usepackage{tikz}
                usepackage{pgfplots}
                usetikzlibrary{shapes,arrows,positioning,calc}

                pgfplotsset{compat=1.16,
                integral axis/.style={
                axis lines=middle,
                enlarge y limits=upper,
                axis equal image, width=12cm,
                xlabel=$x$, ylabel=$y$,
                ytick=empty,
                xticklabel style={font=small, text height=1.5ex, anchor=north},
                samples=100
                },
                integral/.style={
                domain=2:8,
                samples=7
                },
                integral fill/.style={
                integral,
                draw=none, fill=#1,
                },
                integral fill/.default=cyan!10,
                integral line/.style={
                integral,
                very thick,
                draw=#1
                },
                integral line/.default=black,
                every tick label/.append style={font=large}
                }



                begin{document}
                begin{figure}
                begin{tikzpicture}[
                % The function that is used for all the plots
                declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
                ]
                begin{axis}[
                integral axis,
                ymin=0,
                xmin=0.75, xmax=9.25,
                domain=1.5:8.5,
                xtick={2,2.5,3,3.5,...,8},
                xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
                axis on top,
                xticklabel style={rotate=-45,anchor=north west,yshift=5pt}
                ]
                addplot [integral fill=cyan!15] {f(x)} closedcycle;
                addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
                addplot [integral line=black] {f(x)};
                addplot [integral, ycomb] {f(x)};
                end{axis}
                end{tikzpicture}
                end{figure}
                end{document}


                enter image description here






                share|improve this answer
























                  3












                  3








                  3






                  I'd probably do



                  documentclass[10pt,a4paper]{article}
                  usepackage{tikz}
                  usepackage{pgfplots}
                  usetikzlibrary{shapes,arrows,positioning,calc}

                  pgfplotsset{compat=1.16,
                  integral axis/.style={
                  axis lines=middle,
                  enlarge y limits=upper,
                  axis equal image, width=12cm,
                  xlabel=$x$, ylabel=$y$,
                  ytick=empty,
                  xticklabel style={font=small, text height=1.5ex, anchor=north},
                  samples=100
                  },
                  integral/.style={
                  domain=2:8,
                  samples=7
                  },
                  integral fill/.style={
                  integral,
                  draw=none, fill=#1,
                  },
                  integral fill/.default=cyan!10,
                  integral line/.style={
                  integral,
                  very thick,
                  draw=#1
                  },
                  integral line/.default=black,
                  every tick label/.append style={font=large}
                  }



                  begin{document}
                  begin{figure}
                  begin{tikzpicture}[
                  % The function that is used for all the plots
                  declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
                  ]
                  begin{axis}[
                  integral axis,
                  ymin=0,
                  xmin=0.75, xmax=9.25,
                  domain=1.5:8.5,
                  xtick={2,2.5,3,3.5,...,8},
                  xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
                  axis on top,
                  xticklabel style={rotate=-45,anchor=north west,yshift=5pt}
                  ]
                  addplot [integral fill=cyan!15] {f(x)} closedcycle;
                  addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
                  addplot [integral line=black] {f(x)};
                  addplot [integral, ycomb] {f(x)};
                  end{axis}
                  end{tikzpicture}
                  end{figure}
                  end{document}


                  enter image description here






                  share|improve this answer












                  I'd probably do



                  documentclass[10pt,a4paper]{article}
                  usepackage{tikz}
                  usepackage{pgfplots}
                  usetikzlibrary{shapes,arrows,positioning,calc}

                  pgfplotsset{compat=1.16,
                  integral axis/.style={
                  axis lines=middle,
                  enlarge y limits=upper,
                  axis equal image, width=12cm,
                  xlabel=$x$, ylabel=$y$,
                  ytick=empty,
                  xticklabel style={font=small, text height=1.5ex, anchor=north},
                  samples=100
                  },
                  integral/.style={
                  domain=2:8,
                  samples=7
                  },
                  integral fill/.style={
                  integral,
                  draw=none, fill=#1,
                  },
                  integral fill/.default=cyan!10,
                  integral line/.style={
                  integral,
                  very thick,
                  draw=#1
                  },
                  integral line/.default=black,
                  every tick label/.append style={font=large}
                  }



                  begin{document}
                  begin{figure}
                  begin{tikzpicture}[
                  % The function that is used for all the plots
                  declare function={f(x)=x/5-cos(deg(x*1.85))/2+2;}
                  ]
                  begin{axis}[
                  integral axis,
                  ymin=0,
                  xmin=0.75, xmax=9.25,
                  domain=1.5:8.5,
                  xtick={2,2.5,3,3.5,...,8},
                  xticklabels={$x_0$, $x_{1/2}$, $x_1$,$x_{3/2}$,$x_2$,$x_{5/2}$,$x_3$,,,,$x_{N-1}$,$x_{N-frac{1}{2}}$,$x_N$},
                  axis on top,
                  xticklabel style={rotate=-45,anchor=north west,yshift=5pt}
                  ]
                  addplot [integral fill=cyan!15] {f(x)} closedcycle;
                  addplot [very thick, cyan!75!blue] {f(x)} node [anchor=south] {$y=f(x)$};
                  addplot [integral line=black] {f(x)};
                  addplot [integral, ycomb] {f(x)};
                  end{axis}
                  end{tikzpicture}
                  end{figure}
                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 13 at 9:19









                  marmot

                  85.9k499183




                  85.9k499183






























                      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%2f464655%2freducing-math-font-in-tikz-pgf-plot%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

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix