How to only show legend in pgf plot?Using a pgfplots-style legend in a plain-old tikzpicturecreate a...

Has the Isbell–Freyd criterion ever been used to check that a category is concretisable?

If a druid in Wild Shape swallows a creature whole, then turns back to her normal form, what happens?

What to do when being responsible for data protection in your lab, yet advice is ignored?

What is a term for a function that when called repeatedly, has the same effect as calling once?

Find the next monthly expiration date

Sometimes a banana is just a banana

How can atoms be electrically neutral when there is a difference in the positions of the charges?

Significance and timing of "mux scans"

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

Skis versus snow shoes - when to choose which for travelling the backcountry?

How to speed up a process

Compare four integers, return word based on maximum

How to deny access to SQL Server to certain login over SSMS, but allow over .Net SqlClient Data Provider

What's the purpose of these copper coils with resistors inside them in A Yamaha RX-V396RDS amplifier?

How would we write a misogynistic character without offending people?

Why is working on the same position for more than 15 years not a red flag?

Can chords be played on the flute?

Why proton concentration is divided by 10⁻⁷?

Must a tritone substitution use a dominant seventh chord?

How to count occurrences of Friday 13th

If nine coins are tossed, what is the probability that the number of heads is even?

You'll find me clean when something is full

What are these green text/line displays shown during the livestream of Crew Dragon's approach to dock with the ISS?

Use comma instead of & in table



How to only show legend in pgf plot?


Using a pgfplots-style legend in a plain-old tikzpicturecreate a standalone legend for a grid of plotsCustom legend for intensity plotGrouped bar chartLegend for selected functions onlyPlot legend without line breaktikzpicture : hide only one “plot” from legendHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?pgfplots wrongly calculate pgfplots@data@xmin in the case of mixed plots (with and without error bar)pgfplots: percentage in matrix plotCenter the axes in the coordinate originPGF plot legend placement error













1















I have created with matlab2tikz a standalone picture, saved in myfile.tikz



Here is the code:



  % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4.
%Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
%All rights reserved.
%Minimal pgfplots version: 1.3
%
%The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
%where you can also make suggestions and rate matlab2tikz.
%
documentclass[tikz]{standalone}
usepackage{pgfplots}
usepackage{grffile}
pgfplotsset{compat=newest}
usetikzlibrary{plotmarks}
usepackage{amsmath}

begin{document}
begin{tikzpicture}

begin{axis}[%
width=5.828221in,
height=4.83871in,
y tick label style={
/pgf/number format/.cd,
fixed,
precision=2,
/tikz/.cd
},
at={(0in,0in)},
xlabel={Amount of trajectories $(times 10^7 )$},
ylabel={4th largest eigenvalue},
scale only axis,
separate axis lines,
every outer x axis line/.append style={white!15!black},
every x tick label/.append style={font=color{white!15!black}},
xmin=10,
xmax=50,
every outer y axis line/.append style={white!15!black},
every y tick label/.append style={font=color{white!15!black}},
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addplot [color=red,solid,mark=square*,mark options={solid,fill=red}]
table[row sep=crcr]{%
10 0.263363834999385\
11 0.267956137706241\
12 0.234749040704818\
13 0.179095397783884\
14 0.15598488764853\
15 0.107130784874058\
16 0.102335812851717\
17 0.15130873420001\
18 0.13294322038256\
19 0.0960614078900675\
20 0.0668875403805097\
21 0.0696202544023205\
22 0.0769402122493772\
23 0.0814760237222062\
24 0.0697776185374109\
25 0.0890537892164226\
26 0.0966623314755249\
27 0.0934599345653749\
28 0.0878880498733259\
29 0.087473866000113\
30 0.0892704892496597\
31 0.0812007102089455\
32 0.0785448212326198\
33 0.0772843849145571\
34 0.0748381690948553\
35 0.076911866585151\
36 0.0690916321763139\
37 0.0681618703751155\
38 0.0538871718086814\
39 0.0462813570913469\
40 0.042327952187128\
41 0.0545656572749185\
42 0.0502509655943423\
43 0.0548481613029811\
44 0.0565260239184772\
45 0.0574958892089851\
46 0.0565141460485921\
47 0.0607219533955611\
48 0.0621210992930102\
49 0.0584171708241252\
50 0.0554092144619335\
};
addlegendentry{Standart estimation};

addplot [color=blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}]
table[row sep=crcr]{%
10 0.357550039744943\
11 0.356972039378709\
12 0.334368502350565\
13 0.30613803777209\
14 0.298223941905334\
15 0.343030324802327\
16 0.344206127225485\
17 0.342654565258385\
18 0.26909949152418\
19 0.244071723963408\
20 0.242341053266382\
21 0.242231681701872\
22 0.23431468104395\
23 0.234032984140502\
24 0.225001418677598\
25 0.187193611177314\
26 0.195346678096106\
27 0.194987732958593\
28 0.193281499543124\
29 0.193039372776092\
30 0.188745282175345\
31 0.18389991087615\
32 0.184250604858391\
33 0.18358622178072\
34 0.183425365322753\
35 0.183581339448476\
36 0.169460638908507\
37 0.166155309985801\
38 0.160320243705676\
39 0.14731116222724\
40 0.144469472179117\
41 0.143751331186272\
42 0.143538751559955\
43 0.142526804916181\
44 0.142099807792203\
45 0.142164474247563\
46 0.137436117746078\
47 0.13816942742473\
48 0.137543995531934\
49 0.137932768120272\
50 0.137592136659409\
};
addlegendentry{Corrected Frobenius estimation};

end{axis}
end{tikzpicture}%
end{document}


In my terminal, I can produce a pdf file of my picture by entering



pdflatex myfile.tikz


This is how it looks:



enter image description here



I want to produce a PDF file only containing the legend of the pgfplot. Is this possible?



Edit: I would like to have this outcome:



enter image description here



Whereas LaRiFaRi's solution provides this:



enter image description here



How can I get the first picture? Do I need to trial-and-error or is there a shorter version for it? Removing xmax, ymax, xmin and ymin produced an empty image.










share|improve this question

























  • You mean without the plot?

    – user11232
    Aug 5 '15 at 13:32











  • @HarishKumar yes!

    – Adam
    Aug 5 '15 at 13:36











  • Which version of pgfplots are you using? If you don't know, please add listfiles to your preamble and check the .log file for "pgfplots"

    – LaRiFaRi
    Aug 5 '15 at 13:53











  • related: tex.stackexchange.com/questions/54794/…

    – Christian Feuersänger
    Aug 5 '15 at 18:49
















1















I have created with matlab2tikz a standalone picture, saved in myfile.tikz



Here is the code:



  % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4.
%Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
%All rights reserved.
%Minimal pgfplots version: 1.3
%
%The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
%where you can also make suggestions and rate matlab2tikz.
%
documentclass[tikz]{standalone}
usepackage{pgfplots}
usepackage{grffile}
pgfplotsset{compat=newest}
usetikzlibrary{plotmarks}
usepackage{amsmath}

begin{document}
begin{tikzpicture}

begin{axis}[%
width=5.828221in,
height=4.83871in,
y tick label style={
/pgf/number format/.cd,
fixed,
precision=2,
/tikz/.cd
},
at={(0in,0in)},
xlabel={Amount of trajectories $(times 10^7 )$},
ylabel={4th largest eigenvalue},
scale only axis,
separate axis lines,
every outer x axis line/.append style={white!15!black},
every x tick label/.append style={font=color{white!15!black}},
xmin=10,
xmax=50,
every outer y axis line/.append style={white!15!black},
every y tick label/.append style={font=color{white!15!black}},
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addplot [color=red,solid,mark=square*,mark options={solid,fill=red}]
table[row sep=crcr]{%
10 0.263363834999385\
11 0.267956137706241\
12 0.234749040704818\
13 0.179095397783884\
14 0.15598488764853\
15 0.107130784874058\
16 0.102335812851717\
17 0.15130873420001\
18 0.13294322038256\
19 0.0960614078900675\
20 0.0668875403805097\
21 0.0696202544023205\
22 0.0769402122493772\
23 0.0814760237222062\
24 0.0697776185374109\
25 0.0890537892164226\
26 0.0966623314755249\
27 0.0934599345653749\
28 0.0878880498733259\
29 0.087473866000113\
30 0.0892704892496597\
31 0.0812007102089455\
32 0.0785448212326198\
33 0.0772843849145571\
34 0.0748381690948553\
35 0.076911866585151\
36 0.0690916321763139\
37 0.0681618703751155\
38 0.0538871718086814\
39 0.0462813570913469\
40 0.042327952187128\
41 0.0545656572749185\
42 0.0502509655943423\
43 0.0548481613029811\
44 0.0565260239184772\
45 0.0574958892089851\
46 0.0565141460485921\
47 0.0607219533955611\
48 0.0621210992930102\
49 0.0584171708241252\
50 0.0554092144619335\
};
addlegendentry{Standart estimation};

addplot [color=blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}]
table[row sep=crcr]{%
10 0.357550039744943\
11 0.356972039378709\
12 0.334368502350565\
13 0.30613803777209\
14 0.298223941905334\
15 0.343030324802327\
16 0.344206127225485\
17 0.342654565258385\
18 0.26909949152418\
19 0.244071723963408\
20 0.242341053266382\
21 0.242231681701872\
22 0.23431468104395\
23 0.234032984140502\
24 0.225001418677598\
25 0.187193611177314\
26 0.195346678096106\
27 0.194987732958593\
28 0.193281499543124\
29 0.193039372776092\
30 0.188745282175345\
31 0.18389991087615\
32 0.184250604858391\
33 0.18358622178072\
34 0.183425365322753\
35 0.183581339448476\
36 0.169460638908507\
37 0.166155309985801\
38 0.160320243705676\
39 0.14731116222724\
40 0.144469472179117\
41 0.143751331186272\
42 0.143538751559955\
43 0.142526804916181\
44 0.142099807792203\
45 0.142164474247563\
46 0.137436117746078\
47 0.13816942742473\
48 0.137543995531934\
49 0.137932768120272\
50 0.137592136659409\
};
addlegendentry{Corrected Frobenius estimation};

end{axis}
end{tikzpicture}%
end{document}


In my terminal, I can produce a pdf file of my picture by entering



pdflatex myfile.tikz


This is how it looks:



enter image description here



I want to produce a PDF file only containing the legend of the pgfplot. Is this possible?



Edit: I would like to have this outcome:



enter image description here



Whereas LaRiFaRi's solution provides this:



enter image description here



How can I get the first picture? Do I need to trial-and-error or is there a shorter version for it? Removing xmax, ymax, xmin and ymin produced an empty image.










share|improve this question

























  • You mean without the plot?

    – user11232
    Aug 5 '15 at 13:32











  • @HarishKumar yes!

    – Adam
    Aug 5 '15 at 13:36











  • Which version of pgfplots are you using? If you don't know, please add listfiles to your preamble and check the .log file for "pgfplots"

    – LaRiFaRi
    Aug 5 '15 at 13:53











  • related: tex.stackexchange.com/questions/54794/…

    – Christian Feuersänger
    Aug 5 '15 at 18:49














1












1








1








I have created with matlab2tikz a standalone picture, saved in myfile.tikz



Here is the code:



  % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4.
%Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
%All rights reserved.
%Minimal pgfplots version: 1.3
%
%The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
%where you can also make suggestions and rate matlab2tikz.
%
documentclass[tikz]{standalone}
usepackage{pgfplots}
usepackage{grffile}
pgfplotsset{compat=newest}
usetikzlibrary{plotmarks}
usepackage{amsmath}

begin{document}
begin{tikzpicture}

begin{axis}[%
width=5.828221in,
height=4.83871in,
y tick label style={
/pgf/number format/.cd,
fixed,
precision=2,
/tikz/.cd
},
at={(0in,0in)},
xlabel={Amount of trajectories $(times 10^7 )$},
ylabel={4th largest eigenvalue},
scale only axis,
separate axis lines,
every outer x axis line/.append style={white!15!black},
every x tick label/.append style={font=color{white!15!black}},
xmin=10,
xmax=50,
every outer y axis line/.append style={white!15!black},
every y tick label/.append style={font=color{white!15!black}},
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addplot [color=red,solid,mark=square*,mark options={solid,fill=red}]
table[row sep=crcr]{%
10 0.263363834999385\
11 0.267956137706241\
12 0.234749040704818\
13 0.179095397783884\
14 0.15598488764853\
15 0.107130784874058\
16 0.102335812851717\
17 0.15130873420001\
18 0.13294322038256\
19 0.0960614078900675\
20 0.0668875403805097\
21 0.0696202544023205\
22 0.0769402122493772\
23 0.0814760237222062\
24 0.0697776185374109\
25 0.0890537892164226\
26 0.0966623314755249\
27 0.0934599345653749\
28 0.0878880498733259\
29 0.087473866000113\
30 0.0892704892496597\
31 0.0812007102089455\
32 0.0785448212326198\
33 0.0772843849145571\
34 0.0748381690948553\
35 0.076911866585151\
36 0.0690916321763139\
37 0.0681618703751155\
38 0.0538871718086814\
39 0.0462813570913469\
40 0.042327952187128\
41 0.0545656572749185\
42 0.0502509655943423\
43 0.0548481613029811\
44 0.0565260239184772\
45 0.0574958892089851\
46 0.0565141460485921\
47 0.0607219533955611\
48 0.0621210992930102\
49 0.0584171708241252\
50 0.0554092144619335\
};
addlegendentry{Standart estimation};

addplot [color=blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}]
table[row sep=crcr]{%
10 0.357550039744943\
11 0.356972039378709\
12 0.334368502350565\
13 0.30613803777209\
14 0.298223941905334\
15 0.343030324802327\
16 0.344206127225485\
17 0.342654565258385\
18 0.26909949152418\
19 0.244071723963408\
20 0.242341053266382\
21 0.242231681701872\
22 0.23431468104395\
23 0.234032984140502\
24 0.225001418677598\
25 0.187193611177314\
26 0.195346678096106\
27 0.194987732958593\
28 0.193281499543124\
29 0.193039372776092\
30 0.188745282175345\
31 0.18389991087615\
32 0.184250604858391\
33 0.18358622178072\
34 0.183425365322753\
35 0.183581339448476\
36 0.169460638908507\
37 0.166155309985801\
38 0.160320243705676\
39 0.14731116222724\
40 0.144469472179117\
41 0.143751331186272\
42 0.143538751559955\
43 0.142526804916181\
44 0.142099807792203\
45 0.142164474247563\
46 0.137436117746078\
47 0.13816942742473\
48 0.137543995531934\
49 0.137932768120272\
50 0.137592136659409\
};
addlegendentry{Corrected Frobenius estimation};

end{axis}
end{tikzpicture}%
end{document}


In my terminal, I can produce a pdf file of my picture by entering



pdflatex myfile.tikz


This is how it looks:



enter image description here



I want to produce a PDF file only containing the legend of the pgfplot. Is this possible?



Edit: I would like to have this outcome:



enter image description here



Whereas LaRiFaRi's solution provides this:



enter image description here



How can I get the first picture? Do I need to trial-and-error or is there a shorter version for it? Removing xmax, ymax, xmin and ymin produced an empty image.










share|improve this question
















I have created with matlab2tikz a standalone picture, saved in myfile.tikz



Here is the code:



  % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4.
%Copyright (c) 2008--2014, Nico Schlömer <nico.schloemer@gmail.com>
%All rights reserved.
%Minimal pgfplots version: 1.3
%
%The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
%where you can also make suggestions and rate matlab2tikz.
%
documentclass[tikz]{standalone}
usepackage{pgfplots}
usepackage{grffile}
pgfplotsset{compat=newest}
usetikzlibrary{plotmarks}
usepackage{amsmath}

begin{document}
begin{tikzpicture}

begin{axis}[%
width=5.828221in,
height=4.83871in,
y tick label style={
/pgf/number format/.cd,
fixed,
precision=2,
/tikz/.cd
},
at={(0in,0in)},
xlabel={Amount of trajectories $(times 10^7 )$},
ylabel={4th largest eigenvalue},
scale only axis,
separate axis lines,
every outer x axis line/.append style={white!15!black},
every x tick label/.append style={font=color{white!15!black}},
xmin=10,
xmax=50,
every outer y axis line/.append style={white!15!black},
every y tick label/.append style={font=color{white!15!black}},
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addplot [color=red,solid,mark=square*,mark options={solid,fill=red}]
table[row sep=crcr]{%
10 0.263363834999385\
11 0.267956137706241\
12 0.234749040704818\
13 0.179095397783884\
14 0.15598488764853\
15 0.107130784874058\
16 0.102335812851717\
17 0.15130873420001\
18 0.13294322038256\
19 0.0960614078900675\
20 0.0668875403805097\
21 0.0696202544023205\
22 0.0769402122493772\
23 0.0814760237222062\
24 0.0697776185374109\
25 0.0890537892164226\
26 0.0966623314755249\
27 0.0934599345653749\
28 0.0878880498733259\
29 0.087473866000113\
30 0.0892704892496597\
31 0.0812007102089455\
32 0.0785448212326198\
33 0.0772843849145571\
34 0.0748381690948553\
35 0.076911866585151\
36 0.0690916321763139\
37 0.0681618703751155\
38 0.0538871718086814\
39 0.0462813570913469\
40 0.042327952187128\
41 0.0545656572749185\
42 0.0502509655943423\
43 0.0548481613029811\
44 0.0565260239184772\
45 0.0574958892089851\
46 0.0565141460485921\
47 0.0607219533955611\
48 0.0621210992930102\
49 0.0584171708241252\
50 0.0554092144619335\
};
addlegendentry{Standart estimation};

addplot [color=blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}]
table[row sep=crcr]{%
10 0.357550039744943\
11 0.356972039378709\
12 0.334368502350565\
13 0.30613803777209\
14 0.298223941905334\
15 0.343030324802327\
16 0.344206127225485\
17 0.342654565258385\
18 0.26909949152418\
19 0.244071723963408\
20 0.242341053266382\
21 0.242231681701872\
22 0.23431468104395\
23 0.234032984140502\
24 0.225001418677598\
25 0.187193611177314\
26 0.195346678096106\
27 0.194987732958593\
28 0.193281499543124\
29 0.193039372776092\
30 0.188745282175345\
31 0.18389991087615\
32 0.184250604858391\
33 0.18358622178072\
34 0.183425365322753\
35 0.183581339448476\
36 0.169460638908507\
37 0.166155309985801\
38 0.160320243705676\
39 0.14731116222724\
40 0.144469472179117\
41 0.143751331186272\
42 0.143538751559955\
43 0.142526804916181\
44 0.142099807792203\
45 0.142164474247563\
46 0.137436117746078\
47 0.13816942742473\
48 0.137543995531934\
49 0.137932768120272\
50 0.137592136659409\
};
addlegendentry{Corrected Frobenius estimation};

end{axis}
end{tikzpicture}%
end{document}


In my terminal, I can produce a pdf file of my picture by entering



pdflatex myfile.tikz


This is how it looks:



enter image description here



I want to produce a PDF file only containing the legend of the pgfplot. Is this possible?



Edit: I would like to have this outcome:



enter image description here



Whereas LaRiFaRi's solution provides this:



enter image description here



How can I get the first picture? Do I need to trial-and-error or is there a shorter version for it? Removing xmax, ymax, xmin and ymin produced an empty image.







pgfplots legend






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 15 hours ago









L. F.

17911




17911










asked Aug 5 '15 at 13:18









AdamAdam

643519




643519













  • You mean without the plot?

    – user11232
    Aug 5 '15 at 13:32











  • @HarishKumar yes!

    – Adam
    Aug 5 '15 at 13:36











  • Which version of pgfplots are you using? If you don't know, please add listfiles to your preamble and check the .log file for "pgfplots"

    – LaRiFaRi
    Aug 5 '15 at 13:53











  • related: tex.stackexchange.com/questions/54794/…

    – Christian Feuersänger
    Aug 5 '15 at 18:49



















  • You mean without the plot?

    – user11232
    Aug 5 '15 at 13:32











  • @HarishKumar yes!

    – Adam
    Aug 5 '15 at 13:36











  • Which version of pgfplots are you using? If you don't know, please add listfiles to your preamble and check the .log file for "pgfplots"

    – LaRiFaRi
    Aug 5 '15 at 13:53











  • related: tex.stackexchange.com/questions/54794/…

    – Christian Feuersänger
    Aug 5 '15 at 18:49

















You mean without the plot?

– user11232
Aug 5 '15 at 13:32





You mean without the plot?

– user11232
Aug 5 '15 at 13:32













@HarishKumar yes!

– Adam
Aug 5 '15 at 13:36





@HarishKumar yes!

– Adam
Aug 5 '15 at 13:36













Which version of pgfplots are you using? If you don't know, please add listfiles to your preamble and check the .log file for "pgfplots"

– LaRiFaRi
Aug 5 '15 at 13:53





Which version of pgfplots are you using? If you don't know, please add listfiles to your preamble and check the .log file for "pgfplots"

– LaRiFaRi
Aug 5 '15 at 13:53













related: tex.stackexchange.com/questions/54794/…

– Christian Feuersänger
Aug 5 '15 at 18:49





related: tex.stackexchange.com/questions/54794/…

– Christian Feuersänger
Aug 5 '15 at 18:49










1 Answer
1






active

oldest

votes


















2














I do not know, why we need xmin, xmax, ... here, but well, it works (at least I hope this is what you have wanted):



% arara: pdflatex

documentclass{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.12}

begin{document}
begin{tikzpicture}
begin{axis}[%
hide axis,
xmin=10,
xmax=50,
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addlegendimage{red,mark=square*}
addlegendentry{Standart estimation};
addlegendimage{blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}}
addlegendentry{Corrected Frobenius estimation};
end{axis}
end{tikzpicture}
end{document}


enter image description here



NB: Try to use the compat parameter with your actual version.






share|improve this answer


























  • Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

    – Adam
    Aug 5 '15 at 13:48











  • @Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

    – LaRiFaRi
    Aug 5 '15 at 13:52











  • yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

    – Adam
    Aug 5 '15 at 14:10













  • @Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

    – LaRiFaRi
    Aug 5 '15 at 14:11











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f258840%2fhow-to-only-show-legend-in-pgf-plot%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









2














I do not know, why we need xmin, xmax, ... here, but well, it works (at least I hope this is what you have wanted):



% arara: pdflatex

documentclass{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.12}

begin{document}
begin{tikzpicture}
begin{axis}[%
hide axis,
xmin=10,
xmax=50,
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addlegendimage{red,mark=square*}
addlegendentry{Standart estimation};
addlegendimage{blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}}
addlegendentry{Corrected Frobenius estimation};
end{axis}
end{tikzpicture}
end{document}


enter image description here



NB: Try to use the compat parameter with your actual version.






share|improve this answer


























  • Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

    – Adam
    Aug 5 '15 at 13:48











  • @Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

    – LaRiFaRi
    Aug 5 '15 at 13:52











  • yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

    – Adam
    Aug 5 '15 at 14:10













  • @Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

    – LaRiFaRi
    Aug 5 '15 at 14:11
















2














I do not know, why we need xmin, xmax, ... here, but well, it works (at least I hope this is what you have wanted):



% arara: pdflatex

documentclass{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.12}

begin{document}
begin{tikzpicture}
begin{axis}[%
hide axis,
xmin=10,
xmax=50,
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addlegendimage{red,mark=square*}
addlegendentry{Standart estimation};
addlegendimage{blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}}
addlegendentry{Corrected Frobenius estimation};
end{axis}
end{tikzpicture}
end{document}


enter image description here



NB: Try to use the compat parameter with your actual version.






share|improve this answer


























  • Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

    – Adam
    Aug 5 '15 at 13:48











  • @Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

    – LaRiFaRi
    Aug 5 '15 at 13:52











  • yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

    – Adam
    Aug 5 '15 at 14:10













  • @Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

    – LaRiFaRi
    Aug 5 '15 at 14:11














2












2








2







I do not know, why we need xmin, xmax, ... here, but well, it works (at least I hope this is what you have wanted):



% arara: pdflatex

documentclass{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.12}

begin{document}
begin{tikzpicture}
begin{axis}[%
hide axis,
xmin=10,
xmax=50,
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addlegendimage{red,mark=square*}
addlegendentry{Standart estimation};
addlegendimage{blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}}
addlegendentry{Corrected Frobenius estimation};
end{axis}
end{tikzpicture}
end{document}


enter image description here



NB: Try to use the compat parameter with your actual version.






share|improve this answer















I do not know, why we need xmin, xmax, ... here, but well, it works (at least I hope this is what you have wanted):



% arara: pdflatex

documentclass{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.12}

begin{document}
begin{tikzpicture}
begin{axis}[%
hide axis,
xmin=10,
xmax=50,
ymin=0,
ymax=0.4,
legend style={draw=white!15!black,legend cell align=left}
]
addlegendimage{red,mark=square*}
addlegendentry{Standart estimation};
addlegendimage{blue,dash pattern=on 1pt off 3pt on 3pt off 3pt,mark=asterisk,mark options={solid}}
addlegendentry{Corrected Frobenius estimation};
end{axis}
end{tikzpicture}
end{document}


enter image description here



NB: Try to use the compat parameter with your actual version.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 5 '15 at 13:55

























answered Aug 5 '15 at 13:36









LaRiFaRiLaRiFaRi

36k247125




36k247125













  • Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

    – Adam
    Aug 5 '15 at 13:48











  • @Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

    – LaRiFaRi
    Aug 5 '15 at 13:52











  • yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

    – Adam
    Aug 5 '15 at 14:10













  • @Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

    – LaRiFaRi
    Aug 5 '15 at 14:11



















  • Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

    – Adam
    Aug 5 '15 at 13:48











  • @Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

    – LaRiFaRi
    Aug 5 '15 at 13:52











  • yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

    – Adam
    Aug 5 '15 at 14:10













  • @Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

    – LaRiFaRi
    Aug 5 '15 at 14:11

















Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

– Adam
Aug 5 '15 at 13:48





Thank you, this is almost what I am looking for. I had to use compat=newest to get it working. However, I would like to have the image without additional empty space (see above edit). Still, thank you for this.

– Adam
Aug 5 '15 at 13:48













@Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

– LaRiFaRi
Aug 5 '15 at 13:52





@Adam Replace newest by the version you actually have. This is better practise. Did you compile my very example? I do not see any white space around it. It is cropped to zero border.

– LaRiFaRi
Aug 5 '15 at 13:52













yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

– Adam
Aug 5 '15 at 14:10







yes I compiled your very example. Strange. I am using pgfplot version 1.7, maybe thats the reason for the white space in my outcome.. I dont know.

– Adam
Aug 5 '15 at 14:10















@Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

– LaRiFaRi
Aug 5 '15 at 14:11





@Adam at least it is really old. We are on 1.12 right now. (or higher... haven't checked in the last time). Please try to update your system before we continue on this.

– LaRiFaRi
Aug 5 '15 at 14:11


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f258840%2fhow-to-only-show-legend-in-pgf-plot%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

Castillo d'Acher Características Menú de navegación