-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
streamline plots #10775
Comments
comment:1
And here is another file from the same message with some fantastically nice plots: Code: http://www.atm.damtp.cam.ac.uk/people/tjf37/streamplot.py Result: http://www.atm.damtp.cam.ac.uk/people/tjf37/streamlines1.png Result 2: http://www.atm.damtp.cam.ac.uk/people/tjf37/streamlines2.png |
Attachment: streamlines.py.gz Attachment: streamplot.py.gz |
comment:2
I've attached both code files so that we have them even if the above links go down for whatever reason. |
comment:3
See http://sagenb.org/home/pub/3237/ for a short example and rough Sage code (posted at http://sage.math.washington.edu/home/jason/sage-field-plots/) |
comment:4
Yo, this is now in mpl!
|
Upstream: Fixed upstream, but not in a stable release. |
comment:5
See also http://sage.cs.drake.edu/home/pub/60/ for another example. |
comment:6
Attachment: DE Solutions (1).sws.gz I attached the example I pointed out in the sage.cs.drake.edu server. |
comment:7
#13693 is for the appropriate mpl upgrade for this. |
comment:12
Here are some upstream examples. Here is another example from somewhere in this discussion, allowing phase plots. Not directly related but looks nice with such things.
|
comment:13
I was hoping we could resurrect this ticket as I am teaching a class on ODE's this semester and would like to plot streamlines on top of the slope fields. Does someone have some time to work on this? Alas, I don't know how much time I might have to do so. So streamlines are included in matplotlib: http://matplotlib.org/examples/images_contours_and_fields/streamplot_demo_features.html There is also another plot package I came across that is open-source python that does streamlines: https://plot.ly/python/streamline-plots/ |
Changed upstream from Fixed upstream, but not in a stable release. to Completely fixed; Fix reported upstream |
comment:14
Since I spent too much time today reading graphics code, I can take a crack at this. It looks like a new class is needed, modeled on Travis, if you see a way to avoid a new class, then let me know before I dive in tomorrow. |
comment:15
To clarify: by new class I mean an individual file like |
Changed branch from u/tscrim/streamline_plot-10775 to u/paulmasson/streamline_plot-10775 |
comment:27
Ah, so that's what you had in mind for the additions. The documentation would not build without some fixes. Sphinx plots do not allow New commits:
|
comment:28
Don't know if you noticed, Travis, but in the example with http://matplotlib.org/examples/images_contours_and_fields/streamplot_demo_start_points.html but even with setting up a numpy array as indicated and transposing it, the streamlines still do not pass through the start points. In fact the resulting graph is exactly the same as not bothering to process the points, so apparently that isn't necessary. Problem with |
comment:29
Thanks for fixing that Paul. I guess we should add a note and example about the behavior of Actually, I think I should not be normalizing the input when we want to consider it as a slope field, which makes sense when considering plotting the tangent lines. I believe it just adds a unnecessary computation that cancels when considering splitting |
comment:31
Documentation for implemented plot options now included. I also updated your language for I'm including a commented code block for the official way to handle |
comment:32
I disagree with adding Does the "official way" for |
comment:33
Replying to @tscrim:
Not that I can tell. |
comment:34
Let's use the official way. Also (not that it makes any real difference), you don't need to pop off the option: if 'start_points' in options:
xstart_array, ystart_array = [], []
for point in options['start_points']:
xstart_array.append(point[0])
ystart_array.append(point[1])
options['start_points'] = numpy.array([xstart_array, ystart_array]).T |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:36
Thank you for all your work on this. |
comment:37
Not sure what Volker will find in his current run but I am failing to build the documentation in sage-on-gentoo
I have this several times. I note that the bots have a similar problem in their logs. |
comment:38
I had thought the first part of comment:32 was done by Paul. I removed New commits:
|
Changed branch from u/paulmasson/streamline_plot-10775 to u/tscrim/streamline_plot-10775 |
comment:39
Documentation now builds. Setting back to positive review. |
Changed branch from u/tscrim/streamline_plot-10775 to |
Recently there was a thread on the matplotlib list where someone posted matplotlib code for a streamline plot. It looks very nice. If the code doesn't get included in matplotlib, we could still ask about including it in Sage to do streamline plots.
Mailing list message: http://permalink.gmane.org/gmane.comp.python.matplotlib.general/26362
Mailing list thread: http://comments.gmane.org/gmane.comp.python.matplotlib.general/26354
Example code: http://web.mit.edu/speth/Public/streamlines.py
Example plot: http://web.mit.edu/speth/Public/streamlines.png
Upstream: Completely fixed; Fix reported upstream
CC: @kcrisman @alauve @sagetrac-jakobkroeker @paulmasson @sagetrac-jhonrubia6
Component: graphics
Author: Paul Masson
Branch/Commit:
640cb6a
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/10775
The text was updated successfully, but these errors were encountered: