Mathematica Labeling Streamlines in StreamPlot

  • Thread starter Thread starter member 428835
  • Start date Start date
AI Thread Summary
The user is attempting to label two sets of streamlines in a StreamPlot but is encountering difficulties. They initially used a LineLegend for labeling, which did not work as intended. A simpler approach was suggested, using a direct list for PlotLegends instead. This method effectively labels the two graphs as "graph 1" and "graph 2." The discussion emphasizes the importance of using the correct syntax for labeling in StreamPlot.
member 428835
Hi PF!

I am trying to label two different sets of streamlines but am having no luck. My code is
Code:
StreamPlot[{{y, -x}, {x, y}}, {x, -3, 3}, {y, -3, 3},
 PlotLegends -> LineLegend["graph 1", "graph 2"]]
Thanks!
 
Physics news on Phys.org
Try the simpler approach
Code:
StreamPlot[{{y, -x}, {x, y}}, {x, -3, 3}, {y, -3, 3},
PlotLegends -> {"graph 1", "graph 2"}]
 
  • Like
Likes member 428835
Thanks!
 

Similar threads

Replies
4
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
2
Views
2K
Replies
1
Views
2K
Replies
13
Views
2K
Replies
3
Views
2K
Back
Top