Reducing math font in tikz pgf plot
up vote
3
down vote
favorite
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 |
up vote
3
down vote
favorite
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
2 hours ago
Hi mr. Marmot, nice Idea, how to do it?
– Lin
2 hours ago
You could just addxticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.
– marmot
2 hours ago
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
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 3 hours ago
Lin
3067
3067
How about rotating the tick labels instead of making them smaller?
– marmot
2 hours ago
Hi mr. Marmot, nice Idea, how to do it?
– Lin
2 hours ago
You could just addxticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.
– marmot
2 hours ago
add a comment |
How about rotating the tick labels instead of making them smaller?
– marmot
2 hours ago
Hi mr. Marmot, nice Idea, how to do it?
– Lin
2 hours ago
You could just addxticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.
– marmot
2 hours ago
How about rotating the tick labels instead of making them smaller?
– marmot
2 hours ago
How about rotating the tick labels instead of making them smaller?
– marmot
2 hours ago
Hi mr. Marmot, nice Idea, how to do it?
– Lin
2 hours ago
Hi mr. Marmot, nice Idea, how to do it?
– Lin
2 hours ago
You could just add
xticklabel style={rotate=-45,anchor=north west}
to the options of the axis
.– marmot
2 hours ago
You could just add
xticklabel style={rotate=-45,anchor=north west}
to the options of the axis
.– marmot
2 hours ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
New contributor
add a comment |
up vote
3
down vote
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',
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
up vote
0
down vote
accepted
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
New contributor
add a comment |
up vote
0
down vote
accepted
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
New contributor
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
New contributor
You can use the scalerel
package and scaleto
,
$x_{scaleto{0}{3pt}}$
Will produce
Where $x_{0}$
produces
New contributor
New contributor
answered 2 hours ago
William Miller
1162
1162
New contributor
New contributor
add a comment |
add a comment |
up vote
3
down vote
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 |
up vote
3
down vote
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 |
up vote
3
down vote
up vote
3
down vote
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 2 hours ago
marmot
82.9k493177
82.9k493177
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
2 hours ago
Hi mr. Marmot, nice Idea, how to do it?
– Lin
2 hours ago
You could just add
xticklabel style={rotate=-45,anchor=north west}
to the options of theaxis
.– marmot
2 hours ago