-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem Description
The streamplot() function shows arrows by default even when no arrowsize or arrowstyle parameters are provided. This contradicts the expected behavior where streamlines should be plain lines without arrows unless explicitly requested.
Current Behavior
When calling:
call streamplot(x, y, u, v, density=1.0_wp)The output shows arrows on the streamlines (both PNG and PDF).
Expected Behavior
- Without arrow parameters: Plain streamlines (no arrows)
- With arrow parameters: Streamlines with arrows
call streamplot(x, y, u, v, density=1.0_wp, arrowsize=1.5_wp, arrowstyle='->')
This matches matplotlib's behavior where streamplot() shows plain lines by default and arrows are opt-in via parameters.
Evidence
Current output (incorrectly shows arrows):
file:///home/ert/code/fortplot/output/example/fortran/streamplot_demo/streamplot_demo.png
Source code at line 31 of example/fortran/streamplot_demo/streamplot_demo.f90:
call streamplot(x, y, u, v, density=1.0_wp) ! No arrow parametersThe example explicitly creates TWO variants:
- Base streamplot (line 31) - should have NO arrows
- Arrow variant (line 43) - should have arrows with
arrowsize=1.5_wp, arrowstyle='->'
Currently both show arrows, making them indistinguishable.
Root Cause
Likely in streamplot implementation where arrow rendering is enabled by default instead of being conditional on arrowsize/arrowstyle parameters being present.
Files Involved
- Streamplot implementation:
src/plotting/fortplot_streamplot_*.f90 - Arrow rendering: Backend-specific (raster/vector)
Impact
- Unexpected default behavior differs from matplotlib
- Users cannot create plain streamlines without arrows
- Example demonstrates incorrect behavior
Related Issues
Reported in #1413 but not a PDF-specific issue - affects both PNG and PDF backends equally. This is a default parameter/logic issue in the streamplot implementation.
Priority
Medium - Functional but behavior doesn't match expected matplotlib-style API.