Hey @Andreas Frederiksen, The streamslice function is designed to work with rectangular domains defined by the X and Y coordinate grids. When you have a non-rectangular domain, such as the parabolic domain created by transforming Y to Ynew, the function still operates within the bounding rectangle of the provided grid. Unfortunately, streamslice does not have built-in support for non-rectangular domains, but you can work around this limitation by using masking techniques to hide parts of the plot that fall outside your desired domain.
Here's how you can approach this problem:
1. Mask the Streamlines:
- Plot the streamlines using streamslice.
- Use masking to hide parts of the streamlines that fall outside your desired domain.
2. Custom Plotting:
- Use stream2 to compute the streamlines manually and then selectively plot only those segments that lie within your desired domain.