Legendary entry
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
How can i change the picture of the legendary? I would like to have to lines insted...
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=
anchor=outer north east,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
tikz-pgf axis
add a comment |Â
up vote
2
down vote
favorite
How can i change the picture of the legendary? I would like to have to lines insted...
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=
anchor=outer north east,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
tikz-pgf axis
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
How can i change the picture of the legendary? I would like to have to lines insted...
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=
anchor=outer north east,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
tikz-pgf axis
How can i change the picture of the legendary? I would like to have to lines insted...
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=
anchor=outer north east,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
tikz-pgf axis
tikz-pgf axis
edited 1 hour ago
Zarko
112k861150
112k861150
asked 3 hours ago
Derr Herr
674
674
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
One possibility is to simply use this legendary answer.
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
pgfplotsset%
mesh line legend/.style=legend image code/.code=meshlinelegend#1,%
makeatletter
longdefmeshlinelegend#1%
scope[%
#1,
/pgfplots/mesh/rows=1,
/pgfplots/mesh/cols=4,
/pgfplots/mesh/num points=,
/tikz/x=(0.44237cm,0cm),
/tikz/y=(0cm,0.23932cm),
/tikz/z=(0.0cm,0cm),
scale=0.4,
]
letpgfplots@metamax=pgfutil@empty
pgfplots@curplot@threedimtrue
pgfplotsplothandlermesh
pgfplotstreamstart
defsimplecoordinate(##1,##2,##3)%
pgfmathparse1000*(##3)%
pgfmathfloatparsenumberpgfmathresult
letpgfplots@current@point@meta=pgfmathresult
pgfplotstreampointpgfqpointxyz@orig##1##2##3%
%
pgfplotsforeachungrouped x in 0,...,pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroyx/pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroxx/pgfkeysvalueof/pgfplots/samples*3
simplecoordinate(x,0,y)
pgfplotstreamend
pgfusepathstroke
endscope
%
makeatother
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=mesh line legend,
anchor=south east,
xshift=20pt,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots hasmesh
option!? What if two dummy invisible line plots were added, just to create the legend?
â hpekristiansen
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjustpgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.
â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition ofpgfplotsplothandlermesh@defaultlegend@img
inpgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch ofsimplecoordinate
statements, which define the surface symbol of the ordinarymesh legend
. The perhaps most important thing there is the statementletpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.
â marmot
54 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
One possibility is to simply use this legendary answer.
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
pgfplotsset%
mesh line legend/.style=legend image code/.code=meshlinelegend#1,%
makeatletter
longdefmeshlinelegend#1%
scope[%
#1,
/pgfplots/mesh/rows=1,
/pgfplots/mesh/cols=4,
/pgfplots/mesh/num points=,
/tikz/x=(0.44237cm,0cm),
/tikz/y=(0cm,0.23932cm),
/tikz/z=(0.0cm,0cm),
scale=0.4,
]
letpgfplots@metamax=pgfutil@empty
pgfplots@curplot@threedimtrue
pgfplotsplothandlermesh
pgfplotstreamstart
defsimplecoordinate(##1,##2,##3)%
pgfmathparse1000*(##3)%
pgfmathfloatparsenumberpgfmathresult
letpgfplots@current@point@meta=pgfmathresult
pgfplotstreampointpgfqpointxyz@orig##1##2##3%
%
pgfplotsforeachungrouped x in 0,...,pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroyx/pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroxx/pgfkeysvalueof/pgfplots/samples*3
simplecoordinate(x,0,y)
pgfplotstreamend
pgfusepathstroke
endscope
%
makeatother
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=mesh line legend,
anchor=south east,
xshift=20pt,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots hasmesh
option!? What if two dummy invisible line plots were added, just to create the legend?
â hpekristiansen
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjustpgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.
â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition ofpgfplotsplothandlermesh@defaultlegend@img
inpgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch ofsimplecoordinate
statements, which define the surface symbol of the ordinarymesh legend
. The perhaps most important thing there is the statementletpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.
â marmot
54 mins ago
add a comment |Â
up vote
3
down vote
accepted
One possibility is to simply use this legendary answer.
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
pgfplotsset%
mesh line legend/.style=legend image code/.code=meshlinelegend#1,%
makeatletter
longdefmeshlinelegend#1%
scope[%
#1,
/pgfplots/mesh/rows=1,
/pgfplots/mesh/cols=4,
/pgfplots/mesh/num points=,
/tikz/x=(0.44237cm,0cm),
/tikz/y=(0cm,0.23932cm),
/tikz/z=(0.0cm,0cm),
scale=0.4,
]
letpgfplots@metamax=pgfutil@empty
pgfplots@curplot@threedimtrue
pgfplotsplothandlermesh
pgfplotstreamstart
defsimplecoordinate(##1,##2,##3)%
pgfmathparse1000*(##3)%
pgfmathfloatparsenumberpgfmathresult
letpgfplots@current@point@meta=pgfmathresult
pgfplotstreampointpgfqpointxyz@orig##1##2##3%
%
pgfplotsforeachungrouped x in 0,...,pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroyx/pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroxx/pgfkeysvalueof/pgfplots/samples*3
simplecoordinate(x,0,y)
pgfplotstreamend
pgfusepathstroke
endscope
%
makeatother
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=mesh line legend,
anchor=south east,
xshift=20pt,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots hasmesh
option!? What if two dummy invisible line plots were added, just to create the legend?
â hpekristiansen
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjustpgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.
â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition ofpgfplotsplothandlermesh@defaultlegend@img
inpgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch ofsimplecoordinate
statements, which define the surface symbol of the ordinarymesh legend
. The perhaps most important thing there is the statementletpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.
â marmot
54 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
One possibility is to simply use this legendary answer.
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
pgfplotsset%
mesh line legend/.style=legend image code/.code=meshlinelegend#1,%
makeatletter
longdefmeshlinelegend#1%
scope[%
#1,
/pgfplots/mesh/rows=1,
/pgfplots/mesh/cols=4,
/pgfplots/mesh/num points=,
/tikz/x=(0.44237cm,0cm),
/tikz/y=(0cm,0.23932cm),
/tikz/z=(0.0cm,0cm),
scale=0.4,
]
letpgfplots@metamax=pgfutil@empty
pgfplots@curplot@threedimtrue
pgfplotsplothandlermesh
pgfplotstreamstart
defsimplecoordinate(##1,##2,##3)%
pgfmathparse1000*(##3)%
pgfmathfloatparsenumberpgfmathresult
letpgfplots@current@point@meta=pgfmathresult
pgfplotstreampointpgfqpointxyz@orig##1##2##3%
%
pgfplotsforeachungrouped x in 0,...,pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroyx/pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroxx/pgfkeysvalueof/pgfplots/samples*3
simplecoordinate(x,0,y)
pgfplotstreamend
pgfusepathstroke
endscope
%
makeatother
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=mesh line legend,
anchor=south east,
xshift=20pt,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
One possibility is to simply use this legendary answer.
documentclass[margin=5mm]standalone
usepackagetikz,pgfplots
pgfplotsset%
mesh line legend/.style=legend image code/.code=meshlinelegend#1,%
makeatletter
longdefmeshlinelegend#1%
scope[%
#1,
/pgfplots/mesh/rows=1,
/pgfplots/mesh/cols=4,
/pgfplots/mesh/num points=,
/tikz/x=(0.44237cm,0cm),
/tikz/y=(0cm,0.23932cm),
/tikz/z=(0.0cm,0cm),
scale=0.4,
]
letpgfplots@metamax=pgfutil@empty
pgfplots@curplot@threedimtrue
pgfplotsplothandlermesh
pgfplotstreamstart
defsimplecoordinate(##1,##2,##3)%
pgfmathparse1000*(##3)%
pgfmathfloatparsenumberpgfmathresult
letpgfplots@current@point@meta=pgfmathresult
pgfplotstreampointpgfqpointxyz@orig##1##2##3%
%
pgfplotsforeachungrouped x in 0,...,pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroyx/pgfkeysvalueof/pgfplots/samples
pgfmathsetmacroxx/pgfkeysvalueof/pgfplots/samples*3
simplecoordinate(x,0,y)
pgfplotstreamend
pgfusepathstroke
endscope
%
makeatother
begindocument
begintikzpicture
beginaxis[
axis lines=center,
axis equal image,
%unit vector ratio=1 1,
scale=0.6,
%width=4.5cm,
%height=3cm,
xlabel=$theta$,
xtick=-1,-0.5,0.5,1,
xlabel style=anchor=west,
ylabel=$O(theta^3)$,
ylabel style=anchor=south,
ytick=-0.5,0.5,
xmin=-1.25, xmax=1.25,
ymin=-0.7, ymax=0.7,
samples=500,
every tick/.style=black,line width=0.5pt,
legend style=mesh line legend,
anchor=south east,
xshift=20pt,
nodes=scale=0.9,inner sep=1pt, transform shape
,
]
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(blue)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] cos(deg(x))-1;
addlegendentry(sin(theta)-theta)
addplot[mesh,mesh line legend,
colormap=
color=(white)
color=(red)
color=(white)
,
point meta=x,
thick,
%forget plot,
domain=-1.1:1.1] sin(deg(x))-x;
addlegendentry(cos(theta)-1)
endaxis
endtikzpicture
enddocument
edited 1 hour ago
answered 1 hour ago
marmot
57.2k462124
57.2k462124
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots hasmesh
option!? What if two dummy invisible line plots were added, just to create the legend?
â hpekristiansen
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjustpgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.
â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition ofpgfplotsplothandlermesh@defaultlegend@img
inpgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch ofsimplecoordinate
statements, which define the surface symbol of the ordinarymesh legend
. The perhaps most important thing there is the statementletpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.
â marmot
54 mins ago
add a comment |Â
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots hasmesh
option!? What if two dummy invisible line plots were added, just to create the legend?
â hpekristiansen
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjustpgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.
â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition ofpgfplotsplothandlermesh@defaultlegend@img
inpgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch ofsimplecoordinate
statements, which define the surface symbol of the ordinarymesh legend
. The perhaps most important thing there is the statementletpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.
â marmot
54 mins ago
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots has
mesh
option!? What if two dummy invisible line plots were added, just to create the legend?â hpekristiansen
1 hour ago
Just asking for my own personal interest... I suppose that the legend symbol comes from the fact that the plots has
mesh
option!? What if two dummy invisible line plots were added, just to create the legend?â hpekristiansen
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,
addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjust pgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.â marmot
1 hour ago
@hpekristiansen Yes, you could do that. A slight downside is that you need to give the dummy plots the same color. If you do that,
addlegendimage
will be an even more straightforward choice. There you can add whatever you like. The point here is that you could adjust pgfmathparsefactor*(##3 - rangea)
to create a legend image in which the color changes. This is how tex.stackexchange.com/a/59075/121799 works.â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
@hpekristiansen I completely switched gears and now just use Jake's great answer.
â marmot
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
Nice answer although I do not understand the low level code.
â hpekristiansen
1 hour ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition of
pgfplotsplothandlermesh@defaultlegend@img
in pgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch of simplecoordinate
statements, which define the surface symbol of the ordinary mesh legend
. The perhaps most important thing there is the statement letpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.â marmot
54 mins ago
@hpekristiansen I guess what happened in Jake's answer is that Jake looked up the definition of
pgfplotsplothandlermesh@defaultlegend@img
in pgfplotsmeshplothandler.code.tex
and adjusted it to his needs. There you can find a bunch of simplecoordinate
statements, which define the surface symbol of the ordinary mesh legend
. The perhaps most important thing there is the statement letpgfplots@current@point@meta=pgfmathresult
, which sets the meta (i.e. color) of a point. This gets linked to the third entry of the coordinates, and is how the fading effect is achieved.â marmot
54 mins ago
add a comment |Â
Â
draft saved
draft discarded
Â
draft saved
draft discarded
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450818%2flegendary-entry%23new-answer', 'question_page');
);
Post as a guest
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
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
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