6

enter image description here

Hi, I have a problem in drawing this frame, and with colors, especially using tikz programs or the hobby the program don't compile with hobby. Can anyone help me in drawing this pic?

thank you.

i was using these codes:

\documentclass[tikz]{standalone}
\usetikzlibrary{hobby,patterns}
\begin{document}
\begin{tikzpicture}
\draw[thick,->] (52,0) -- (60,0) node[anchor=north west] {$x'$};
\draw[thick,->] (56,-04) -- (56,04) node[anchor=south east] {$x_N$};
\node[draw=red,dashed,thick,circle,minimum width=4cm] (n) at (56,0) {};
\fill[pattern=north east lines,opacity=.6] (58,0)arc(0:180:2cm) -- (58,0);
\draw[thick,->] (57.5,1.55) -- (58,2) node[anchor=north west] {$I^{+}(1)$};
\draw[thick,->] (57.5,-1.55) -- (58,-2) node[anchor=north west] {$I(1)$};
\draw (56,0) node[below right] {$O$} node{$\bullet$};
\draw (58,0) node[below right] {$1$} node{};
\draw (54,0) node[below left] {$-1$} node{};
\end{tikzpicture}
\end{document}
Franck Pastor
  • 18,756
Student
  • 291
  • 1
    Hi, right now this is a typical do it for me question. Please, at least show your efforts with a minimal working example. – Johannes_B Mar 10 '15 at 22:27
  • The point is that i dont have many ideas in working like these drawing i have a tex program which draw a frame with ome circle i try to use it but its not compiling thats why i put my question here. – Student Mar 10 '15 at 22:30
  • Then start by posting that code. You at least need to show some effort ;-) – daleif Mar 10 '15 at 22:37
  • When you say you want to add colors to the diagram, where exactly would you like to add them? – Gonzalo Medina Mar 11 '15 at 00:37
  • The first semi circle with color different than the second color and the mesh in the small circle to be another color... – Student Mar 11 '15 at 00:53
  • Please see my updated answer. Is it something like that what you want? – Gonzalo Medina Mar 11 '15 at 01:21
  • Yes thats it exactly, thank you very much for your work – Student Mar 11 '15 at 01:25
  • You're welcome. Sorry to bother you but I just noticed that eventhough you have upvoted answers (which is great), you still haven't accepted answers to your questions. You can accept the answers that you consider best solved your problem by clicking the checkmark to the left of the answer. In case of doubt, please see How do you accept an answer?. – Gonzalo Medina Mar 11 '15 at 01:31
  • I accept it and now i repeat the acceptance did you get it? – Student Mar 11 '15 at 01:45
  • Yes, and I thank you for that. However, you still haven't accepted any answers. An accepted answer has a green checkmark next to it; see, for example, this answer http://tex.stackexchange.com/a/232414/3954 and the green checkmark to the left below the vote count. Clicking that checkmarks means "to accept" an answer. – Gonzalo Medina Mar 11 '15 at 02:31

3 Answers3

12

Here's one option:

enter image description here

The code:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{patterns}

\tikzset{
smalldot/.style={
  circle,
  fill,
  inner sep=1.2pt
  }
}
\begin{document}

\begin{tikzpicture}[>=latex]
\draw[->] 
  (-5,0) -- (5,0);
\draw[->] 
  (0,-1) -- (0,5);
\begin{scope}
\clip
  (-5,0) rectangle (5,5);
\draw
  (0,0) circle [radius=3cm];
\draw
  (0,0) circle [radius=4cm];
\end{scope}
\draw
  (-1,1) circle [radius=0.65cm] node[smalldot,label={below:$x_{0}$}] {};
\begin{scope}
\clip
  (0,0) circle [radius=3cm];
\draw[pattern=north east lines]
  (45:3cm) circle [radius=0.65cm];
\end{scope}
\draw
  (45:3cm) circle [radius=0.65cm] node[smalldot,label={right:$x_{0}$}] {};
\draw
  (-1,1) -- node[above left=-2pt] {$\rho$} ++(30:0.65cm);

\foreach \Posicion\Label in 
  {(3,0)/$r$,(-3,0)/$-r$,(4,0)/$1$,(-4,0)/$-1$}
{
  \node[below] at \Posicion {\strut\Label};
}
\node[anchor=north west] at (5,0)
  {$x'\in\mathbb{R}^{N-1}$};
\node[anchor=west] at (0,5)
  {$x_{N}$};
\draw[->,help lines]
  (70:3cm) to[out=40,in=180] ++(2cm,20pt) node[right,text=black] {$I^{\ast}(r)$};
\draw[->,help lines]
  (70:4cm) to[out=40,in=180] ++(2cm,20pt) node[right,text=black] {$I^{\ast}(1)$};
\end{tikzpicture}

\end{document}

In comments it was requested to add dome color:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{patterns}

\tikzset{
smalldot/.style={
  circle,
  fill,
  inner sep=1.2pt
  }
}
\begin{document}

\begin{tikzpicture}[>=latex]
\begin{scope}
\clip
  (-5,0) rectangle (5,5);
\filldraw[fill=orange!20]
  (0,0) circle [radius=4cm];
\filldraw[fill=cyan!30]
  (0,0) circle [radius=3cm];
\end{scope}
\draw[->] 
  (-5,0) -- (5,0);
\draw[->] 
  (0,-1) -- (0,5);
\draw
  (-1,1) circle [radius=0.65cm] node[smalldot,label={below:$x_{0}$}] {};
\begin{scope}
\clip
  (0,0) circle [radius=3cm];
\filldraw[fill=red!50]
  (45:3cm) circle [radius=0.65cm];
\end{scope}
\draw
  (45:3cm) circle [radius=0.65cm] node[smalldot,label={right:$x_{0}$}] {};
\draw
  (-1,1) -- node[above left=-2pt] {$\rho$} ++(30:0.65cm);

\foreach \Posicion\Label in 
  {(3,0)/$r$,(-3,0)/$-r$,(4,0)/$1$,(-4,0)/$-1$}
{
  \node[below] at \Posicion {\strut\Label};
}
\node[anchor=north west] at (5,0)
  {$x'\in\mathbb{R}^{N-1}$};
\node[anchor=west] at (0,5)
  {$x_{N}$};
\draw[->,help lines]
  (70:3cm) to[out=40,in=180] ++(2cm,20pt) node[right,text=black] {$I^{\ast}(r)$};
\draw[->,help lines]
  (70:4cm) to[out=40,in=180] ++(2cm,20pt) node[right,text=black] {$I^{\ast}(1)$};
\end{tikzpicture}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • thank you again, but I have a problem, when I'm compiling it the "-1, -r, r, 1" doesn't appear but what appear is "(-4,0), (-3,0), (0,3), (0,4)". can you help me why it's like that? @Gonzalo Medina – Student Mar 13 '15 at 01:11
4

Here is an initial response with tikz

\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=3]

\draw[->] (-1.5,0) -- (1.5,0) node[below]{$x'\in \mathrm{R}^{N-1}$};
\draw [->] (0,-0.1)--(0,1.5) node[right]{$x_N$};

\draw (1,0)node[below]{1} arc (0:180:1)node[below]{-1};

\def\radius{0.7}
\draw (\radius,0)node[below]{r} arc (0:180:\radius)node[below]{-r};
\draw (35:\radius) circle (0.2);
\begin{scope}
\draw[clip] (\radius,0)node[below]{r} arc (0:180:\radius)node[below]{-r};
\draw[fill=yellow]  (35:\radius) circle (0.2);
\end{scope}
\end{tikzpicture}

\end{document} 

enter image description here

rpapa
  • 12,350
1

To kill the time, I've tried to reproduce Gonzalo Medina's solution with MetaPost and LuaLaTeX. It wasn't that easy, but the most difficult was to find (more or less) matching colours in the standard SVG specifications (translated for MetaPost by the mpcolornames package), since I don't understand the coloring instructions of tikz. (I was too lazy to start reading the manual, but I'll be learning more soon, I promise :-))

\documentclass[12pt, border=2bp]{standalone}
\usepackage{unicode-math}
\usepackage{luamplib}
    \mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
input mpcolornames;
beginfig(1);
    numeric u, r, rho, xmin, xmax, ymin, ymax; 
    u = 5cm; r = .75u; rho = .15u; z0 = u*(-.25, .25);
    xmax = -xmin = 1.25u; ymin = -.25u; ymax = 1.25u;
    path circle[], dome[], arrow[], intersect;
    dome1 = halfcircle scaled (2r); z1 = point 1 of dome1;
    dome2 = halfcircle scaled (2u);
    circle1 = fullcircle scaled (2rho) shifted z0; 
    circle2 = fullcircle rotated 90 scaled (2rho) shifted z1;
    intersect = buildcycle(dome1, circle2);


    fill dome2 -- cycle withcolor PeachPuff;
    fill dome1 -- cycle withcolor PaleTurquoise;
    fill intersect withcolor Salmon;
    for i = 1,2: draw dome[i]; draw circle[i]; endfor
    pickup pencircle scaled 3bp;
    drawdot z0 withpen pencircle scaled 3bp; 
    drawdot z1 withpen pencircle scaled 3bp;


    pickup pencircle scaled .5bp;
    z2 = point 0.7 of circle1;
    draw z0 -- z2;
    drawarrow (xmin, 0) -- (xmax, 0);
    drawarrow (0, ymin) -- (0, ymax); 
    label.bot("$x_0$", z0); label.urt("$x_0$", z1);
    label.top("$\rho$", .4[z0, z2]);
    label.bot("$-1$", (-u, 0)); label.bot("$1$", (u, 0));
    label.bot("$-r$", (-r, 0)); label.bot("$r$", (r, 0)); 
    label.rt("$x' \in \mathbb{R}^{N-1}$", (xmax, 0));
    label.lft("$x_N$", (0, ymax));

    arrow1 = (point 1.5 of dome1){dir 45} .. u*(.8, .9); 
    drawarrow arrow1 withcolor Gray; label.rt("$I^*(r)$", point 1 of arrow1);
    arrow2 = (point 1.5 of dome2){dir 40} .. u*(.9, 1.1); 
    drawarrow arrow2 withcolor Gray; label.rt("$I^*(1)$", point 1 of arrow2);
endfig;
\end{mplibcode}
\end{document}

enter image description here

Franck Pastor
  • 18,756