Non scalable unit in tikz
up vote
6
down vote
favorite
Is there a non scalable unit in tikz?
I have the following picture,
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
Some elements, like the line width, the arrowheads or the text aren't affected by the scale=2
option. I would like the circles to behave in the same fashion. Is this possible? I tried using different units for the circle radius (cm, pt, em)
but I had no luck.
tikz-pgf scale
add a comment |
up vote
6
down vote
favorite
Is there a non scalable unit in tikz?
I have the following picture,
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
Some elements, like the line width, the arrowheads or the text aren't affected by the scale=2
option. I would like the circles to behave in the same fashion. Is this possible? I tried using different units for the circle radius (cm, pt, em)
but I had no luck.
tikz-pgf scale
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
Is there a non scalable unit in tikz?
I have the following picture,
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
Some elements, like the line width, the arrowheads or the text aren't affected by the scale=2
option. I would like the circles to behave in the same fashion. Is this possible? I tried using different units for the circle radius (cm, pt, em)
but I had no luck.
tikz-pgf scale
Is there a non scalable unit in tikz?
I have the following picture,
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
Some elements, like the line width, the arrowheads or the text aren't affected by the scale=2
option. I would like the circles to behave in the same fashion. Is this possible? I tried using different units for the circle radius (cm, pt, em)
but I had no luck.
tikz-pgf scale
tikz-pgf scale
edited 44 mins ago
jfbu
45.6k65147
45.6k65147
asked 1 hour ago
mendus
895
895
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
4
down vote
You could use a node instead of a circle. nodes don't scale either:
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) node[circle,inner sep=0.025cm,fill=black]{} node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
Yes, scale really scales mainly distances, not line widths etc. Here are some ways to scale the line widths. Note that I do not recommend using pgflowlevelsynccm
here as it screws up the bounding box (which is why there are vspace
s added), but I list it for completeness.
documentclass{report}
usepackage[margin=1in]{geometry}
usepackage{tikz}
begin{document}
subsection*{Original post}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Using texttt{textbackslash pgflowlevelsynccm}}
vspace*{2cm}
begin{tikzpicture}[>=latex, scale=2]
pgflowlevelsynccm
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
vspace*{1cm}
subsection*{Reading out transformation and applying it to lines etc.}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (2)}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (3)}
begin{tikzpicture}[>=latex, scale=2,transform shape]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
end{document}
And I would draw the thing probably like this:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[>=latex, scale=2,bullet/.style={transform shape,inner
sep=0.05cm,fill,circle}]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,shorten >=2pt,line width=myscale*pgflinewidth]
(0,0) node[bullet,label=below:$P$]{}
-- (2,1) node[bullet,label=below:$Q$]{};
end{tikzpicture}
end{document}
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
You could use a node instead of a circle. nodes don't scale either:
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) node[circle,inner sep=0.025cm,fill=black]{} node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
add a comment |
up vote
4
down vote
You could use a node instead of a circle. nodes don't scale either:
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) node[circle,inner sep=0.025cm,fill=black]{} node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
add a comment |
up vote
4
down vote
up vote
4
down vote
You could use a node instead of a circle. nodes don't scale either:
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) node[circle,inner sep=0.025cm,fill=black]{} node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
You could use a node instead of a circle. nodes don't scale either:
documentclass{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) node[circle,inner sep=0.025cm,fill=black]{} node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
end{document}
answered 52 mins ago
Ulrike Fischer
184k7289665
184k7289665
add a comment |
add a comment |
up vote
3
down vote
Yes, scale really scales mainly distances, not line widths etc. Here are some ways to scale the line widths. Note that I do not recommend using pgflowlevelsynccm
here as it screws up the bounding box (which is why there are vspace
s added), but I list it for completeness.
documentclass{report}
usepackage[margin=1in]{geometry}
usepackage{tikz}
begin{document}
subsection*{Original post}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Using texttt{textbackslash pgflowlevelsynccm}}
vspace*{2cm}
begin{tikzpicture}[>=latex, scale=2]
pgflowlevelsynccm
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
vspace*{1cm}
subsection*{Reading out transformation and applying it to lines etc.}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (2)}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (3)}
begin{tikzpicture}[>=latex, scale=2,transform shape]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
end{document}
And I would draw the thing probably like this:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[>=latex, scale=2,bullet/.style={transform shape,inner
sep=0.05cm,fill,circle}]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,shorten >=2pt,line width=myscale*pgflinewidth]
(0,0) node[bullet,label=below:$P$]{}
-- (2,1) node[bullet,label=below:$Q$]{};
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
Yes, scale really scales mainly distances, not line widths etc. Here are some ways to scale the line widths. Note that I do not recommend using pgflowlevelsynccm
here as it screws up the bounding box (which is why there are vspace
s added), but I list it for completeness.
documentclass{report}
usepackage[margin=1in]{geometry}
usepackage{tikz}
begin{document}
subsection*{Original post}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Using texttt{textbackslash pgflowlevelsynccm}}
vspace*{2cm}
begin{tikzpicture}[>=latex, scale=2]
pgflowlevelsynccm
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
vspace*{1cm}
subsection*{Reading out transformation and applying it to lines etc.}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (2)}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (3)}
begin{tikzpicture}[>=latex, scale=2,transform shape]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
end{document}
And I would draw the thing probably like this:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[>=latex, scale=2,bullet/.style={transform shape,inner
sep=0.05cm,fill,circle}]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,shorten >=2pt,line width=myscale*pgflinewidth]
(0,0) node[bullet,label=below:$P$]{}
-- (2,1) node[bullet,label=below:$Q$]{};
end{tikzpicture}
end{document}
add a comment |
up vote
3
down vote
up vote
3
down vote
Yes, scale really scales mainly distances, not line widths etc. Here are some ways to scale the line widths. Note that I do not recommend using pgflowlevelsynccm
here as it screws up the bounding box (which is why there are vspace
s added), but I list it for completeness.
documentclass{report}
usepackage[margin=1in]{geometry}
usepackage{tikz}
begin{document}
subsection*{Original post}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Using texttt{textbackslash pgflowlevelsynccm}}
vspace*{2cm}
begin{tikzpicture}[>=latex, scale=2]
pgflowlevelsynccm
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
vspace*{1cm}
subsection*{Reading out transformation and applying it to lines etc.}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (2)}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (3)}
begin{tikzpicture}[>=latex, scale=2,transform shape]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
end{document}
And I would draw the thing probably like this:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[>=latex, scale=2,bullet/.style={transform shape,inner
sep=0.05cm,fill,circle}]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,shorten >=2pt,line width=myscale*pgflinewidth]
(0,0) node[bullet,label=below:$P$]{}
-- (2,1) node[bullet,label=below:$Q$]{};
end{tikzpicture}
end{document}
Yes, scale really scales mainly distances, not line widths etc. Here are some ways to scale the line widths. Note that I do not recommend using pgflowlevelsynccm
here as it screws up the bounding box (which is why there are vspace
s added), but I list it for completeness.
documentclass{report}
usepackage[margin=1in]{geometry}
usepackage{tikz}
begin{document}
subsection*{Original post}
begin{tikzpicture}[>=latex, scale=2]
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Using texttt{textbackslash pgflowlevelsynccm}}
vspace*{2cm}
begin{tikzpicture}[>=latex, scale=2]
pgflowlevelsynccm
draw[->] (0,0) -- (2,1);
filldraw (0,0) circle[radius=0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
vspace*{1cm}
subsection*{Reading out transformation and applying it to lines etc.}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[anchor=north] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[anchor=north] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (2)}
begin{tikzpicture}[>=latex, scale=2]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
subsection*{Reading out transformation and applying it to lines etc. (3)}
begin{tikzpicture}[>=latex, scale=2,transform shape]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,line width=myscale*pgflinewidth] (0,0) -- (2,1);
filldraw[,line width=myscale*pgflinewidth]
(0,0) circle[radius=myscale*0.05cm] node[below=myscale*0.05cm] {$P$}
(2,1) circle[radius=myscale*0.05cm] node[above=myscale*0.05cm] {$Q$};
end{tikzpicture}
end{document}
And I would draw the thing probably like this:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[>=latex, scale=2,bullet/.style={transform shape,inner
sep=0.05cm,fill,circle}]
pgfgettransformentries{myscale}{tmp}{tmp}{tmp}{tmp}{tmp}
draw[->,shorten >=2pt,line width=myscale*pgflinewidth]
(0,0) node[bullet,label=below:$P$]{}
-- (2,1) node[bullet,label=below:$Q$]{};
end{tikzpicture}
end{document}
answered 1 hour ago
marmot
82.3k492175
82.3k492175
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%2f464315%2fnon-scalable-unit-in-tikz%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