How do I color the graph in datavisualization?
MWE;
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{datavisualization}
usetikzlibrary{arrows,calc}
usetikzlibrary{shapes,positioning}
usetikzlibrary{decorations.markings}
usetikzlibrary{datavisualization.formats.functions}
defmytypesetter#1{
pgfmathparse{#1/pi}
pgfkeys{/pgf/number format/precision=2}
pgfmathroundtozerofill{pgfmathresult}
pgfmathifisint{pgfmathresult}{
pgfmathprintnumber{pgfmathresult}$pi$
}{
pgfmathprintnumber[/pgf/number format/frac, frac denom=2, frac whole=false]{pgfmathresult}$pi$
}
}
begin{document}
begin{tikzpicture}[>=latex]
datavisualization [
school book axes, %scientific axes=clean,
all axes={},
x axis={
label=$omega t$,
ticks={
step=(pi/2),
tick typesetter/.code=mytypesetter{##1},}
},
y axis={
label=$v$,
ticks=none,
},
style sheet=strong colors,
style sheet=vary dashing,
visualize as smooth line/.list={gerilim},
gerilim={label in legend={text={$v$}}},
]
data [set=gerilim, format=function] {
var x : interval [0:2*pi] samples 100;
func y = 2*sin(value x r);
};
end{tikzpicture}
end{document}
But that I want
.
How do I get this graph from my source code without using begin{axis}[... end{axis}?
tikz-pgf graphics tikz-shape tikz-decorations
add a comment |
MWE;
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{datavisualization}
usetikzlibrary{arrows,calc}
usetikzlibrary{shapes,positioning}
usetikzlibrary{decorations.markings}
usetikzlibrary{datavisualization.formats.functions}
defmytypesetter#1{
pgfmathparse{#1/pi}
pgfkeys{/pgf/number format/precision=2}
pgfmathroundtozerofill{pgfmathresult}
pgfmathifisint{pgfmathresult}{
pgfmathprintnumber{pgfmathresult}$pi$
}{
pgfmathprintnumber[/pgf/number format/frac, frac denom=2, frac whole=false]{pgfmathresult}$pi$
}
}
begin{document}
begin{tikzpicture}[>=latex]
datavisualization [
school book axes, %scientific axes=clean,
all axes={},
x axis={
label=$omega t$,
ticks={
step=(pi/2),
tick typesetter/.code=mytypesetter{##1},}
},
y axis={
label=$v$,
ticks=none,
},
style sheet=strong colors,
style sheet=vary dashing,
visualize as smooth line/.list={gerilim},
gerilim={label in legend={text={$v$}}},
]
data [set=gerilim, format=function] {
var x : interval [0:2*pi] samples 100;
func y = 2*sin(value x r);
};
end{tikzpicture}
end{document}
But that I want
.
How do I get this graph from my source code without using begin{axis}[... end{axis}?
tikz-pgf graphics tikz-shape tikz-decorations
add a comment |
MWE;
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{datavisualization}
usetikzlibrary{arrows,calc}
usetikzlibrary{shapes,positioning}
usetikzlibrary{decorations.markings}
usetikzlibrary{datavisualization.formats.functions}
defmytypesetter#1{
pgfmathparse{#1/pi}
pgfkeys{/pgf/number format/precision=2}
pgfmathroundtozerofill{pgfmathresult}
pgfmathifisint{pgfmathresult}{
pgfmathprintnumber{pgfmathresult}$pi$
}{
pgfmathprintnumber[/pgf/number format/frac, frac denom=2, frac whole=false]{pgfmathresult}$pi$
}
}
begin{document}
begin{tikzpicture}[>=latex]
datavisualization [
school book axes, %scientific axes=clean,
all axes={},
x axis={
label=$omega t$,
ticks={
step=(pi/2),
tick typesetter/.code=mytypesetter{##1},}
},
y axis={
label=$v$,
ticks=none,
},
style sheet=strong colors,
style sheet=vary dashing,
visualize as smooth line/.list={gerilim},
gerilim={label in legend={text={$v$}}},
]
data [set=gerilim, format=function] {
var x : interval [0:2*pi] samples 100;
func y = 2*sin(value x r);
};
end{tikzpicture}
end{document}
But that I want
.
How do I get this graph from my source code without using begin{axis}[... end{axis}?
tikz-pgf graphics tikz-shape tikz-decorations
MWE;
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{datavisualization}
usetikzlibrary{arrows,calc}
usetikzlibrary{shapes,positioning}
usetikzlibrary{decorations.markings}
usetikzlibrary{datavisualization.formats.functions}
defmytypesetter#1{
pgfmathparse{#1/pi}
pgfkeys{/pgf/number format/precision=2}
pgfmathroundtozerofill{pgfmathresult}
pgfmathifisint{pgfmathresult}{
pgfmathprintnumber{pgfmathresult}$pi$
}{
pgfmathprintnumber[/pgf/number format/frac, frac denom=2, frac whole=false]{pgfmathresult}$pi$
}
}
begin{document}
begin{tikzpicture}[>=latex]
datavisualization [
school book axes, %scientific axes=clean,
all axes={},
x axis={
label=$omega t$,
ticks={
step=(pi/2),
tick typesetter/.code=mytypesetter{##1},}
},
y axis={
label=$v$,
ticks=none,
},
style sheet=strong colors,
style sheet=vary dashing,
visualize as smooth line/.list={gerilim},
gerilim={label in legend={text={$v$}}},
]
data [set=gerilim, format=function] {
var x : interval [0:2*pi] samples 100;
func y = 2*sin(value x r);
};
end{tikzpicture}
end{document}
But that I want
.
How do I get this graph from my source code without using begin{axis}[... end{axis}?
tikz-pgf graphics tikz-shape tikz-decorations
tikz-pgf graphics tikz-shape tikz-decorations
asked 2 hours ago
ÖzgürÖzgür
1,4421020
1,4421020
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
A pure TikZ solution for fun, which is much shorter. I have no idea why you have to use datavisualization for this.
documentclass[tikz]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}[>=latex,y=2cm]
draw[smooth,fill=red] plot[samples=100,domain=0:pi] (x,{sin(deg(x))});
draw[smooth,pattern=horizontal lines,pattern color=red] plot[samples=100,domain=pi:2*pi] (x,{sin(deg(x))});
draw[->] (0,-1.1)--(0,1.1) node[above] {$v$};
draw[->] (-.2,0)--(2*pi+0.5,0) node[right] {$omega t$};
draw (pi/2,-.05) node[below] {$frac12pi$}--(pi/2,.05);
draw (pi,-.05) node[below] {$1pi$}--(pi,.05);
draw (3*pi/2,-.05) node[below] {$frac32pi$}--(3*pi/2,.05);
draw (2*pi,-.05) node[below] {$2pi$}--(2*pi,.05);
draw (8.5,0) node {tikzdraw[x=1pt,y=1pt] (0,0) to[out=30,in=-150] (20,0); $v$};
end{tikzpicture}
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%2f481119%2fhow-do-i-color-the-graph-in-datavisualization%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
A pure TikZ solution for fun, which is much shorter. I have no idea why you have to use datavisualization for this.
documentclass[tikz]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}[>=latex,y=2cm]
draw[smooth,fill=red] plot[samples=100,domain=0:pi] (x,{sin(deg(x))});
draw[smooth,pattern=horizontal lines,pattern color=red] plot[samples=100,domain=pi:2*pi] (x,{sin(deg(x))});
draw[->] (0,-1.1)--(0,1.1) node[above] {$v$};
draw[->] (-.2,0)--(2*pi+0.5,0) node[right] {$omega t$};
draw (pi/2,-.05) node[below] {$frac12pi$}--(pi/2,.05);
draw (pi,-.05) node[below] {$1pi$}--(pi,.05);
draw (3*pi/2,-.05) node[below] {$frac32pi$}--(3*pi/2,.05);
draw (2*pi,-.05) node[below] {$2pi$}--(2*pi,.05);
draw (8.5,0) node {tikzdraw[x=1pt,y=1pt] (0,0) to[out=30,in=-150] (20,0); $v$};
end{tikzpicture}
end{document}

add a comment |
A pure TikZ solution for fun, which is much shorter. I have no idea why you have to use datavisualization for this.
documentclass[tikz]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}[>=latex,y=2cm]
draw[smooth,fill=red] plot[samples=100,domain=0:pi] (x,{sin(deg(x))});
draw[smooth,pattern=horizontal lines,pattern color=red] plot[samples=100,domain=pi:2*pi] (x,{sin(deg(x))});
draw[->] (0,-1.1)--(0,1.1) node[above] {$v$};
draw[->] (-.2,0)--(2*pi+0.5,0) node[right] {$omega t$};
draw (pi/2,-.05) node[below] {$frac12pi$}--(pi/2,.05);
draw (pi,-.05) node[below] {$1pi$}--(pi,.05);
draw (3*pi/2,-.05) node[below] {$frac32pi$}--(3*pi/2,.05);
draw (2*pi,-.05) node[below] {$2pi$}--(2*pi,.05);
draw (8.5,0) node {tikzdraw[x=1pt,y=1pt] (0,0) to[out=30,in=-150] (20,0); $v$};
end{tikzpicture}
end{document}

add a comment |
A pure TikZ solution for fun, which is much shorter. I have no idea why you have to use datavisualization for this.
documentclass[tikz]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}[>=latex,y=2cm]
draw[smooth,fill=red] plot[samples=100,domain=0:pi] (x,{sin(deg(x))});
draw[smooth,pattern=horizontal lines,pattern color=red] plot[samples=100,domain=pi:2*pi] (x,{sin(deg(x))});
draw[->] (0,-1.1)--(0,1.1) node[above] {$v$};
draw[->] (-.2,0)--(2*pi+0.5,0) node[right] {$omega t$};
draw (pi/2,-.05) node[below] {$frac12pi$}--(pi/2,.05);
draw (pi,-.05) node[below] {$1pi$}--(pi,.05);
draw (3*pi/2,-.05) node[below] {$frac32pi$}--(3*pi/2,.05);
draw (2*pi,-.05) node[below] {$2pi$}--(2*pi,.05);
draw (8.5,0) node {tikzdraw[x=1pt,y=1pt] (0,0) to[out=30,in=-150] (20,0); $v$};
end{tikzpicture}
end{document}

A pure TikZ solution for fun, which is much shorter. I have no idea why you have to use datavisualization for this.
documentclass[tikz]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}[>=latex,y=2cm]
draw[smooth,fill=red] plot[samples=100,domain=0:pi] (x,{sin(deg(x))});
draw[smooth,pattern=horizontal lines,pattern color=red] plot[samples=100,domain=pi:2*pi] (x,{sin(deg(x))});
draw[->] (0,-1.1)--(0,1.1) node[above] {$v$};
draw[->] (-.2,0)--(2*pi+0.5,0) node[right] {$omega t$};
draw (pi/2,-.05) node[below] {$frac12pi$}--(pi/2,.05);
draw (pi,-.05) node[below] {$1pi$}--(pi,.05);
draw (3*pi/2,-.05) node[below] {$frac32pi$}--(3*pi/2,.05);
draw (2*pi,-.05) node[below] {$2pi$}--(2*pi,.05);
draw (8.5,0) node {tikzdraw[x=1pt,y=1pt] (0,0) to[out=30,in=-150] (20,0); $v$};
end{tikzpicture}
end{document}

answered 2 hours ago
JouleVJouleV
7,37721952
7,37721952
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.
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%2f481119%2fhow-do-i-color-the-graph-in-datavisualization%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