Electric field strength of a charged rod, plane, solid sphere, hollow sphere or conducting sphere, as a function of radius r or distance x.
Edit and compile if you like:
% Author: Izaak Neutelings (Februari, 2020)% page 8 https://archive.org/details/StaticAndDynamicElectricity% https://tex.stackexchange.com/questions/56353/extract-x-y-coordinate-of-an-arbitrary-point-on-curve-in-tikz% https://tex.stackexchange.com/questions/412899/tikz-calculate-and-store-the-euclidian-distance-between-two-coordinates\documentclass[border=3pt,tikz]{standalone}\usepackage{amsmath} % for \dfrac\usepackage{physics}\usepackage{tikz,pgfplots}\usetikzlibrary{angles,quotes} % for pic (angle labels)\usetikzlibrary{decorations.markings}\tikzset{>=latex} % for LaTeX arrow head\usepackage{xcolor}\colorlet{Ecol}{orange!90!black}\colorlet{veccol}{green!45!black}\tikzstyle{EField}=[thick,Ecol]\def\xmax{5.0}\def\ymax{3.3}\def\tick#1#2{\draw[thick] (#1) ++ (#2:0.03*\ymax) --++ (#2-180:0.06*\ymax)}\begin{document}% ELECTRIC FIELD of a ROD\begin{tikzpicture}\def\kQ{2.0}\coordinate (O) at (0,0);\coordinate (X) at (\xmax,0);\coordinate (Y) at (0,\ymax);% AXIS\draw[<->,thick](X) node[below] {$y$} -- (O) -- (Y) node[left] {$E$};% PLOT\draw[EField,samples=100,smooth,variable=\x,domain={1.1*\kQ/\ymax}:0.96*\xmax]plot(\x,\kQ/\x);\node[above right] at (1.3,1.6) {$E \sim \dfrac{1}{y}$};
Click to download: electric_field_plots.tex • electric_field_plots.pdf
Open in Overleaf: electric_field_plots.tex