JuliaGraphics / Winston.jl

2D plotting for Julia
MIT License
171 stars 55 forks source link

Request for quiver plot #171

Open abahm opened 10 years ago

abahm commented 10 years ago

One feature is that is missing from the Julia plotting eco-system (Winston, Gadly, Plotly) generally is a 2D quiver plot (or vector plot, as can be seen here: http://en.wikipedia.org/wiki/File:VectorField.svg). This is a scatter plot with arrows pointing in certain directions instead of points. Quiver plots are highly useful in physics and in analysis of ordinary differential equations (and of course, I need one for my research :-) I consider Winston the first place to go to do my plotting, and having it supported here would increase the draw for undergraduate ODE teachers to turn to this great language for teaching support. I think it would be a big win for Julia if Winston supported this type of plot.

lobingera commented 10 years ago

something like #172 ?

You see x-y grid with 15 steps, random length and direction.

abahm commented 10 years ago

Yes! This would be great - perhaps it can be merged into the main repo.

On Tue, Sep 9, 2014 at 12:03 PM, Andreas Lobinger notifications@github.com wrote:

something like #172 https://github.com/nolta/Winston.jl/pull/172 ?

You see x-y grid with 15 steps, random length and direction.

— Reply to this email directly or view it on GitHub https://github.com/nolta/Winston.jl/issues/171#issuecomment-55017194.

lobingera commented 10 years ago

A pull request is already the polite question to include the code into the main repo...

I never worked with quiver, is the interface x,y, direction, length OK? Winston would have some infrastructure (i was impressed, that line color and line width didn't even need code from my side) to color the arrows also. Is this an option? And for the style of the arrow, the current thing is just 3 lines, any better idea?

abahm commented 10 years ago

The quiver plot interfaces I've seen so far usually offer a (x, y, dx, dy) interface where dx,dy are the offset from the x,y position that the head of the arrow should land on, as opposed to (x,y,theta,r).

Perhaps it would be possible to include that interface as an option via pairing up the xy as (v, dv)?

Secondarily, it would be nice to have the color and line width be optionally vectors as well, so that multiple colors and scales of arrow are possible.

I don't care too much about the arrow head style personally. But if there is an easy way to offer variety, that would be nice for the community. It could always be added later.

Thanks, Alan

On Wed, Sep 10, 2014 at 1:39 AM, Andreas Lobinger notifications@github.com wrote:

A pull request is already the polite question to include the code into the main repo...

I never worked with quiver, is the interface x,y, direction, length OK? Winston would have some infrastructure (i was impressed, that line color and line width didn't even need code from my side) to color the arrows also. Is this an option? And for the style of the arrow, the current thing is just 3 lines, any better idea?

— Reply to this email directly or view it on GitHub https://github.com/nolta/Winston.jl/issues/171#issuecomment-55086405.

nolta commented 10 years ago

Yes, let's go with (x, y, dx, dy).