I am trying to plot a couple of streamlines over a circle, defined as x^2 + y^2 - 4, so the radius is 2. I am trying plot using a function, specifically using PSTricks. However, I keep getting extra lines that I do not want like so:

enter image description here

Using an image editing program I just filled in the lines that I am not interested in with the colour blue.

The code I am using to generate the above image is:

\begin{pspicture}(-5, -5)(5, 5)
    \psaxes{<->}(0, 0)(-5, -5)(5, 5)[$x$, 0][$y$, 90]
        linecolor       = red,
        stepFactor      = 0.1
        y - y * (y^2 + x^2 - 4)^-1 - 1.1

I am also trying to create a plot that plots many streamlines, how would I do this? If you look at the function, y - y * (y^2 + x^2 - 4)^-1 - 1.1, it is only 1.1 that would need to be changed, iteratively with a common difference of 0.1, in order to get different streamlines.

Any help would be so much appreciated!

  • See the example on page 57 of the pst-func documenation. – Christoph Feb 1 '14 at 23:29

I'm not sure, what the actual problem in your document is, but the chapter about \psImpPlot in the pst-func documentation contains an example how to draw these stream lines. Here the adapted version for a circle with radius 2:

\documentclass[pstricks, margin=5pt]{standalone}
      r 0.5 mul dup mul 2.0 r div sub phi sin dup mul mul \rA\space sub }}%

enter image description here

| improve this answer | |
  • How do I make this plot smooth? As of now the streamlines are not smooth and appear like steps. Is there any way to make the plots smooth? – Damitr Dec 18 '18 at 14:18
  • 1
    @Damitr See tex.stackexchange.com/a/8019 and the comments – Christoph Dec 18 '18 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.