The source of the difficulty is that ellipses are constructed in a particular way in TikZ. They are paths that start from the x-axis and proceed counter-clockwise around their centre. The vast majority of the time, the exact parametrisation doesn't matter. You appear to have found the one situation where it does!
In the actual question, you only want to be able to mirror the ellipse, and so draw it starting from the negative x-axis (the title of the question suggests a more flexible approach). That's actually not too hard since we can exploit the symmetry of the ellipse. The key is to provide it with a negative x-radius, since then it will start from the negative x-axis (and proceed clockwise, but we could correct for that by negating the y-radius as well). To do this, we interrupt the call from the node shape to the drawing command and flip the sign of the x-radius. The simplest way to do this is to redefine the \pgfpathellipse
macro to do the negation and then call the original macro. The following code does this.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations,shapes,decorations.markings}
\makeatletter
\let\origpgfpathellipse=\pgfpathellipse
\def\revpgfpathellipse#1#2#3{%
#2%
\pgf@xa=-\pgf@x
\origpgfpathellipse{#1}{\pgfqpoint{\pgf@xa}{0pt}}{#3}}
\makeatother
\tikzset{
reversed ellipse/.style={
ellipse,
reverse the ellipse%
},
reverse the ellipse/.code={
\let\pgfpathellipse=\revpgfpathellipse
}
}
\begin{document}
\begin{tikzpicture}
\node[ellipse,
draw,
postaction={
decorate,
decoration={
markings,
mark=at position 1 with {
\arrow[line width=5pt,blue]{>}
}
}
}
] at (0,0) {hello world};
\node[reversed ellipse,
draw,
postaction={
decorate,
decoration={
markings,
mark=at position 1 with {
\arrow[line width=5pt,blue]{>}
}
}
}
] at (0,-2) {hello world};
\end{tikzpicture}
\end{document}
Here's the result:
(the arrow got clipped, but you can see where it lies)
Let me try to summarize what I gathered from your question and from your comments:
you have some 3d visualization which requires lots of time.
"lots of" means 1000+ data points. This corresponds to a resolution of ~ 30x30
you are wondering how to improve speed; and scatter plots appeared to be a solution.
First, concerning (3.): if you need scatter plots, there is not much choice, I guess. But if you really have the choice, you should stick with surf, shader=interp
. This surface plot handler can be processed efficiently by pgfplots; it is much faster than scatter plots and it results in a smaller pdf.
And: if you have a relatively smooth function, it requires few data points.
Concerning the need to improve compilation times: I think there are three choices:
choice 1: the external
library. Write
\usetikzlibrary{external}
\tikzexternalize
into your preamble; then compile with pdflatex -shell-escape
. This allows automatic export of individual pictures to pdf, with sophisticated logic to preserve scaling, alignment, bounding boxes, labels, etc. You can find lots of instructions in the manual or on this site.
choice 2: the standalone package can also be used. Details in the manual or on this site.
choice 3: if even the compilation of these external pdfs takes too long, you can consider reducing the sampling resolution. Perhaps this is feasible.
If the quality degenerates but you know that you surface is smooth, you could even resort to the patchplots
lib of pgfplots and use some higher-order shader (patch type=bilinear
or patch type=biquadratic
or patch type
=bicubiccombined with
shader=interp). Except for
patch type=bilinear, these patches require changes to your sampling routine (i.e. the expected input changes). See also
patch type sampling` in pgfplots 1.7.
choice 4: you can resort to \addplot graphics
. The \addplot graphics
switch, however, should be regarded as last hope as it involves more manual work (tuning axis limits) than desired and involves 3rd party tools (more overhead).
Best Answer
Simply replace all the mark related stuff by
no marks
.N.B.: Actually,
pgfplots
does not have an option calledno marks
but it isno markers
there. The optionno marks
is inherited from TikZ. To me this is counter-intuitive because the natural opposite ofonly marks
should beno marks
and notno markers
.