Re: [julia-users] Re: Plotting-package-independent API

2015-01-23 Thread Yuuki Soho
It seems there's two levels where things could be standardized, for me a good plotting API primarily need to provide good primitives: dot, line, rectangle, ellipse, patch, text, ... I don't know if those could be standardized so that plotting methods could be written in a rendering back-end ind

Re: [julia-users] Re: Plotting-package-independent API

2015-01-22 Thread David van Leeuwen
Thanks for all the suggestions---the Require package is probably what I go for now. Looking at Sims.jl, it is probably not the most fun implementing the various plots I want to make in the many plotting environments available in Julia, the least of which are to get all those environments work

Re: [julia-users] Re: Plotting-package-independent API

2015-01-22 Thread Tom Short
Sims.jl uses the Requires.jl approach that Matt mentioned. There are a few helper plotting methods that are optional depending on what packages the user loads: https://github.com/tshort/Sims.jl/blob/master/src/utils.jl#L158-L181 https://tshort.github.io/Sims.jl/plotting/ On Thu, Jan 22, 2015 a

[julia-users] Re: Plotting-package-independent API

2015-01-22 Thread Matt Bauman
I've thought some about this in the past, too. Coming from Matlab, I've imagined a Matlab-esque Base.Plots module that has just a handful of definitions, mirroring the IO system: abstract AbstractPlot immutable NoPlots <: AbstractPlot end STDPLOT = NoPlots() # When a plotting package loads, it

[julia-users] Re: Plotting-package-independent API

2015-01-22 Thread Simon Danisch
The reference does seem to fit here, as a general plotting language seems to be awfully complicated. By the way, I totally forgot to mention, that I want to turn GLPlot more into a meta package, offering different plotting interfaces, since I'm generalizing more and more of the render code and

[julia-users] Re: Plotting-package-independent API

2015-01-22 Thread j verzani
I don't know if it is a good idea or not, but using the `Requires` package is one way to do this. That package's `@require` macro lets you define functions when another package is loaded, such as a plotting package. A pattern like this can be used: using Requires Requires.@require PyPlot begin

[julia-users] Re: Plotting-package-independent API

2015-01-22 Thread Daniel Jones
The issue now is that there are several plotting packages, each with advantages and disadvantages, forcing users to make a choice often from limited information. I'm afraid defining another plotting API in Base, rather than simplifying the matter, will just create another choice you'll have to

[julia-users] Re: Plotting-package-independent API

2015-01-22 Thread David van Leeuwen
Hello, On Thursday, January 22, 2015 at 5:13:05 PM UTC+1, Simon Danisch wrote: > > Well, I'm planning to introduce some functionality similar to show, > building upon a rich type system. > What I have in mind is something like this: > > show(::Matrix{Z}; parameters...) => Surface > show(::

[julia-users] Re: Plotting-package-independent API

2015-01-22 Thread Simon Danisch
Well, I'm planning to introduce some functionality similar to show, building upon a rich type system. What I have in mind is something like this: show(::Matrix{Z}; parameters...) => Surface show(::Matrix{Red}; parameters...) => Red channel show(::Matrix{RGB}; parameters...) => Image show