Re: [Pgfplots-features] Problem with legend, again
Brought to you by:
cfeuersaenger,
ludewich
From: Christian F. <cfe...@go...> - 2014-03-19 21:16:35
|
Hi Ihor, this is effectively the same problem as with the text depth: the legend style is inherited by your plot mark. The only way to solve it is to set all involved options explicitly. In this case, the option "anchor=center" fixes the problem: \pgfdeclareplotmark{e} {\filldraw[fill=white,draw=black] (0pt,0pt) circle [radius=3pt] node[anchor=center,text depth=0pt] {\scriptsize e};} Kind regards Christian Am 19.03.2014 18:09, schrieb Ihor Rokach: > Dear Christian, > > Thank you very much for your very kind answer. After your correction > everything is OK with my plot until any kind of horizontal alignment > of the legend is used. Unfortunately, either "legend cell align=left" > (used in the example below) or "legend cell align=right" shifts letter > 'e' out of the circle in the legend. I have tried to control letter > 'e' position using 'align=' key of the node in pgfdeclareplotmark > without any success. Is it a bug or (very advanced) feature? > > \documentclass[tikz]{standalone} > \usepackage{pgfplots} > \pgfplotsset{compat=newest} > > \pgfdeclareplotmark{e} > {\filldraw[fill=white,draw=black] (0pt,0pt) circle [radius=3pt] > node[text depth=0pt] {\scriptsize e};} > > \begin{document} > \thispagestyle{empty} > \begin{tikzpicture} > \begin{axis}[legend cell align=left] %% alignment of the legend > \addplot[mark=e] coordinates {(0,1) (1,0)}; > \addlegendentry{test} > \end{axis} > \end{tikzpicture} > \end{document} > > With best wishes > , > ========= > I > hor > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > > > _______________________________________________ > Pgfplots-features mailing list > Pgf...@li... > https://lists.sourceforge.net/lists/listinfo/pgfplots-features |