Graphics, Figures & Tablestikz-3dplot | Spherical Plot without visible Lines

Information and discussion about graphics, figures & tables in LaTeX documents.
tomtom
Posts: 9
Joined: Sun Jul 01, 2012 9:49 pm

tikz-3dplot | Spherical Plot without visible Lines

Post by tomtom »

Hello everybody,

just took notice of the tikz-3dplot package and especially the \tdplotsphericalsurfaceplot macro.

Is there any way to omit drawing the lines, e.g. in http://www.texample.net/tikz/examples/s ... th-3dplot/?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikz-3dplot | Spherical Plot without visible Lines

Post by localghost »

tomtom wrote:[…] Is there any way to omit drawing the lines […]
Which lines do you exactly mean? Did you already take a look at the tikz-3dplot manual?


Best regards and welcome to the board
Thorsten
tomtom
Posts: 9
Joined: Sun Jul 01, 2012 9:49 pm

Re: tikz-3dplot | Spherical Plot without visible Lines

Post by tomtom »

Yes looked at the manual. Couldn't find any answer there.
I mean the black lines (example) other than the axis (surface lines on sphere).
Changing the color makes no sense, passing no line color argument, doesn't work and setting the linewidth to zero by: \pgfsetlinewidth{.0pt} compiles, without errors, but doesn't change the lines.
Beyond this, I tried setting draw opacity=1, but this ruled out the underlying surface as well.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

tikz-3dplot | Spherical Plot without visible Lines

Post by CrazyHorse »

tomtom wrote: just took notice of the tikz-3dplot package and especially the \tdplotsphericalsurfaceplot macro.

Is there any way to omit drawing the lines, e.g. in http://www.texample.net/tikz/examples/s ... th-3dplot/?
tikZ cannot handle (in)visible lines and areas ...
tomtom
Posts: 9
Joined: Sun Jul 01, 2012 9:49 pm

Re: tikz-3dplot | Spherical Plot without visible Lines

Post by tomtom »

Is there at least a way to reduce the line width?
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

tikz-3dplot | Spherical Plot without visible Lines

Post by shadgrind »

CrazyHorse wrote:tikZ cannot handle (in)visible lines and areas ...
It sort of can, with the transparent!0 color, though it's still slightly visible. Alternatively you could set the opacity of the line to 0.0:

Code: Select all

\begin{tikzpicture}
 \filldraw[fill=green] (0,0) rectangle (4,4);
 \draw[opacity=0.0] (0,0) -- (4,4);
\end{tikzpicture}
tomtom wrote:Is there at least a way to reduce the line width?
The best I can come up with is this:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{135}
\begin{tikzpicture}[scale=3,opacity=0.0,tdplot_main_coords,fill opacity=0.7]
\tdplotsphericalsurfaceplot[parametricfill]{72}{36}%
{sqrt(15/2)*sin(\tdplottheta)*cos(\tdplottheta)}{transparent!0}{\tdplotphi}%
    {\draw[color=black,thick,->] (0,0,0) -- (2,0,0) node[anchor=north east]{$x$};}%
    {\draw[color=black,thick,->] (0,0,0) -- (0,2,0) node[anchor=north west]{$y$};}%
    {\draw[color=black,thick,->] (0,0,0) -- (0,0,2) node[anchor=south]{$z$};}%
\end{tikzpicture}
\end{document}
The result looks like this:
sphere3dtikz.png
sphere3dtikz.png (71.75 KiB) Viewed 10071 times
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

tikz-3dplot | Spherical Plot without visible Lines

Post by CrazyHorse »

shadgrind wrote:
CrazyHorse wrote:tikZ cannot handle (in)visible lines and areas ...
It sort of can, with the transparent!0 color, though it's still slightly visible. Alternatively you could set the opacity of the line to 0.0:
that is not handled by tikZ ...
pst-solides3d can handle invisible lines and areas
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

tikz-3dplot | Spherical Plot without visible Lines

Post by shadgrind »

CrazyHorse wrote:
shadgrind wrote:
CrazyHorse wrote:tikZ cannot handle (in)visible lines and areas ...
It sort of can, with the transparent!0 color, though it's still slightly visible. Alternatively you could set the opacity of the line to 0.0:
that is not handled by tikZ ...
No, you're wrong. Did you even try that miniexample I gave? Here's a full example to make it even clearer:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
 \fill[fill=yellow!50] (0,0) rectangle (2,4);
 \fill[fill=red!50] (2,0) rectangle (4,4);
 \draw[opacity=0.0] (0,0) -- (4,4)
  node[opacity=1,pos=0] {start} node[opacity=1,pos=1] {end};
 \fill[opacity=0.0] (1,3) circle (1);
\end{tikzpicture}
\end{document}
The output looks like this:
tikzinvisible.png
tikzinvisible.png (1.72 KiB) Viewed 10049 times
Notice that the line from (0,0) to (4,4) is invisible. In fact, the nodes at both ends of that line would also be invisible if I had omitted the opacity=1 option. And the filled circle in the upper left corner is also invisible. So not only can TikZ handle invisible lines and areas, it can handle invisible labels as well.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
hichem120
Posts: 1
Joined: Wed Dec 15, 2021 9:25 pm

tikz-3dplot | Spherical Plot without visible Lines

Post by hichem120 »

please can i have a same resulte but without color, or with one color like red for exemple
thkx



shadgrind wrote:
CrazyHorse wrote:tikZ cannot handle (in)visible lines and areas ...
It sort of can, with the transparent!0 color, though it's still slightly visible. Alternatively you could set the opacity of the line to 0.0:

Code: Select all

\begin{tikzpicture}
 \filldraw[fill=green] (0,0) rectangle (4,4);
 \draw[opacity=0.0] (0,0) -- (4,4);
\end{tikzpicture}
tomtom wrote:Is there at least a way to reduce the line width?
The best I can come up with is this:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{135}
\begin{tikzpicture}[scale=3,opacity=0.0,tdplot_main_coords,fill opacity=0.7]
\tdplotsphericalsurfaceplot[parametricfill]{72}{36}%
{sqrt(15/2)*sin(\tdplottheta)*cos(\tdplottheta)}{transparent!0}{\tdplotphi}%
    {\draw[color=black,thick,->] (0,0,0) -- (2,0,0) node[anchor=north east]{$x$};}%
    {\draw[color=black,thick,->] (0,0,0) -- (0,2,0) node[anchor=north west]{$y$};}%
    {\draw[color=black,thick,->] (0,0,0) -- (0,0,2) node[anchor=south]{$z$};}%
\end{tikzpicture}
\end{document}
The result looks like this:

sphere3dtikz.png
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

tikz-3dplot | Spherical Plot without visible Lines

Post by Ijon Tichy »

Same in gray instead of color:

Code: Select all

\documentclass[gray]{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{135}
\begin{tikzpicture}[scale=3,opacity=0.0,tdplot_main_coords,fill opacity=0.7]
\tdplotsphericalsurfaceplot[parametricfill]{72}{36}%
{sqrt(15/2)*sin(\tdplottheta)*cos(\tdplottheta)}{transparent!0}{\tdplotphi}%
    {\draw[color=black,thick,->] (0,0,0) -- (2,0,0) node[anchor=north east]{$x$};}%
    {\draw[color=black,thick,->] (0,0,0) -- (0,2,0) node[anchor=north west]{$y$};}%
    {\draw[color=black,thick,->] (0,0,0) -- (0,0,2) node[anchor=south]{$z$};}%
\end{tikzpicture}
\end{document}
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply