New answers tagged

3

Add anchor=center to your definition of \pnode (and use a more minimal example next time). \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,positioning,fit,decorations.markings,patterns} \def\pnode [#1]#2{ % node for the potential function \node[regular polygon,anchor=center,regular polygon sides=4, minimum size=5.0pt,fill=black,#1] (#2) ...


2

A workaround could be to use forget plot and \addlegendimage. \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{decorations.markings} \pgfplotsset{compat=1.12} \tikzset{test decoration/.style={ postaction={ decorate, decoration={ markings, mark=between positions 0.5 and 1 step 10mm with {\node {test};} } } }} ...


4

Looks like there's a problem with the way midmark takes in its argument. If you use curly braces to contain the node options, then everything works fine: midmark={[{above,xshift=1em}]{text}}


3

Defining a custom path decoration seems to work, although I'm not sure I did everything as it should, so bugs may arise in corner cases. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing} \pgfdeclaredecoration{simple line}{start} { \state{start}[width = +0pt, next state=step]{ ...


2

Your code looks more or less okay to me. The only problem is, that you've chosen your dimensions way to small. Multiplying the x coordinates by 10 yields: Code \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{decorations.pathreplacing} % \begin{document} % \begin{tikzpicture}[every edge/.style={shorten <=1pt, shorten >=1pt}] \draw ...



Top 50 recent answers are included