Trying to make a 3dplotHow to establish node-anchor-like points on a (tikz) rectangle path (is there a better...

Is there a name for this series?

In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?

Is it possible to detect 100% of SQLi with a simple regex?

What does an unprocessed RAW file look like?

How can a Sorcerer/Warlock use 4 Eldritch blasts in one round?

Why is it that Bernie Sanders always called a "socialist"?

Minimum Viable Product for RTS game?

Do these large-scale, human power-plant-tending robots from the Matrix movies have a name, in-universe or out?

Spanning tree Priority values

Why can all solutions to the simple harmonic motion equation be written in terms of sines and cosines?

Are all power cords made equal?

SQL Server 2017 crashes when backing up because filepath is wrong

Is it Safe to Plug an Extension Cord Into a Power Strip?

80-bit collision resistence because of 80-bit x87 registers?

PostGIS function to move a polygon to centre over new point coordinates

Integral problem. Unsure of the approach.

Is the percentage symbol a constant?

When distributing a Linux kernel driver as source code, what's the difference between Proprietary and GPL license?

How many copper coins fit inside a cubic foot?

How does holding onto an active but un-used credit card affect your ability to get a loan?

How can I differentiate duration vs starting time

Build ASCII Podiums

What does "don't have a baby" imply or mean in this sentence?

Was the Soviet N1 really capable of sending 9.6 GB/s of telemetry?



Trying to make a 3dplot


How to establish node-anchor-like points on a (tikz) rectangle path (is there a better method than the one described)?TikZ scaling graphic and adjust node position and keep font sizeComputing the rectangle encompassing a node and a pointHow can I use XString to count characters in a string with the “wrong” catcode?Draw an ecuator circle given a unit 3D vector (the North pole)Line up nested tikz enviroments or how to get rid of themtikz and pgfdeclareshape why the text is not at the center anchor?Tikz Nodes do not take absolute coordinate valuesDrawing unit vectors in spherical coordinatesHow to draw a vector in a 3D space













1















I'm trying to make 3d plot. Unfortunately, I can't succeed in getting the desired figure, as shown below.



Here is the figure, where it's a sphere have a charge of -1 inside. And coordinate axes are supposed to be blur inside the sphere may not be dashed.
enter image description here
Still a MWE:



%% Copyright 2009 Jeffrey D. Hein
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Jeffrey D. Hein.
%
% This work consists of the files 3dplot.sty and 3dplot.tex

%Description
%-----------
%3dplot.tex - an example file demonstrating the use of the 3dplot.sty package.

%Created 2009-11-07 by Jeff Hein. Last updated: 2009-11-09
%----------------------------------------------------------

%Update Notes
%------------

%2009-11-07: Created file along with 3dplot.sty package


documentclass{article}
usepackage{tikz} %TikZ is required for this to work. Make sure this exists before the next line

usepackage{3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX installation

usepackage[active,tightpage]{preview} %generates a tightly fitting border around the work
PreviewEnvironment{tikzpicture}
setlengthPreviewBorder{2mm}

begin{document}

%Angle Definitions
%-----------------

%set the plot display orientation
%synatax: tdplotsetdisplay{theta_d}{phi_d}
tdplotsetmaincoords{45}{135}

%define polar coordinates for some vector
%TODO: look into using 3d spherical coordinate system
pgfmathsetmacro{rvec}{.8}
pgfmathsetmacro{thetavec}{45}
pgfmathsetmacro{phivec}{60}

%start tikz picture, and use the tdplot_main_coords style to implement the display
%coordinate transformation provided by 3dplot
begin{tikzpicture}[scale=5,tdplot_main_coords]

% Teken eerst de bol
shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

%set up some coordinates
%-----------------------
coordinate (O) at (0,0,0);

%determine a coordinate (P) using (r,theta,phi) coordinates. This command
%also determines (Pxy), (Pxz), and (Pyz): the xy-, xz-, and yz-projections
%of the point (P).
%syntax: tdplotsetcoord{Coordinate name without parentheses}{r}{theta}{phi}
tdplotsetcoord{P}{rvec}{thetavec}{phivec}

%draw figure contents
%--------------------

%draw the main coordinate system axes
draw[thick,->] (0,0,0) -- (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
draw[thick,->] (0,0,0) -- (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
draw[thick,->] (0,0,-1) -- (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};





end{tikzpicture}

end{document}


Edited image:
enter image description here










share|improve this question





























    1















    I'm trying to make 3d plot. Unfortunately, I can't succeed in getting the desired figure, as shown below.



    Here is the figure, where it's a sphere have a charge of -1 inside. And coordinate axes are supposed to be blur inside the sphere may not be dashed.
    enter image description here
    Still a MWE:



    %% Copyright 2009 Jeffrey D. Hein
    %
    % This work may be distributed and/or modified under the
    % conditions of the LaTeX Project Public License, either version 1.3
    % of this license or (at your option) any later version.
    % The latest version of this license is in
    % http://www.latex-project.org/lppl.txt
    % and version 1.3 or later is part of all distributions of LaTeX
    % version 2005/12/01 or later.
    %
    % This work has the LPPL maintenance status `maintained'.
    %
    % The Current Maintainer of this work is Jeffrey D. Hein.
    %
    % This work consists of the files 3dplot.sty and 3dplot.tex

    %Description
    %-----------
    %3dplot.tex - an example file demonstrating the use of the 3dplot.sty package.

    %Created 2009-11-07 by Jeff Hein. Last updated: 2009-11-09
    %----------------------------------------------------------

    %Update Notes
    %------------

    %2009-11-07: Created file along with 3dplot.sty package


    documentclass{article}
    usepackage{tikz} %TikZ is required for this to work. Make sure this exists before the next line

    usepackage{3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX installation

    usepackage[active,tightpage]{preview} %generates a tightly fitting border around the work
    PreviewEnvironment{tikzpicture}
    setlengthPreviewBorder{2mm}

    begin{document}

    %Angle Definitions
    %-----------------

    %set the plot display orientation
    %synatax: tdplotsetdisplay{theta_d}{phi_d}
    tdplotsetmaincoords{45}{135}

    %define polar coordinates for some vector
    %TODO: look into using 3d spherical coordinate system
    pgfmathsetmacro{rvec}{.8}
    pgfmathsetmacro{thetavec}{45}
    pgfmathsetmacro{phivec}{60}

    %start tikz picture, and use the tdplot_main_coords style to implement the display
    %coordinate transformation provided by 3dplot
    begin{tikzpicture}[scale=5,tdplot_main_coords]

    % Teken eerst de bol
    shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

    %set up some coordinates
    %-----------------------
    coordinate (O) at (0,0,0);

    %determine a coordinate (P) using (r,theta,phi) coordinates. This command
    %also determines (Pxy), (Pxz), and (Pyz): the xy-, xz-, and yz-projections
    %of the point (P).
    %syntax: tdplotsetcoord{Coordinate name without parentheses}{r}{theta}{phi}
    tdplotsetcoord{P}{rvec}{thetavec}{phivec}

    %draw figure contents
    %--------------------

    %draw the main coordinate system axes
    draw[thick,->] (0,0,0) -- (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
    draw[thick,->] (0,0,0) -- (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
    draw[thick,->] (0,0,-1) -- (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};





    end{tikzpicture}

    end{document}


    Edited image:
    enter image description here










    share|improve this question



























      1












      1








      1


      1






      I'm trying to make 3d plot. Unfortunately, I can't succeed in getting the desired figure, as shown below.



      Here is the figure, where it's a sphere have a charge of -1 inside. And coordinate axes are supposed to be blur inside the sphere may not be dashed.
      enter image description here
      Still a MWE:



      %% Copyright 2009 Jeffrey D. Hein
      %
      % This work may be distributed and/or modified under the
      % conditions of the LaTeX Project Public License, either version 1.3
      % of this license or (at your option) any later version.
      % The latest version of this license is in
      % http://www.latex-project.org/lppl.txt
      % and version 1.3 or later is part of all distributions of LaTeX
      % version 2005/12/01 or later.
      %
      % This work has the LPPL maintenance status `maintained'.
      %
      % The Current Maintainer of this work is Jeffrey D. Hein.
      %
      % This work consists of the files 3dplot.sty and 3dplot.tex

      %Description
      %-----------
      %3dplot.tex - an example file demonstrating the use of the 3dplot.sty package.

      %Created 2009-11-07 by Jeff Hein. Last updated: 2009-11-09
      %----------------------------------------------------------

      %Update Notes
      %------------

      %2009-11-07: Created file along with 3dplot.sty package


      documentclass{article}
      usepackage{tikz} %TikZ is required for this to work. Make sure this exists before the next line

      usepackage{3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX installation

      usepackage[active,tightpage]{preview} %generates a tightly fitting border around the work
      PreviewEnvironment{tikzpicture}
      setlengthPreviewBorder{2mm}

      begin{document}

      %Angle Definitions
      %-----------------

      %set the plot display orientation
      %synatax: tdplotsetdisplay{theta_d}{phi_d}
      tdplotsetmaincoords{45}{135}

      %define polar coordinates for some vector
      %TODO: look into using 3d spherical coordinate system
      pgfmathsetmacro{rvec}{.8}
      pgfmathsetmacro{thetavec}{45}
      pgfmathsetmacro{phivec}{60}

      %start tikz picture, and use the tdplot_main_coords style to implement the display
      %coordinate transformation provided by 3dplot
      begin{tikzpicture}[scale=5,tdplot_main_coords]

      % Teken eerst de bol
      shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

      %set up some coordinates
      %-----------------------
      coordinate (O) at (0,0,0);

      %determine a coordinate (P) using (r,theta,phi) coordinates. This command
      %also determines (Pxy), (Pxz), and (Pyz): the xy-, xz-, and yz-projections
      %of the point (P).
      %syntax: tdplotsetcoord{Coordinate name without parentheses}{r}{theta}{phi}
      tdplotsetcoord{P}{rvec}{thetavec}{phivec}

      %draw figure contents
      %--------------------

      %draw the main coordinate system axes
      draw[thick,->] (0,0,0) -- (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
      draw[thick,->] (0,0,0) -- (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
      draw[thick,->] (0,0,-1) -- (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};





      end{tikzpicture}

      end{document}


      Edited image:
      enter image description here










      share|improve this question
















      I'm trying to make 3d plot. Unfortunately, I can't succeed in getting the desired figure, as shown below.



      Here is the figure, where it's a sphere have a charge of -1 inside. And coordinate axes are supposed to be blur inside the sphere may not be dashed.
      enter image description here
      Still a MWE:



      %% Copyright 2009 Jeffrey D. Hein
      %
      % This work may be distributed and/or modified under the
      % conditions of the LaTeX Project Public License, either version 1.3
      % of this license or (at your option) any later version.
      % The latest version of this license is in
      % http://www.latex-project.org/lppl.txt
      % and version 1.3 or later is part of all distributions of LaTeX
      % version 2005/12/01 or later.
      %
      % This work has the LPPL maintenance status `maintained'.
      %
      % The Current Maintainer of this work is Jeffrey D. Hein.
      %
      % This work consists of the files 3dplot.sty and 3dplot.tex

      %Description
      %-----------
      %3dplot.tex - an example file demonstrating the use of the 3dplot.sty package.

      %Created 2009-11-07 by Jeff Hein. Last updated: 2009-11-09
      %----------------------------------------------------------

      %Update Notes
      %------------

      %2009-11-07: Created file along with 3dplot.sty package


      documentclass{article}
      usepackage{tikz} %TikZ is required for this to work. Make sure this exists before the next line

      usepackage{3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX installation

      usepackage[active,tightpage]{preview} %generates a tightly fitting border around the work
      PreviewEnvironment{tikzpicture}
      setlengthPreviewBorder{2mm}

      begin{document}

      %Angle Definitions
      %-----------------

      %set the plot display orientation
      %synatax: tdplotsetdisplay{theta_d}{phi_d}
      tdplotsetmaincoords{45}{135}

      %define polar coordinates for some vector
      %TODO: look into using 3d spherical coordinate system
      pgfmathsetmacro{rvec}{.8}
      pgfmathsetmacro{thetavec}{45}
      pgfmathsetmacro{phivec}{60}

      %start tikz picture, and use the tdplot_main_coords style to implement the display
      %coordinate transformation provided by 3dplot
      begin{tikzpicture}[scale=5,tdplot_main_coords]

      % Teken eerst de bol
      shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

      %set up some coordinates
      %-----------------------
      coordinate (O) at (0,0,0);

      %determine a coordinate (P) using (r,theta,phi) coordinates. This command
      %also determines (Pxy), (Pxz), and (Pyz): the xy-, xz-, and yz-projections
      %of the point (P).
      %syntax: tdplotsetcoord{Coordinate name without parentheses}{r}{theta}{phi}
      tdplotsetcoord{P}{rvec}{thetavec}{phivec}

      %draw figure contents
      %--------------------

      %draw the main coordinate system axes
      draw[thick,->] (0,0,0) -- (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
      draw[thick,->] (0,0,0) -- (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
      draw[thick,->] (0,0,-1) -- (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};





      end{tikzpicture}

      end{document}


      Edited image:
      enter image description here







      tikz-pgf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago







      Shamina

















      asked 4 hours ago









      ShaminaShamina

      420213




      420213






















          2 Answers
          2






          active

          oldest

          votes


















          5














          Based on tikz-3dplot package definitions.



              documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          begin{document}

          %Angle Definitions
          %-----------------

          %set the plot display orientation
          %syntax: tdplotsetdisplay{theta_d}{phi_d}
          tdplotsetmaincoords{65}{110}
          pgfmathsetmacro{rvec}{1}
          pgfmathsetmacro{thetavecc}{55}
          pgfmathsetmacro{phivecc}{35}
          pgfmathsetmacro{thetaveccc}{39.7}
          pgfmathsetmacro{phiveccc}{55}

          begin{tikzpicture}[scale=5,tdplot_main_coords,>=latex]

          shadedraw[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);
          node[tdplot_screen_coords,xshift=1cm,yshift=3mm] (0,0) {$q=-1$};

          defh{1}

          %-----------------------
          coordinate (O) at (0,0,0);

          %draw the main coordinate system axes
          draw[thick,opacity=0.5] (0,0,0) -- (1,0,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,1,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,0,1);
          draw[thick,->] (1,0,0) -- (2.3,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};

          % Equator
          draw[dashed] (rvec,0,0) arc (0:360:rvec);
          draw[thick] (rvec,0,0) arc (0:110:rvec);
          draw[thick] (rvec,0,0) arc (0:-70:rvec);

          % Flux arrows
          foreach t in {10,20,...,340}
          foreach f in {180,170,...,0}
          draw [black!60,opacity=1.0, <-, thick]
          ({sin(f - h)*cos(t - h)}, {sin(f - h)*sin(t - h)}, {cos(f - h)})
          -- ({(1 + 0.2*cos(90 - f))*sin(f - h)*cos(t - h)},
          {(1 + 0.2*cos(90 - f))*sin(f - h)*sin(t - h)},
          {(1 + 0.2*cos(90 - f))*cos(f - h)});

          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer


























          • Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

            – Shamina
            2 hours ago






          • 1





            @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

            – ferahfeza
            1 hour ago



















          1














          The following code does draw the sphere (above the axes to hide them) and the -1. It uses tikz-3dplot which is in TeX Live.



          with flux arrows



          documentclass[tikz]{standalone}
          usepackage{tikz-3dplot}

          begin{document}
          tdplotsetmaincoords{60}{135}

          pgfmathsetmacro{rvec}{.8}

          begin{tikzpicture}[scale=5,tdplot_main_coords]
          coordinate (O) at (0,0,0);

          draw[thick,->] (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};

          shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

          foreach i in {0,20,...,360}
          draw[tdplot_screen_coords,<-] (i:.9*rvec) -- (i: 1.1*rvec);

          node[tdplot_screen_coords] (0,0) {$-1$};
          end{tikzpicture}
          end{document}





          share|improve this answer


























          • Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

            – Shamina
            3 hours ago













          • @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

            – TeXnician
            3 hours ago











          • I edited my answer. I mean blurring inside the sphere

            – Shamina
            2 hours ago











          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%2f476138%2ftrying-to-make-a-3dplot%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          Based on tikz-3dplot package definitions.



              documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          begin{document}

          %Angle Definitions
          %-----------------

          %set the plot display orientation
          %syntax: tdplotsetdisplay{theta_d}{phi_d}
          tdplotsetmaincoords{65}{110}
          pgfmathsetmacro{rvec}{1}
          pgfmathsetmacro{thetavecc}{55}
          pgfmathsetmacro{phivecc}{35}
          pgfmathsetmacro{thetaveccc}{39.7}
          pgfmathsetmacro{phiveccc}{55}

          begin{tikzpicture}[scale=5,tdplot_main_coords,>=latex]

          shadedraw[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);
          node[tdplot_screen_coords,xshift=1cm,yshift=3mm] (0,0) {$q=-1$};

          defh{1}

          %-----------------------
          coordinate (O) at (0,0,0);

          %draw the main coordinate system axes
          draw[thick,opacity=0.5] (0,0,0) -- (1,0,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,1,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,0,1);
          draw[thick,->] (1,0,0) -- (2.3,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};

          % Equator
          draw[dashed] (rvec,0,0) arc (0:360:rvec);
          draw[thick] (rvec,0,0) arc (0:110:rvec);
          draw[thick] (rvec,0,0) arc (0:-70:rvec);

          % Flux arrows
          foreach t in {10,20,...,340}
          foreach f in {180,170,...,0}
          draw [black!60,opacity=1.0, <-, thick]
          ({sin(f - h)*cos(t - h)}, {sin(f - h)*sin(t - h)}, {cos(f - h)})
          -- ({(1 + 0.2*cos(90 - f))*sin(f - h)*cos(t - h)},
          {(1 + 0.2*cos(90 - f))*sin(f - h)*sin(t - h)},
          {(1 + 0.2*cos(90 - f))*cos(f - h)});

          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer


























          • Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

            – Shamina
            2 hours ago






          • 1





            @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

            – ferahfeza
            1 hour ago
















          5














          Based on tikz-3dplot package definitions.



              documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          begin{document}

          %Angle Definitions
          %-----------------

          %set the plot display orientation
          %syntax: tdplotsetdisplay{theta_d}{phi_d}
          tdplotsetmaincoords{65}{110}
          pgfmathsetmacro{rvec}{1}
          pgfmathsetmacro{thetavecc}{55}
          pgfmathsetmacro{phivecc}{35}
          pgfmathsetmacro{thetaveccc}{39.7}
          pgfmathsetmacro{phiveccc}{55}

          begin{tikzpicture}[scale=5,tdplot_main_coords,>=latex]

          shadedraw[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);
          node[tdplot_screen_coords,xshift=1cm,yshift=3mm] (0,0) {$q=-1$};

          defh{1}

          %-----------------------
          coordinate (O) at (0,0,0);

          %draw the main coordinate system axes
          draw[thick,opacity=0.5] (0,0,0) -- (1,0,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,1,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,0,1);
          draw[thick,->] (1,0,0) -- (2.3,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};

          % Equator
          draw[dashed] (rvec,0,0) arc (0:360:rvec);
          draw[thick] (rvec,0,0) arc (0:110:rvec);
          draw[thick] (rvec,0,0) arc (0:-70:rvec);

          % Flux arrows
          foreach t in {10,20,...,340}
          foreach f in {180,170,...,0}
          draw [black!60,opacity=1.0, <-, thick]
          ({sin(f - h)*cos(t - h)}, {sin(f - h)*sin(t - h)}, {cos(f - h)})
          -- ({(1 + 0.2*cos(90 - f))*sin(f - h)*cos(t - h)},
          {(1 + 0.2*cos(90 - f))*sin(f - h)*sin(t - h)},
          {(1 + 0.2*cos(90 - f))*cos(f - h)});

          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer


























          • Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

            – Shamina
            2 hours ago






          • 1





            @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

            – ferahfeza
            1 hour ago














          5












          5








          5







          Based on tikz-3dplot package definitions.



              documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          begin{document}

          %Angle Definitions
          %-----------------

          %set the plot display orientation
          %syntax: tdplotsetdisplay{theta_d}{phi_d}
          tdplotsetmaincoords{65}{110}
          pgfmathsetmacro{rvec}{1}
          pgfmathsetmacro{thetavecc}{55}
          pgfmathsetmacro{phivecc}{35}
          pgfmathsetmacro{thetaveccc}{39.7}
          pgfmathsetmacro{phiveccc}{55}

          begin{tikzpicture}[scale=5,tdplot_main_coords,>=latex]

          shadedraw[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);
          node[tdplot_screen_coords,xshift=1cm,yshift=3mm] (0,0) {$q=-1$};

          defh{1}

          %-----------------------
          coordinate (O) at (0,0,0);

          %draw the main coordinate system axes
          draw[thick,opacity=0.5] (0,0,0) -- (1,0,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,1,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,0,1);
          draw[thick,->] (1,0,0) -- (2.3,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};

          % Equator
          draw[dashed] (rvec,0,0) arc (0:360:rvec);
          draw[thick] (rvec,0,0) arc (0:110:rvec);
          draw[thick] (rvec,0,0) arc (0:-70:rvec);

          % Flux arrows
          foreach t in {10,20,...,340}
          foreach f in {180,170,...,0}
          draw [black!60,opacity=1.0, <-, thick]
          ({sin(f - h)*cos(t - h)}, {sin(f - h)*sin(t - h)}, {cos(f - h)})
          -- ({(1 + 0.2*cos(90 - f))*sin(f - h)*cos(t - h)},
          {(1 + 0.2*cos(90 - f))*sin(f - h)*sin(t - h)},
          {(1 + 0.2*cos(90 - f))*cos(f - h)});

          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer















          Based on tikz-3dplot package definitions.



              documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          documentclass{article}
          usepackage{tikz}
          usepackage{tikz-3dplot}

          begin{document}

          %Angle Definitions
          %-----------------

          %set the plot display orientation
          %syntax: tdplotsetdisplay{theta_d}{phi_d}
          tdplotsetmaincoords{65}{110}
          pgfmathsetmacro{rvec}{1}
          pgfmathsetmacro{thetavecc}{55}
          pgfmathsetmacro{phivecc}{35}
          pgfmathsetmacro{thetaveccc}{39.7}
          pgfmathsetmacro{phiveccc}{55}

          begin{tikzpicture}[scale=5,tdplot_main_coords,>=latex]

          shadedraw[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);
          node[tdplot_screen_coords,xshift=1cm,yshift=3mm] (0,0) {$q=-1$};

          defh{1}

          %-----------------------
          coordinate (O) at (0,0,0);

          %draw the main coordinate system axes
          draw[thick,opacity=0.5] (0,0,0) -- (1,0,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,1,0);
          draw[thick,opacity=0.5] (0,0,0) -- (0,0,1);
          draw[thick,->] (1,0,0) -- (2.3,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,1,0) -- (0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,1) -- (0,0,1.5) node[anchor=south]{$z$};

          % Equator
          draw[dashed] (rvec,0,0) arc (0:360:rvec);
          draw[thick] (rvec,0,0) arc (0:110:rvec);
          draw[thick] (rvec,0,0) arc (0:-70:rvec);

          % Flux arrows
          foreach t in {10,20,...,340}
          foreach f in {180,170,...,0}
          draw [black!60,opacity=1.0, <-, thick]
          ({sin(f - h)*cos(t - h)}, {sin(f - h)*sin(t - h)}, {cos(f - h)})
          -- ({(1 + 0.2*cos(90 - f))*sin(f - h)*cos(t - h)},
          {(1 + 0.2*cos(90 - f))*sin(f - h)*sin(t - h)},
          {(1 + 0.2*cos(90 - f))*cos(f - h)});

          end{tikzpicture}
          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 hours ago

























          answered 2 hours ago









          ferahfezaferahfeza

          6,17611932




          6,17611932













          • Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

            – Shamina
            2 hours ago






          • 1





            @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

            – ferahfeza
            1 hour ago



















          • Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

            – Shamina
            2 hours ago






          • 1





            @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

            – ferahfeza
            1 hour ago

















          Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

          – Shamina
          2 hours ago





          Thanks! Is there a way to decrease the intensity of the arrows? Also maybe the color of the sphere?

          – Shamina
          2 hours ago




          1




          1





          @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

          – ferahfeza
          1 hour ago





          @Shamina, your welcome. To decrease the intensity of the arrows, change the increment or decrement of the foreach loops in Flux arrows definitions. For example foreach t in {10,30,...,340} and so on. For color of sphere, insert opacitiy key in shadedraw. For example, shadedraw[tdplot_screen_coords,ball color = white,opacity=0.5] (0,0) circle (rvec);

          – ferahfeza
          1 hour ago











          1














          The following code does draw the sphere (above the axes to hide them) and the -1. It uses tikz-3dplot which is in TeX Live.



          with flux arrows



          documentclass[tikz]{standalone}
          usepackage{tikz-3dplot}

          begin{document}
          tdplotsetmaincoords{60}{135}

          pgfmathsetmacro{rvec}{.8}

          begin{tikzpicture}[scale=5,tdplot_main_coords]
          coordinate (O) at (0,0,0);

          draw[thick,->] (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};

          shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

          foreach i in {0,20,...,360}
          draw[tdplot_screen_coords,<-] (i:.9*rvec) -- (i: 1.1*rvec);

          node[tdplot_screen_coords] (0,0) {$-1$};
          end{tikzpicture}
          end{document}





          share|improve this answer


























          • Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

            – Shamina
            3 hours ago













          • @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

            – TeXnician
            3 hours ago











          • I edited my answer. I mean blurring inside the sphere

            – Shamina
            2 hours ago
















          1














          The following code does draw the sphere (above the axes to hide them) and the -1. It uses tikz-3dplot which is in TeX Live.



          with flux arrows



          documentclass[tikz]{standalone}
          usepackage{tikz-3dplot}

          begin{document}
          tdplotsetmaincoords{60}{135}

          pgfmathsetmacro{rvec}{.8}

          begin{tikzpicture}[scale=5,tdplot_main_coords]
          coordinate (O) at (0,0,0);

          draw[thick,->] (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};

          shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

          foreach i in {0,20,...,360}
          draw[tdplot_screen_coords,<-] (i:.9*rvec) -- (i: 1.1*rvec);

          node[tdplot_screen_coords] (0,0) {$-1$};
          end{tikzpicture}
          end{document}





          share|improve this answer


























          • Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

            – Shamina
            3 hours ago













          • @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

            – TeXnician
            3 hours ago











          • I edited my answer. I mean blurring inside the sphere

            – Shamina
            2 hours ago














          1












          1








          1







          The following code does draw the sphere (above the axes to hide them) and the -1. It uses tikz-3dplot which is in TeX Live.



          with flux arrows



          documentclass[tikz]{standalone}
          usepackage{tikz-3dplot}

          begin{document}
          tdplotsetmaincoords{60}{135}

          pgfmathsetmacro{rvec}{.8}

          begin{tikzpicture}[scale=5,tdplot_main_coords]
          coordinate (O) at (0,0,0);

          draw[thick,->] (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};

          shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

          foreach i in {0,20,...,360}
          draw[tdplot_screen_coords,<-] (i:.9*rvec) -- (i: 1.1*rvec);

          node[tdplot_screen_coords] (0,0) {$-1$};
          end{tikzpicture}
          end{document}





          share|improve this answer















          The following code does draw the sphere (above the axes to hide them) and the -1. It uses tikz-3dplot which is in TeX Live.



          with flux arrows



          documentclass[tikz]{standalone}
          usepackage{tikz-3dplot}

          begin{document}
          tdplotsetmaincoords{60}{135}

          pgfmathsetmacro{rvec}{.8}

          begin{tikzpicture}[scale=5,tdplot_main_coords]
          coordinate (O) at (0,0,0);

          draw[thick,->] (-1.5,0,0)-- (1.5,0,0) node[anchor=north east]{$x$};
          draw[thick,->] (0,-1.5,0)--(0,1.5,0) node[anchor=north west]{$y$};
          draw[thick,->] (0,0,-1.5)-- (0,0,1.5) node[anchor=south]{$z$};

          shade[tdplot_screen_coords,ball color = white] (0,0) circle (rvec);

          foreach i in {0,20,...,360}
          draw[tdplot_screen_coords,<-] (i:.9*rvec) -- (i: 1.1*rvec);

          node[tdplot_screen_coords] (0,0) {$-1$};
          end{tikzpicture}
          end{document}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 3 hours ago









          TeXnicianTeXnician

          25.1k63389




          25.1k63389













          • Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

            – Shamina
            3 hours ago













          • @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

            – TeXnician
            3 hours ago











          • I edited my answer. I mean blurring inside the sphere

            – Shamina
            2 hours ago



















          • Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

            – Shamina
            3 hours ago













          • @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

            – TeXnician
            3 hours ago











          • I edited my answer. I mean blurring inside the sphere

            – Shamina
            2 hours ago

















          Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

          – Shamina
          3 hours ago







          Thanks a lot! Is there a way to get those flux arrows(pointing inside the sphere) also? Is there a way to get an equator? Also the axes to be seen but bit blur inside the sphere?

          – Shamina
          3 hours ago















          @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

          – TeXnician
          3 hours ago





          @Shamina I have added some arrows. Could you please edit your question to make the other requirements more clear (which type of blurring do you refer to and where do you want the equator to be)?

          – TeXnician
          3 hours ago













          I edited my answer. I mean blurring inside the sphere

          – Shamina
          2 hours ago





          I edited my answer. I mean blurring inside the sphere

          – Shamina
          2 hours ago


















          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%2f476138%2ftrying-to-make-a-3dplot%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

          Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

          Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

          How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...