Is it possible to draw different curves in different quadrants using TikZ? For example:

$|x|^p+|y|^p=1$ in first and third quadrant and $|x|^q+|y|^q=1$ in second and fourth quadrant, for any fixed real number $p$ and $q$.

  • Welcome again!! I suppose that you second curve is $|x|^q+|y|^q=1$, and I took the liberty of edit you question. Please, revert it if I am wrong. Dec 2, 2021 at 11:04
  • Absolutely okkay!Thank you@JuanCastaño
    – pmun
    Dec 2, 2021 at 11:17

1 Answer 1


Welcome to TeX.SE!!!

Yes it's possible. You can draw each 'piece' in a different plot as in my example, defining the functions (I did it with only one that takes two variables) and the domains.

Something like this:


\begin{tikzpicture}[samples=201,line cap=round]
  \draw[->] (-2, 0) -- (2, 0) node[right] {$x$};
  \draw[->] (0, -2) -- (0, 2) node[above] {$y$};
  \draw[domain= 1: 0,blue] plot ( \x,{ \func(\x,\p)});
  \draw[domain=-1: 0,blue] plot ( \x,{-\func(\x,\p)});
  \draw[domain= 0: 1,red]  plot (-\x,{ \func(\x,\q)});
  \draw[domain= 0:-1,red]  plot (-\x,{-\func(\x,\q)});
  \node[blue] at  (1.5,1.5) {$p=\p$};
  \node[red]  at (-1.5,1.5) {$q=\q$};

will produce: enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .