How to move the pgf-spectra boxes in a TikZ
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclass{standalone}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
begin{scope}{xshift=-4cm,yshift=1cm}
pgfspectra[width=5cm]
end{scope}
end{tikzpicture}
end{document}
Here is the output it renders:
tikz-pgf
add a comment |
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclass{standalone}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
begin{scope}{xshift=-4cm,yshift=1cm}
pgfspectra[width=5cm]
end{scope}
end{tikzpicture}
end{document}
Here is the output it renders:
tikz-pgf
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
3 hours ago
So one fix would be to use thepgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?
– sab hoque
3 hours ago
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
3 hours ago
Can't you just put the spectra insavebox
es, which is the usual way to avoid nestingtikzpicture
s?
– marmot
22 mins ago
add a comment |
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclass{standalone}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
begin{scope}{xshift=-4cm,yshift=1cm}
pgfspectra[width=5cm]
end{scope}
end{tikzpicture}
end{document}
Here is the output it renders:
tikz-pgf
I am trying to draw a diagram that looks approximately like this:
The red boxes are the items I would like to add to the diagram. They represent spectra lines that can be generated using the pgf-spectra
package (https://ctan.org/pkg/pgf-spectra?lang=en). When I try to use a scope to move the box like in my not working example below, the spectra box is not moved. I was wondering if it were possible to move the spectra boxes at all, either in the document or by changing code in the package .sty
files
My MNWE:
documentclass{standalone}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
% -- this part below is what I want to move but it does not behave correctly
begin{scope}{xshift=-4cm,yshift=1cm}
pgfspectra[width=5cm]
end{scope}
end{tikzpicture}
end{document}
Here is the output it renders:
tikz-pgf
tikz-pgf
asked 3 hours ago
sab hoque
1,284318
1,284318
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
3 hours ago
So one fix would be to use thepgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?
– sab hoque
3 hours ago
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
3 hours ago
Can't you just put the spectra insavebox
es, which is the usual way to avoid nestingtikzpicture
s?
– marmot
22 mins ago
add a comment |
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
3 hours ago
So one fix would be to use thepgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?
– sab hoque
3 hours ago
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
3 hours ago
Can't you just put the spectra insavebox
es, which is the usual way to avoid nestingtikzpicture
s?
– marmot
22 mins ago
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
3 hours ago
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
3 hours ago
So one fix would be to use the
pgfspectra
as the main one and do all the rest of my drawing with respect to the zero point that pgfspectra
sets? If that's the case, in my original question I wanted multiple pgfspectra
bars at different locations in the one tikzpicture, is that possible?– sab hoque
3 hours ago
So one fix would be to use the
pgfspectra
as the main one and do all the rest of my drawing with respect to the zero point that pgfspectra
sets? If that's the case, in my original question I wanted multiple pgfspectra
bars at different locations in the one tikzpicture, is that possible?– sab hoque
3 hours ago
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
3 hours ago
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
3 hours ago
Can't you just put the spectra in
savebox
es, which is the usual way to avoid nesting tikzpicture
s?– marmot
22 mins ago
Can't you just put the spectra in
savebox
es, which is the usual way to avoid nesting tikzpicture
s?– marmot
22 mins ago
add a comment |
2 Answers
2
active
oldest
votes
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
begin{scope}[shift={(-10cm,.5cm)}]
% adapted from pgf-spectra.sty
pgfkeys{/wl/.cd,width=5cm,height=1cm}
foreach x in {380,...,780}%
{%
pgfmathparse{wlwidth/(abs(wlend-wlbegin))}edefxscale{pgfmathresult}
edefwl@linewidth{xscale pt}
wlcolor{x}%
pgfmathparse{(x-380)*xscale}edefwl@currentx{pgfmathresult pt}%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
}%
end{scope}
makeatother
end{tikzpicture}
end{document}
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
Did exactly that see below
– sab hoque
1 hour ago
1
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
setlength{unitlength}{1cm}
thicklines
begin{picture}(0,0)
put(-5,2.5) {parbox{4cm}{pgfspectra[lines={390,490,540,690},absorption,height=0.5cm,width=5cm]}}
put(-5,2) {parbox{4cm}{pgfspectra[lines={395,495,545,695},absorption,height=0.5cm,width=5cm]}}
put(-5,1.5) {parbox{4cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm]}}
put(-5,1) {parbox{4cm}{pgfspectra[lines={405,505,555,705},absorption,height=0.5cm,width=5cm]}}
put(-5,0.5) {parbox{4cm}{pgfspectra[lines={410,510,560,710},absorption,height=0.5cm,width=5cm]}}
put(-5,-0.5) {parbox{14cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm,line width=4pt]}}
end{picture}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
end{tikzpicture}
tikz[overlay,remember picture]{node at (-2.8,-0.5) {Widening of absorption lines};}
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%2f468364%2fhow-to-move-the-pgf-spectra-boxes-in-a-tikz%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
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
begin{scope}[shift={(-10cm,.5cm)}]
% adapted from pgf-spectra.sty
pgfkeys{/wl/.cd,width=5cm,height=1cm}
foreach x in {380,...,780}%
{%
pgfmathparse{wlwidth/(abs(wlend-wlbegin))}edefxscale{pgfmathresult}
edefwl@linewidth{xscale pt}
wlcolor{x}%
pgfmathparse{(x-380)*xscale}edefwl@currentx{pgfmathresult pt}%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
}%
end{scope}
makeatother
end{tikzpicture}
end{document}
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
Did exactly that see below
– sab hoque
1 hour ago
1
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
add a comment |
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
begin{scope}[shift={(-10cm,.5cm)}]
% adapted from pgf-spectra.sty
pgfkeys{/wl/.cd,width=5cm,height=1cm}
foreach x in {380,...,780}%
{%
pgfmathparse{wlwidth/(abs(wlend-wlbegin))}edefxscale{pgfmathresult}
edefwl@linewidth{xscale pt}
wlcolor{x}%
pgfmathparse{(x-380)*xscale}edefwl@currentx{pgfmathresult pt}%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
}%
end{scope}
makeatother
end{tikzpicture}
end{document}
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
Did exactly that see below
– sab hoque
1 hour ago
1
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
add a comment |
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
begin{scope}[shift={(-10cm,.5cm)}]
% adapted from pgf-spectra.sty
pgfkeys{/wl/.cd,width=5cm,height=1cm}
foreach x in {380,...,780}%
{%
pgfmathparse{wlwidth/(abs(wlend-wlbegin))}edefxscale{pgfmathresult}
edefwl@linewidth{xscale pt}
wlcolor{x}%
pgfmathparse{(x-380)*xscale}edefwl@currentx{pgfmathresult pt}%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
}%
end{scope}
makeatother
end{tikzpicture}
end{document}
WARNING: This is a workaround for a simple use case. It does not provide any of the complex options the package will offer. If you wanted these, the package would need to be fixed.
With a bit of reverse engineering you can get something like the following. It copies some internal parts from pgf-spectra
to avoid nesting tikzpictures which are preventing your scope from shifting. You may still set width and height keys.
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
makeatletter
begin{scope}[shift={(-10cm,.5cm)}]
% adapted from pgf-spectra.sty
pgfkeys{/wl/.cd,width=5cm,height=1cm}
foreach x in {380,...,780}%
{%
pgfmathparse{wlwidth/(abs(wlend-wlbegin))}edefxscale{pgfmathresult}
edefwl@linewidth{xscale pt}
wlcolor{x}%
pgfmathparse{(x-380)*xscale}edefwl@currentx{pgfmathresult pt}%
draw[wltemp,line width=wl@linewidth] (wl@currentx,0) -- ++(0,wlheight);%
}%
end{scope}
makeatother
end{tikzpicture}
end{document}
edited 2 hours ago
answered 3 hours ago
TeXnician
24.5k63086
24.5k63086
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
Did exactly that see below
– sab hoque
1 hour ago
1
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
add a comment |
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
Did exactly that see below
– sab hoque
1 hour ago
1
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
Hmm. I will try to copy some code from the internal code and see if I can get the other settings (like absorption lines and start and end) Thanks for the help.
– sab hoque
3 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
I can't seem to find the code that specifies the line width and specific emission lines in the internal code, could you tell me which line numbers they are or make an edit?
– sab hoque
2 hours ago
1
1
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
@sabhoque Probably somewhere near all those auxiliary functions at the end but as I said this is more of a workaround because the package concept is bad. If you want to get all of its features you should consider returning to the package's syntax, position them with means like parboxes and then use overlays to get the connections.
– TeXnician
2 hours ago
Did exactly that see below
– sab hoque
1 hour ago
Did exactly that see below
– sab hoque
1 hour ago
1
1
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
@sabhoque Above (+1) ;)
– TeXnician
1 hour ago
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
setlength{unitlength}{1cm}
thicklines
begin{picture}(0,0)
put(-5,2.5) {parbox{4cm}{pgfspectra[lines={390,490,540,690},absorption,height=0.5cm,width=5cm]}}
put(-5,2) {parbox{4cm}{pgfspectra[lines={395,495,545,695},absorption,height=0.5cm,width=5cm]}}
put(-5,1.5) {parbox{4cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm]}}
put(-5,1) {parbox{4cm}{pgfspectra[lines={405,505,555,705},absorption,height=0.5cm,width=5cm]}}
put(-5,0.5) {parbox{4cm}{pgfspectra[lines={410,510,560,710},absorption,height=0.5cm,width=5cm]}}
put(-5,-0.5) {parbox{14cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm,line width=4pt]}}
end{picture}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
end{tikzpicture}
tikz[overlay,remember picture]{node at (-2.8,-0.5) {Widening of absorption lines};}
end{document}
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
setlength{unitlength}{1cm}
thicklines
begin{picture}(0,0)
put(-5,2.5) {parbox{4cm}{pgfspectra[lines={390,490,540,690},absorption,height=0.5cm,width=5cm]}}
put(-5,2) {parbox{4cm}{pgfspectra[lines={395,495,545,695},absorption,height=0.5cm,width=5cm]}}
put(-5,1.5) {parbox{4cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm]}}
put(-5,1) {parbox{4cm}{pgfspectra[lines={405,505,555,705},absorption,height=0.5cm,width=5cm]}}
put(-5,0.5) {parbox{4cm}{pgfspectra[lines={410,510,560,710},absorption,height=0.5cm,width=5cm]}}
put(-5,-0.5) {parbox{14cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm,line width=4pt]}}
end{picture}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
end{tikzpicture}
tikz[overlay,remember picture]{node at (-2.8,-0.5) {Widening of absorption lines};}
end{document}
add a comment |
I have made a workaround using TeXnician's suggestions:
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
setlength{unitlength}{1cm}
thicklines
begin{picture}(0,0)
put(-5,2.5) {parbox{4cm}{pgfspectra[lines={390,490,540,690},absorption,height=0.5cm,width=5cm]}}
put(-5,2) {parbox{4cm}{pgfspectra[lines={395,495,545,695},absorption,height=0.5cm,width=5cm]}}
put(-5,1.5) {parbox{4cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm]}}
put(-5,1) {parbox{4cm}{pgfspectra[lines={405,505,555,705},absorption,height=0.5cm,width=5cm]}}
put(-5,0.5) {parbox{4cm}{pgfspectra[lines={410,510,560,710},absorption,height=0.5cm,width=5cm]}}
put(-5,-0.5) {parbox{14cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm,line width=4pt]}}
end{picture}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
end{tikzpicture}
tikz[overlay,remember picture]{node at (-2.8,-0.5) {Widening of absorption lines};}
end{document}
I have made a workaround using TeXnician's suggestions:
documentclass{article}
usepackage{tikz}
usepackage{pgf-spectra}
usetikzlibrary{decorations.pathmorphing}
tikzset{snake it/.style={decorate, decoration=snake}}
begin{document}
setlength{unitlength}{1cm}
thicklines
begin{picture}(0,0)
put(-5,2.5) {parbox{4cm}{pgfspectra[lines={390,490,540,690},absorption,height=0.5cm,width=5cm]}}
put(-5,2) {parbox{4cm}{pgfspectra[lines={395,495,545,695},absorption,height=0.5cm,width=5cm]}}
put(-5,1.5) {parbox{4cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm]}}
put(-5,1) {parbox{4cm}{pgfspectra[lines={405,505,555,705},absorption,height=0.5cm,width=5cm]}}
put(-5,0.5) {parbox{4cm}{pgfspectra[lines={410,510,560,710},absorption,height=0.5cm,width=5cm]}}
put(-5,-0.5) {parbox{14cm}{pgfspectra[lines={400,500,550,700},absorption,height=0.5cm,width=5cm,line width=4pt]}}
end{picture}
begin{tikzpicture}
draw[-latex] (0,0) ++ (60:1.5) arc (60:120:1.5);
draw[-latex] (0,0) ++ (-120:1.5) arc (-120:-60:1.5);
draw[snake it,blue,-latex,thick] (0,1) -- (-4,1);
draw[snake it,red,-latex,thick] (0,-1) -- (-4,-1);
draw[snake it,-latex,thick] (-1,0) -- (-4,0);
draw[fill=yellow!50] (0,0) circle (1);
end{tikzpicture}
tikz[overlay,remember picture]{node at (-2.8,-0.5) {Widening of absorption lines};}
end{document}
answered 1 hour ago
sab hoque
1,284318
1,284318
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%2f468364%2fhow-to-move-the-pgf-spectra-boxes-in-a-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
The package is actually nesting tikzpictures which may explain odd behavior.
– TeXnician
3 hours ago
So one fix would be to use the
pgfspectra
as the main one and do all the rest of my drawing with respect to the zero point thatpgfspectra
sets? If that's the case, in my original question I wanted multiplepgfspectra
bars at different locations in the one tikzpicture, is that possible?– sab hoque
3 hours ago
The package concept is flawed. I've added a workaround but it's not perfect. The best solution would be to contact the package author and show him your use case that his package does not support. Maybe he will provide an update.
– TeXnician
3 hours ago
Can't you just put the spectra in
savebox
es, which is the usual way to avoid nestingtikzpicture
s?– marmot
22 mins ago