JuliaPlots / Plots.jl

Powerful convenience for Julia visualizations and data analysis
https://docs.juliaplots.org
Other
1.84k stars 354 forks source link

Deprecate Gadfly backend and create Compose backend? #261

Closed tbreloff closed 8 years ago

tbreloff commented 8 years ago

It's possible that with the tb_recipes branch that I'm working on, plotting through Gadfly will actually be way more complicated than just drawing directly with Compose. I'm currently trying out incorporating Measures when computing optimal subplot layouts. If I'm already laying out axes, ticks, labels, etc, and specifying everything to draw, then I need to quantify what Gadfly helps with, and how much.

pkofod commented 8 years ago

Ambitious, keep us updated!

lobingera commented 8 years ago

I was bicycling now for an hour and (not only, but) thought about how to answer and i really like Patrick's reply: Ambitious.

Being now part of a few debates/discussions how to bring plotting in julia forward my recommendation would go even beyond that: Think about using the Compose successor (which is not existing, i admit).

I worked a little bit with Compose and i contributed the PR on images https://github.com/dcjones/Compose.jl/pull/141 but from my background on interactive plotting Compose felt never 'right' (one of my main concerns is how coordinate transformation, CTM is handeled). So i was impressed how Tim did Immerse.jl with only a few tricks. This https://github.com/dcjones/Compose.jl/issues/201 also sends the message, Compose's way of putting contexts into contexts into contexts might not be the most future proof.

If you are already at the level that you have relative or absolute coordinates, you might think about using https://github.com/andrewcooke/Drawing.jl or https://github.com/cormullion/Luxor.jl or go down to Cairo.jl.

tbreloff commented 8 years ago

my recommendation would go even beyond that

I like the way you think! I'll be perfectly honest... a large motivation to have Gadfly support at all is simply to convince people that they have no reason to use Gadfly. I know that sounds weird, but it's a lot easier to convince people to use a new tool if it's a superset of their previous tool. Lots of people use Plots because they're really producing PyPlot or Gadfly plots... but the future is that no one will use the PyPlot or Gadfly backends. I knew this when I spent (and still spend) all that time on them, but it's a necessary evil to get adoption of Plots.

Do you have experience with Drawing or Luxor? How do you feel about speed/interface?

cc: @andrewcooke @cormullion

timholy commented 8 years ago

I've not been able to keep up with plotting stuff lately (@tbreloff, how DO you do it?), but by pure chance I happened to look at this subject line more closely than usual.

I often think people matter more than projects, and were @dcjones still moving mountains I would simply defer to him on the matter. But in his absence, I agree that Gadfly/Compose could use an overhaul, if we decide to keep pushing on a pure-Julia plotting solution. I'm interested in splitting out pieces of Gadfly (e.g., deciding on tick labels and rendering them) for my own purposes. For Compose, a first-order question is how to make it type-stable, since that's important for performance.

Compose's way of putting contexts into contexts into contexts might not be the most future proof.

It's both (1) part of what makes interactivity somewhat challenging and (2) one of Composes' greatest strengths.

tbreloff commented 8 years ago

I'm interested in splitting out pieces of Gadfly

I'm in full support of this! There are some great things inside Gadfly, and I'd love to use them without using the whole package.

It's both (1) part of what makes interactivity somewhat challenging and (2) one of Composes' greatest strengths.

I agree here. There are some design aspects that were done really well in Compose, but it's hard to be both totally general and very fast. Sometimes you just need raw drawing, sometimes you need elegant compositions. It's important to have both available.

Maybe we can have a deep-dive discussion at JuliaCon??

timholy commented 8 years ago

In principle, I'd love to (1) stick around for a while at the hackathon, and (2) focus on plotting. I'd also love to focus on many other things, and only one can win, but plotting is a strong contender. Will you be at the hackathon? I haven't made my travel plans yet, so I'm still unsure.

tbreloff commented 8 years ago

I'm planning to be there through the hackathon, but a discussion over drinks works just as well!

timholy commented 8 years ago

Sounds good, then.

cormullion commented 8 years ago

@tbreloff Luxor is a quick hack because Cairo is too wordy and Compose is too difficult (for me). Don't look at it! :)

lobingera commented 8 years ago

@tbreloff

Do you have experience with Drawing or Luxor? How do you feel about speed/interface?

Well, as both are only thin layers on Cairo i don't expect speed bumps here; the interface i'd give a try. My own plotting solution would be based pure cairo, because i already have experiences with that. Or something similar API-like.

I like the way you think! I'll be perfectly honest... a large motivation to have Gadfly support at all is simply to convince people that they have no reason to use Gadfly. I know that sounds weird, but it's a lot easier to convince people to use a new tool if it's a superset of their previous tool. Lots of people use Plots because they're really producing PyPlot or Gadfly plots... but the future is that no one will use the PyPlot or Gadfly backends. I knew this when I spent (and still spend) all that time on them, but it's a necessary evil to get adoption of Plots.

I'm not really sure if i understand your position.

@timholy I do not claim, that Compose does something wrong. But diverting form a pure tree structure might help on some places (like a grid context or list of contexts) and for obvious reasons (clicking on items) i would like to see in-place coordinate transformation.

Unfortunately i'll not be at JuliaCon, but please keep me connected. Maybe i'll post something as reminder about whitespaces in graphics and plotting to julia-users.

tbreloff commented 8 years ago

I think I'm going to move forward with deprecating Gadfly (and Immerse by association). I can't justify spending the time right now to get it ready with Plots 0.7 when it only offers a subset of functionality as compared to other backends, and the implementation is pretty complicated. I still like the idea of a pure-Julia option, so please try to convince me on the best path forward!

(of course, if anyone feels motivated enough to update the Gadfly backend code and submit a PR, please do!!)

lobingera commented 8 years ago

Could you clarify what you mean by 'pure-Julia option'? Plotting without any external library?

tbreloff commented 8 years ago

Well I guess I mean a "mostly julia" option. PyPlot requires a bunch of python libraries called through PyCall, Plotly/PlotlyJS require javascript and web tech, GR requires GR, Gaston wraps GnuPlot, PGFPlots has lots of latex deps, etc. I guess at some point there's always going to be external dependencies of some sort for backends... but it would be nice to have an option where those dependencies were mostly based in Julia.

Gadfly, Winston, InspectDR? I think there's a bunch of candidates, and none of them get me quite excited enough to work on them in the short term.

ma-laforge commented 8 years ago

I find the recipes idea in v0.7 really interesting. I must admit though: I don't fully understand how the magic works or even how to use it properly.

Recipes do seem to align well with the "Grammar of Graphics" philosophy... Well at least the parts I have read.

My guess is that your plotting module would probably come with a bunch of recipes pre-defined... which would mean we don't necessarily need to know how, but it will be easier for the module to support more plot types.

Well, if you do go the Cairo route, feel free to scavenge from InspectDR.

tbreloff commented 8 years ago

I plan to write and post a complete guide to recipes in the next week or so, and I hope you'll understand better then. It certainly aligns with GoG concepts, but taking full advantage of julia.

On Thursday, June 2, 2016, ma-laforge notifications@github.com wrote:

I find the recipes idea in v0.7 really interesting. I must admit though: I don't fully understand how the magic works or even how to use it properly.

Recipes do seem to align well with the "Grammar of Graphics" philosophy... Well at least the parts I have read.

My guess is that your plotting module would probably come with a bunch of recipes pre-defined... which would mean we don't necessarily need to know how, but it will be easier for the module to support more plot types.

Well, if you do go the Cairo route, feel free to scavenge from InspectDR.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tbreloff/Plots.jl/issues/261#issuecomment-223480116, or mute the thread https://github.com/notifications/unsubscribe/AA492sMo2XEfkxjhJyH9fG6p1_UQQAWxks5qH5o9gaJpZM4IgXPO .

tbreloff commented 8 years ago

I'm going to close this for now. Gadfly is deprecated, and I won't be building a new backend from scratch in the near term. I'll open a new issue if needed.