Reducing math font in tikz pgf plot
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?
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
add a comment |
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?
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
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 addxticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.
– marmot
Dec 13 at 9:17
add a comment |
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?
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
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?
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
tikz-pgf tikz-styles
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 addxticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.
– marmot
Dec 13 at 9:17
add a comment |
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 addxticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.
– 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
add a comment |
2 Answers
2
active
oldest
votes
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
add a comment |
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}
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
add a comment |
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
add a comment |
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
answered Dec 13 at 9:15
William Miller
1162
1162
add a comment |
add a comment |
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}
add a comment |
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}
add a comment |
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}
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}
answered Dec 13 at 9:19
marmot
85.9k499183
85.9k499183
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 theaxis
.– marmot
Dec 13 at 9:17