Re: [julia-users] Re: Syntax sugar for composite type decomposition?

2016-11-16 Thread Tom Breloff
https://github.com/JuliaML/StochasticOptimization.jl/blob/master/src/utils.jl#L2-L16

Don't use it though. :)

On Wed, Nov 16, 2016 at 8:07 AM, Mauro  wrote:

> On Wed, 2016-11-16 at 14:02, FANG Colin  wrote:
> > Macro seems to have answered this in a different thread
> > https://github.com/mauro3/Parameters.jl
>
> lol: Yes that package contains "macros" but my name is Mauro :-)
>
> > On Wednesday, November 16, 2016 at 1:01:32 PM UTC, FANG Colin wrote:
> >>
> >> Do we have a decomposition syntax or macro that simplifies this
> >>
> >>
> >> a = x.a
> >> b = x.b
> >> c = x.c
> >> ...
> >>
> >>
> >>
>


Re: [julia-users] Plots.jl: layout of several plots, with more than one curve per plot

2016-11-15 Thread Tom Breloff
Serious "give a mouse a cookie syndrome".  You can do what you want by
calling 'plot_6 = deepcopy(plot_5)' first.

On Tuesday, November 15, 2016, Ferran Mazzanti <ferran.mazza...@gmail.com>
wrote:

> Oh, now I see that just by copying plot_5 with a new name plot_6 and
> replacing
>
> plot( plot_1, plot_2, plot_3, plot_4, plot_5, plot_5, layout = lay )
>
> with
>
> plot( plot_1, plot_2, plot_3, plot_4, plot_5, plot_6, layout = lay ),
>
> it works. But IT IS a bug, there is no reason why should not be able to
> repeat a plot. You are supposed to be able to plot whatever you want, isn't
> it? And if you think it makes not sense, then at least one should document
> it. I could think of many situations where the same plot is repeated... for
> instance, when learning how to arrange several plots together, and you do
> not worry about what you plot, just want to see the final arrangement. But
> if you still think it does not make sense what I say (why not?), it doesn't
> hurt to document the limitations...
>
> Cheers,
>
> Ferran.
>
>
> On Monday, November 14, 2016 at 2:50:13 PM UTC+1, Tom Breloff wrote:
>>
>> The behavior is currently undefined if you pass in the same plot twice.
>> Unless there's a compelling reason, I don't think that will change.
>>
>> On Monday, November 14, 2016, Scott T <sgseab...@gmail.com> wrote:
>>
>>> Oh my mistake, I see you have supplied plot_5 twice. If I do that, I get
>>> the problem you describe.
>>>
>>> I'm not quite sure why you'd want to repeat a plot, but it looks like
>>> this is causing problems. If you really want to include plot_5 twice, I
>>> suggest making a new plot_6 with the same parameters and including that
>>> instead.
>>>
>>> I'll open a bug report at Plots for this behaviour.
>>>
>>> Scott
>>>
>>> On Monday, 14 November 2016 11:59:45 UTC, Scott T wrote:
>>>>
>>>> The layout has space for 6 plots but the final plot command only
>>>> supplies 5. When I run your example (on the development branch of Plots) I
>>>> get an error because of that. Have you tried the dev branch?
>>>> `Pkg.checkout("Plots, "dev")`, restart julia and re-run it.
>>>>
>>>> Scott
>>>>
>>>> On Monday, 14 November 2016 11:29:09 UTC, Ferran Mazzanti wrote:
>>>>>
>>>>> It is a minor variation of the example given by Scott
>>>>> for some data set y, cosy, y2, sqrty, siny, logy (doesn't matter the
>>>>> values, could be random)
>>>>>
>>>>> plot_1 = plot([y cosy],
>>>>> title  = "Data y",
>>>>> xlims  = (0,10),
>>>>> ylims  = (-0.1,1.1),
>>>>> grid   = true,
>>>>> xlabel = "Iteration",
>>>>> ylabel = "y & cos(y)"
>>>>> );
>>>>>
>>>>> plot_2 = plot(y2,
>>>>> title  = "Data y Squared",
>>>>> xlims  = (0,10),
>>>>> ylims  = (-0.1,0.5),
>>>>> grid   = false,
>>>>> xlabel = "Iteration",
>>>>> ylabel = "y^2",
>>>>> legend = false,
>>>>> );
>>>>>
>>>>> plot_3 = plot( [sqrty siny],
>>>>> title  = "Square Root of y",
>>>>> xlims  = (0,10),
>>>>> ylims  = (-0.1,0.5),
>>>>> grid   = false,
>>>>> xlabel = "Iteration",
>>>>> ylabel = "y^2"
>>>>> );
>>>>>
>>>>> plot_4 = plot(logy,
>>>>> title  = "Log of y",
>>>>> xlims  = (0,10),
>>>>> ylims  = (-10,0),
>>>>> grid   = false,
>>>>> xlabel = "Iteration",
>>>>> ylabel = "y^2"
>>>>> );
>>>>>
>>>>> plot_5 = plot(expy,
>>>>> title  = "Exp of y",
>>>>> xlims  = (0,10),
>>>>> ylims  = (1,2),
>>>>> grid   = false,
>>>>> xlabel = "Iteration",
>>>>> ylabel = "y^2"
>>>>> );
>>>>>
>>>>> lay = @layout [a grid(2,2); b]
>>>>> plot( plot_1, plot_2, plot_3, plot_4, plot_5, plot_5, layout = lay )
>>>>>
>>>>>


Re: [julia-users] Plots.jl: layout of several plots, with more than one curve per plot

2016-11-14 Thread Tom Breloff
The behavior is currently undefined if you pass in the same plot twice.
Unless there's a compelling reason, I don't think that will change.

On Monday, November 14, 2016, Scott T  wrote:

> Oh my mistake, I see you have supplied plot_5 twice. If I do that, I get
> the problem you describe.
>
> I'm not quite sure why you'd want to repeat a plot, but it looks like this
> is causing problems. If you really want to include plot_5 twice, I suggest
> making a new plot_6 with the same parameters and including that instead.
>
> I'll open a bug report at Plots for this behaviour.
>
> Scott
>
> On Monday, 14 November 2016 11:59:45 UTC, Scott T wrote:
>>
>> The layout has space for 6 plots but the final plot command only supplies
>> 5. When I run your example (on the development branch of Plots) I get an
>> error because of that. Have you tried the dev branch? `Pkg.checkout("Plots,
>> "dev")`, restart julia and re-run it.
>>
>> Scott
>>
>> On Monday, 14 November 2016 11:29:09 UTC, Ferran Mazzanti wrote:
>>>
>>> It is a minor variation of the example given by Scott
>>> for some data set y, cosy, y2, sqrty, siny, logy (doesn't matter the
>>> values, could be random)
>>>
>>> plot_1 = plot([y cosy],
>>> title  = "Data y",
>>> xlims  = (0,10),
>>> ylims  = (-0.1,1.1),
>>> grid   = true,
>>> xlabel = "Iteration",
>>> ylabel = "y & cos(y)"
>>> );
>>>
>>> plot_2 = plot(y2,
>>> title  = "Data y Squared",
>>> xlims  = (0,10),
>>> ylims  = (-0.1,0.5),
>>> grid   = false,
>>> xlabel = "Iteration",
>>> ylabel = "y^2",
>>> legend = false,
>>> );
>>>
>>> plot_3 = plot( [sqrty siny],
>>> title  = "Square Root of y",
>>> xlims  = (0,10),
>>> ylims  = (-0.1,0.5),
>>> grid   = false,
>>> xlabel = "Iteration",
>>> ylabel = "y^2"
>>> );
>>>
>>> plot_4 = plot(logy,
>>> title  = "Log of y",
>>> xlims  = (0,10),
>>> ylims  = (-10,0),
>>> grid   = false,
>>> xlabel = "Iteration",
>>> ylabel = "y^2"
>>> );
>>>
>>> plot_5 = plot(expy,
>>> title  = "Exp of y",
>>> xlims  = (0,10),
>>> ylims  = (1,2),
>>> grid   = false,
>>> xlabel = "Iteration",
>>> ylabel = "y^2"
>>> );
>>>
>>> lay = @layout [a grid(2,2); b]
>>> plot( plot_1, plot_2, plot_3, plot_4, plot_5, plot_5, layout = lay )
>>>
>>>


Re: [julia-users] Problem using FastAnonymous.jl in Julia 0.5

2016-11-13 Thread Tom Breloff
Don't use it? Anonymous functions are fast in 0.5 now.

On Sunday, November 13, 2016,  wrote:

> using FastAnonymous
>
> INFO: Precompiling module FastAnonymous.
> WARNING: symbol is deprecated, use Symbol instead.
>  in depwarn(::String, ::Symbol) at ./deprecated.jl:64
>  in symbol(::String, ::Vararg{String,N}) at ./deprecated.jl:30
>  in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
>  in macro expansion; at ./none:2 [inlined]
>  in anonymous at ./:?
>  in eval(::Module, ::Any) at ./boot.jl:234
>  in process_options(::Base.JLOptions) at ./client.jl:239
>  in _start() at ./client.jl:318while loading 
> /home/juser/.julia/v0.5/Debug/src/AST.jl, in expression starting on line 62
> WARNING: Method definition is_evaluable(Debug.AST.Node{Debug.AST.Location}) 
> in module AST at /home/juser/.julia/v0.5/Debug/src/AST.jl:120 overwritten at 
> /home/juser/.julia/v0.5/Debug/src/AST.jl:121.
> ERROR: LoadError: LoadError: UndefVarError: SymbolNode not defined
>  in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
>  in macro expansion; at ./none:2 [inlined]
>  in anonymous at ./:?
>  in eval(::Module, ::Any) at ./boot.jl:234
>  in process_options(::Base.JLOptions) at ./client.jl:239
>  in _start() at ./client.jl:318while loading 
> /home/juser/.julia/v0.5/Debug/src/Analysis.jl, in expression starting on line 
> 51while loading /home/juser/.julia/v0.5/Debug/src/Debug.jl, in expression 
> starting on line 7
> ERROR: LoadError: Failed to precompile Debug to 
> /home/juser/.julia/lib/v0.5/Debug.ji.
>  in compilecache(::String) at ./loading.jl:593
>  in require(::Symbol) at ./loading.jl:393
>  in include_from_node1(::String) at ./loading.jl:488
>  in macro expansion; at ./none:2 [inlined]
>  in anonymous at ./:?
>  in eval(::Module, ::Any) at ./boot.jl:234
>  in process_options(::Base.JLOptions) at ./client.jl:239
>  in _start() at ./client.jl:318while loading 
> /home/juser/.julia/v0.5/FastAnonymous/src/FastAnonymous.jl, in expression 
> starting on line 5
>
>
> How to solve?
>


Re: [julia-users] Graphs.jl to plot graphs in Jupyter notebooks?

2016-11-11 Thread Tom Breloff
Just posted: http://www.breloff.com/Graphs/

On Fri, Nov 11, 2016 at 11:32 AM, Angel de Vicente <
angel.vicente.garr...@gmail.com> wrote:

> Hi,
>
> Tom Breloff <t...@breloff.com> writes:
> > FYI... I'm working on a demo for this sort of thing... stay tuned:
>
> looking forward to it. In the meantime I found a way to use Graphs to
> nicely display the graphs inside Jupyter notebooks:
>
> ,
> | using Graphs
> | using GraphViz
> |
> | g = simple_graph(3)  #Directed Graph (3 vertices, 0 edges)
> | add_edge!(g, 1, 2)   #edge [1]: 1 -- 2
> | add_edge!(g, 3, 2)   #edge [2]: 3 -- 2
> | add_edge!(g, 3, 1)   #edge [3]: 3 -- 1
> |
> | GraphViz.Graph(Graphs.to_dot(g))
> `
>
> Cheers,
> --
> Ángel de Vicente
> http://www.iac.es/galeria/angelv/
>


Re: [julia-users] Graphs.jl to plot graphs in Jupyter notebooks?

2016-11-11 Thread Tom Breloff
FYI... I'm working on a demo for this sort of thing... stay tuned:


​

On Fri, Nov 11, 2016 at 10:32 AM, David P. Sanders 
wrote:

> Use LightGraphs.jl
>
> I believe that Graphs.jl is deprecated.


Re: [julia-users] Plots.jl: layout of several plots, with more than one curve per plot

2016-11-11 Thread Tom Breloff
"@layout [a grid(2,2); b]" should work

On Friday, November 11, 2016, Ferran Mazzanti 
wrote:

> Sorry for sneaking in again, but I have tried to extrapolate the examples
> in the notebook (thanks again Scott) to include a fifth plot below (that
> is, to get the same structure but with an additional plot at the bottom,
> spanning the whole width and a smaller height) and fail. I can get it to
> work when the upper-right grid, which now is 2x2, is reduced to 1x2, but
> otherwise I can only get a large plot with a smaller one inside...
> Is there a (proper) way to get this done?
> Thanks again,
> Ferran,
>


Re: [julia-users] Re: problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

2016-11-08 Thread Tom Breloff
Sounds like progress.  You might try restarting Julia, and also try the
plotting command a few times.  Blink is known to have a race condition on
startup that sometimes produces this sort of error.

On Tue, Nov 8, 2016 at 1:02 PM, Kostas Oikonomou <
kostas.oikonomo...@gmail.com> wrote:

> Thanks.  Before reading your post, I had added an "if is_bsd()" statement
> to Blink/src/AtomShell/install.jl, and I set arch to "ia32" as FreeBSD
> has default support for 32-bit Linux.
>
> The result is that when I redo AtomBlink.AtomShell.install(), the 32-bit
> Linux binary is installed.
> However, when I do plotlyjs() and then try to plot something, there is an
> error:
>
> ERROR: connect: connection refused (ECONNREFUSED)
>  in yieldto at ./event.jl:136
>  in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
>  in wait at ./event.jl:169
>  in wait at ./event.jl:27
>  in _init at /opt/julia/0.5.0/lib/julia/sys.so:?
>  in stream_wait at ./stream.jl:44
>  in wait_connected at ./stream.jl:265
> ...
>
>
> On Tuesday, November 8, 2016 at 11:32:42 AM UTC-5, randm...@gmail.com
> wrote:
>>
>> I don't think Electron works on FreeBSD (see here
>> ), but Blink requires
>> it. You could try using the Linux binaries by changing this
>> 
>> line to be is_linux() || is_bsd()and call Blink.AtomShell.install()
>> again, but I'm not sure that'll work.
>>
>> A
>>
>


Re: [julia-users] Re: Plots.jl: layout of several plots, with more than one curve per plot

2016-11-08 Thread Tom Breloff
Even better... you should add a tutorial for how to do:
https://github.com/tbreloff/Plots.jl/issues/541

On Tue, Nov 8, 2016 at 12:00 PM, Scott T <sgseaborg...@gmail.com> wrote:

> Sure, happy to add to ExamplePlots! Do you have any more suggestions for
> layout-related features you'd like to showcase? Inset plots? I think the
> key things to get across are how to define layouts and how to overlay/facet
> series within a layout.
>
> Scott
>
>
> On Tuesday, 8 November 2016 16:28:11 UTC, Tom Breloff wrote:
>>
>> Thanks for putting those examples together Scott.  Do you want to
>> contribute that to ExamplePlots?
>>
>> Ferran: as Scott has shown nicely, there's an ton of different ways to do
>> what you want, and the "right" way is going to depend on your problem...
>> what the layouts/data look like.  Many times it's easiest to build the
>> plots independently and then just do: plot(p1, p2, p3, p4, p5, layout = ...)
>>
>> On Tue, Nov 8, 2016 at 11:18 AM, Ferran Mazzanti <ferran@gmail.com>
>> wrote:
>>
>>> Oh!
>>> Scott you're very kind to take your time helping me with the notebook...
>>> thanks a lot. I'll take a careful look and report back if I find problems.
>>> Best,
>>> Ferran.
>>>
>>>
>>> On Tuesday, November 8, 2016 at 1:22:20 PM UTC+1, Scott T wrote:
>>>>
>>>> You can break down the plot command into chunks and then call plot on
>>>> those chunks to build up a plot from several pieces. In this way, you can
>>>> make individual plots with multiple series. Then you can combine them
>>>> according to your desired layout.
>>>>
>>>> This isn't the best place to post a full example so I put a notebook up
>>>> for you to have a look at here:
>>>> https://gist.github.com/swt30/54701d09cfa479dab78a5bc2fa857fd7
>>>>
>>>> Cheers,
>>>> Scott
>>>>
>>>> On Tuesday, 8 November 2016 09:20:39 UTC, Ferran Mazzanti wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm gathering interest in Plots.jl in order to make complex plotting
>>>>> structures. Just as an example, I have a set of data (called y) and some
>>>>> operations performed on it, stored in arrays of obvious names y2, logy,
>>>>> expy etc...
>>>>>
>>>>> I have managed to create something that displays one curve per plot
>>>>>
>>>>> lay = @layout [  a{0.4w} grid(2,2) ]
>>>>> plot(
>>>>> [y y2 sqrty logy expy],
>>>>> layout = lay,
>>>>> grid   = [true false false false false],
>>>>> title = ["y" "y^2" "sqrt(y)" "log(y)" "exp(y)"],titleloc="center",ti
>>>>> tlefont=font(12),
>>>>> xlims = [(0,12)  (0,10) (0,20) (0,20) (0,12) ],
>>>>> )
>>>>>
>>>>> which puts one curve in each plot. What would be the needed
>>>>> modifications here in order to
>>>>> plot y and cosy in the first plot, and sqrty and siny on the second
>>>>> plot?
>>>>>
>>>>> Thanks for your help,
>>>>>
>>>>> Ferran.
>>>>>
>>>>
>>


Re: [julia-users] Re: [Announcement] Moving to Discourse (Statement of Intent)

2016-11-08 Thread Tom Breloff
+1... can we move already?  Discourse is a huge improvement.  I
specifically don't answer some questions here because of the difficulty in
writing answers with code.

On Sun, Nov 6, 2016 at 3:16 PM, Stefan Karpinski 
wrote:

> - Selectively subscribe to certain topics/categories of discussion and not
> others.
> - Selectively see threads that reach certain quality/interest thresholds.
> - Take links directly from where one reads messages
> (I really dislike the Google groups interface, so I use Gmail for
> reading messages, but then getting a link to a post is a real pain; the
> Discourse interface is much better).
> - Real tools for moderation, management and administration.
> - Active, open development
> Google Groups is not only proprietary, but it's also effectively
> abandonware.
>
> On Sun, Nov 6, 2016 at 8:33 AM, Simon Byrne  wrote:
>
>> Personally, I find the following an improvement over google groups:
>> - code blocks (copying and pasting code into the google groups interface
>> always tends to look bad)
>> - the ability to edit posts
>> - the ability to move threads to different categories (i.e. posts to
>> julia-dev which should have gone to julia-users, etc)
>>
>>
>> On Sunday, 6 November 2016 10:33:20 UTC, Milan Bouchet-Valat wrote:
>>>
>>> Le dimanche 06 novembre 2016 à 01:49 -0800, Andreas Lobinger a écrit :
>>> > Hello colleague,
>>> >
>>> > > The Julia community has been growing rapidly over the last few
>>> > > years and discussions are happening at many different places: there
>>> > > are several Google Groups (julia-users, julia-dev, ...), IRC,
>>> > > Gitter, and a few other places. Sometimes packages or organisations
>>> > > also have their own forums and chat rooms.
>>> > >
>>> > > In the past, Discourse has been brought up as an alternative
>>> > > platform that we could use instead of Google Groups and that would
>>> > > allow us to invite the entire Julia community into one space.
>>> > >
>>> >
>>> > What problem with the julia-users mailing-list and the google groups
>>> > web interface is solved by using discourse?
>>> You can have a look at the previous thread about this:
>>> https://groups.google.com/d/msg/julia-users/4oDqW-QxyVA/lw71uqNGBQAJ
>>>
>>> I also encourage you to give a try to Discourse (this can be done
>>> without even creating an account on their test instance).
>>>
>>> > Why do you think (can you prove?) more centralisation will happen
>>> > with discourse?
>>> Centralization will be made possible by allowing for sub-forums
>>> dedicated to each topic (stats, optimization, data...) inside Discourse
>>> itself, instead of creating totally separate mailing lists as is
>>> currently done. Of course people will still be free to use something
>>> else, but that's quite unlikely.
>>>
>>> > > We would like to solicit feedback from the broader Julia community
>>> > > about moving julia-users to Discourse as well, and potentially
>>> > > other mailing lists like julia-stats.
>>> > >
>>> >
>>> > Please define 'We'.
>>> "We" meant "Julia core developers".
>>>
>>> > > If you have feedback or comments, please post them
>>> > > at http://discourse.julialang.org/t/migration-of-google-groups-to-
>>> > > discourse or in this thread.
>>> > >
>>> >
>>> > In some parts of the world, asking for feedback on a topic via a
>>> > different medium is seen as unfriendly act ... but still there is
>>> > this thread.
>>> The idea was that we would like to see how well it works by having
>>> people use Discourse for this discussion. But as you noted there's this
>>> thread for people who don't want to to that.
>>>
>>>
>>> Regards
>>>
>>> > Wishing a happy day,
>>> >  Andreas
>>>
>>
>> On Sunday, 6 November 2016 10:33:20 UTC, Milan Bouchet-Valat wrote:
>>>
>>> Le dimanche 06 novembre 2016 à 01:49 -0800, Andreas Lobinger a écrit :
>>> > Hello colleague,
>>> >
>>> > > The Julia community has been growing rapidly over the last few
>>> > > years and discussions are happening at many different places: there
>>> > > are several Google Groups (julia-users, julia-dev, ...), IRC,
>>> > > Gitter, and a few other places. Sometimes packages or organisations
>>> > > also have their own forums and chat rooms.
>>> > >
>>> > > In the past, Discourse has been brought up as an alternative
>>> > > platform that we could use instead of Google Groups and that would
>>> > > allow us to invite the entire Julia community into one space.
>>> > >
>>> >
>>> > What problem with the julia-users mailing-list and the google groups
>>> > web interface is solved by using discourse?
>>> You can have a look at the previous thread about this:
>>> https://groups.google.com/d/msg/julia-users/4oDqW-QxyVA/lw71uqNGBQAJ
>>>
>>> I also encourage you to give a try to Discourse (this can be done
>>> without even creating an account on their test instance).
>>>
>>> > Why do you think (can you prove?) more centralisation will happen
>>> > with discourse?
>>> Centralization will 

Re: [julia-users] Re: Plots.jl: layout of several plots, with more than one curve per plot

2016-11-08 Thread Tom Breloff
Thanks for putting those examples together Scott.  Do you want to
contribute that to ExamplePlots?

Ferran: as Scott has shown nicely, there's an ton of different ways to do
what you want, and the "right" way is going to depend on your problem...
what the layouts/data look like.  Many times it's easiest to build the
plots independently and then just do: plot(p1, p2, p3, p4, p5, layout = ...)

On Tue, Nov 8, 2016 at 11:18 AM, Ferran Mazzanti 
wrote:

> Oh!
> Scott you're very kind to take your time helping me with the notebook...
> thanks a lot. I'll take a careful look and report back if I find problems.
> Best,
> Ferran.
>
>
> On Tuesday, November 8, 2016 at 1:22:20 PM UTC+1, Scott T wrote:
>>
>> You can break down the plot command into chunks and then call plot on
>> those chunks to build up a plot from several pieces. In this way, you can
>> make individual plots with multiple series. Then you can combine them
>> according to your desired layout.
>>
>> This isn't the best place to post a full example so I put a notebook up
>> for you to have a look at here:
>> https://gist.github.com/swt30/54701d09cfa479dab78a5bc2fa857fd7
>>
>> Cheers,
>> Scott
>>
>> On Tuesday, 8 November 2016 09:20:39 UTC, Ferran Mazzanti wrote:
>>
>>> Hi,
>>>
>>> I'm gathering interest in Plots.jl in order to make complex plotting
>>> structures. Just as an example, I have a set of data (called y) and some
>>> operations performed on it, stored in arrays of obvious names y2, logy,
>>> expy etc...
>>>
>>> I have managed to create something that displays one curve per plot
>>>
>>> lay = @layout [  a{0.4w} grid(2,2) ]
>>> plot(
>>> [y y2 sqrty logy expy],
>>> layout = lay,
>>> grid   = [true false false false false],
>>> title = ["y" "y^2" "sqrt(y)" "log(y)" "exp(y)"],titleloc="center",ti
>>> tlefont=font(12),
>>> xlims = [(0,12)  (0,10) (0,20) (0,20) (0,12) ],
>>> )
>>>
>>> which puts one curve in each plot. What would be the needed
>>> modifications here in order to
>>> plot y and cosy in the first plot, and sqrty and siny on the second plot?
>>>
>>> Thanks for your help,
>>>
>>> Ferran.
>>>
>>


Re: [julia-users] problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

2016-11-07 Thread Tom Breloff
You should probably open issues/PRs in the individual packages then... this
sounds like a Blink issue.

On Mon, Nov 7, 2016 at 5:09 PM, Kostas Oikonomou <
kostas.oikonomo...@gmail.com> wrote:

> Yes, I did.  Unfortunately it didn't help.
>
> On Monday, November 7, 2016 at 3:44:29 PM UTC-5, Tom Breloff wrote:
>>
>> I'll ask the obvious question... did you try
>> "Blink.AtomShell.install()"?  Nice work getting as far as you did.
>>
>>
>>


Re: [julia-users] problems (and some fixes) for using Plots and PlotlyJS on FreeBSD

2016-11-07 Thread Tom Breloff
I'll ask the obvious question... did you try "Blink.AtomShell.install()"?
Nice work getting as far as you did.

On Mon, Nov 7, 2016 at 3:35 PM, Kostas Oikonomou <
kostas.oikonomo...@gmail.com> wrote:

> I am using Julia 0.5.0 on FreeBSD 11.  I've had a few problems trying to
> install the Plots and PlotlyJS packages:
>
> 1. Just after installing Plots, I had to make this fix in
> ~/.julia/v0.5/Plots/src/backends/web.jl, function open_browser_window:
>
>@static if is_linux() || is_bsd()
> return run(`xdg-open $(filename)`)
>end
>
> 2. Now trying to install PlotlyJS.  HttpParser doesn't build, because in
> BinDeps.jl, function unpack_cmd(...), says
>
>elseif extension == ".zip"
>return (`unzip -x $file -d $directory`)
>
> The /usr/bin/unzip on FreeBSD doesn't understand "-x" (more precisely, it
> thinks
> it means "exclude").  GNU gunzip doesn't understand it either.  What
> "unzip" is
> this supposed to be?  I made an ugly hack to work around this.
>
>
> 3. In ~/.julia/v0.5/Blink/src/AtomShell/process.jl: I had to add is_bsd()
> to
>
> @static if is_apple()
>   const _electron = resolve("Blink", "deps/Julia.app/Contents/
> MacOS/Electron")
> elseif is_linux() || is_bsd()
>   const _electron = resolve("Blink", "deps/atom/electron")
> elseif is_windows()
>   const _electron = resolve("Blink", "deps", "atom", "electron.exe")
> end
>
> 4. After all this, I still get the error:
>
> julia> using Plots
> julia> plotlyjs()
> julia> plot(x -> x^2, rand(10))
> Error showing value of type Plots.Plot{Plots.PlotlyJSBackend}:
> ERROR: Cannot find Electron. Try `Blink.AtomShell.install()`.
>  in electron() at /usr/home/ko/.julia/v0.5/Blink/src/AtomShell/process.
> jl:53
>
>
> Thanks for any help.
>
> Kostas
>


Re: [julia-users] using or import a specific package version

2016-11-04 Thread Tom Breloff
Not that I know of. Hopefully the next generation package manager (Pkg3)
will enable this sort of conditional pinning. It should at least enable
dual environments.

On Friday, November 4, 2016, Tom Lee  wrote:

> Hi all,
>
> Is there any way to specify that "using" or "import" should load a
> specific package version without pinning the package to a particular
> version globally? I would like to prevent my older scripts breaking when
> packages are updated while still using the latest version by default.
>
> Thanks,
>
> Tom
>


Re: [julia-users] How do I use Guide.yticks() with a log scale?

2016-11-03 Thread Tom Breloff
Well, only if you'd like to switch your workflow to Plots... (Though the OP
should consider it, this question was asking about Gadfly)

To answer... Gadfly expects the exponent when setting the ticks manually,
not the actual value.

On Wednesday, November 2, 2016, Jeffrey Sarnoff 
wrote:

> Try posting your question/concern here:  discussing Plots.jl
> 
>
>
> On Monday, October 24, 2016 at 4:14:45 PM UTC-4, Dean Schulze wrote:
>>
>>
>> When I plot the DataFrame below using Scale.y_log10 the y-axis has ticks
>> for half powers of 10 (e.g. 10^5.5).  The plot is correct, but it's weird
>> seeing half powers of 10 on a log plot.
>>
>> If I add Guide.yticks(ticks=ymarks) with the following values
>>
>> ymarks=[10^4,10^5,10^6,10^7]
>>
>>
>> I get a plot with the y-axis running up to 10^1000.
>>
>> How can I get rid of the half powers of 10 on the y-axis ticks?
>>
>>
>>
>> 9×2 DataFrames.DataFrame
>> │ Row │ x │ y   │
>> ├─┼───┼─┤
>> │ 1   │ 5000  │ 35950   │
>> │ 2   │ 1 │ 71961   │
>> │ 3   │ 15000 │ 108145  │
>> │ 4   │ 2 │ 154528  │
>> │ 5   │ 24000 │ 395218  │
>> │ 6   │ 28000 │ 689465  │
>> │ 7   │ 32000 │ 2646407 │
>> │ 8   │ 36000 │ 3138533 │
>> │ 9   │ 4 │ 8648694 │
>>
>>
>> ymarks=[10^4,10^5,10^6,10^7]
>> plot(df, x="x",y="y",Scale.y_log10, Guide.yticks(ticks=ymarks) )
>>
>>
>>


Re: [julia-users] Re: Fast vector element-wise multiplication

2016-11-01 Thread Tom Breloff
As I understand it, the .* will fuse, but the .= will not (until 0.6?), so
A will be rebound to a newly allocated array.  If my understanding is wrong
I'd love to know.  There have been many times in the last few days that I
would have used it...

On Tue, Nov 1, 2016 at 10:06 PM, Sheehan Olver 
wrote:

> Ah, good point.  Though I guess that won't work til 0.6 since .* won't
> auto-fuse yet?
>
> Sent from my iPhone
>
> On 2 Nov. 2016, at 12:55, Chris Rackauckas  wrote:
>
> This is pretty much obsolete by the . fusing changes:
>
> A .= A.*B
>
> should be an in-place update of A scaled by B (Tomas' solution).
>
> On Tuesday, November 1, 2016 at 4:39:15 PM UTC-7, Sheehan Olver wrote:
>>
>> Should this be added to a package?  I imagine if the arrays are on the
>> GPU (AFArrays) then the operation could be much faster, and having a
>> consistent name would be helpful.
>>
>>
>> On Wednesday, October 7, 2015 at 1:28:29 AM UTC+11, Lionel du Peloux
>> wrote:
>>>
>>> Dear all,
>>>
>>> I'm looking for the fastest way to do element-wise vector multiplication
>>> in Julia. The best I could have done is the following implementation which
>>> still runs 1.5x slower than the dot product. I assume the dot product would
>>> include such an operation ... and then do a cumulative sum over the
>>> element-wise product.
>>>
>>> The MKL lib includes such an operation (v?Mul) but it seems OpenBLAS
>>> does not. So my question is :
>>>
>>> 1) is there any chance I can do vector element-wise multiplication
>>> faster then the actual dot product ?
>>> 2) why the built-in element-wise multiplication operator (*.) is much
>>> slower than my own implementation for such a basic linealg operation (full
>>> julia) ?
>>>
>>> Thank you,
>>> Lionel
>>>
>>> Best custom implementation :
>>>
>>> function xpy!{T<:Number}(A::Vector{T},B::Vector{T})
>>>   n = size(A)[1]
>>>   if n == size(B)[1]
>>> for i=1:n
>>>   @inbounds A[i] *= B[i]
>>> end
>>>   end
>>>   return A
>>> end
>>>
>>> Bench mark results (JuliaBox, A = randn(30) :
>>>
>>> function  CPU (s) GC (%)  ALLOCATION (bytes)  
>>> CPU (x)
>>> dot(A,B)  1.58e-040.0016  
>>> 1.0 xpy!(A,B) 2.31e-040.0080
>>>   1.5
>>> NumericExtensions.multiply!(P,Q)  3.60e-040.0080  
>>> 2.3 xpy!(A,B) - no @inbounds check4.36e-040.0080
>>>   2.8
>>> P.*Q  2.52e-0350.36   2400512 
>>> 16.0
>>> 
>>>
>>>


Re: [julia-users] ImageView very slow

2016-10-26 Thread Tom Breloff
You're looking for "heatmap". You should read the docs if you want to learn
more.

On Wednesday, October 26, 2016, Paul B.  wrote:

> Tim:  Thank you, that works great.
>
> Josef:  I can plot 2D matrices with GR (which is what I want) but your
> code example doesn't work.  GR looks pretty impressive, I'll have to check
> it out.  A bit disappointed there's no interface to zoom in/out with the
> mouse and for some reason the window won't close.
>
> Tom:  Works for images but not readily clear how to plot something like
> rand(100,100) as a bitmap instead of a 100 lines.  Do I have to convert it
> to an image structure for plot to figure out that it's a bitmap?
>
> Thanks, all!
>


Re: [julia-users] FactCheck.jl bundled with Julia?

2016-10-14 Thread Tom Breloff
Actually that's not true. AFAIK, people are switching back to the new
testing in Base, and FactCheck will be deprecated eventually. (Unless I got
the wrong memo?)

On Friday, October 14, 2016, Júlio Hoffimann 
wrote:

> Hi,
>
> It seems that FactCheck.jl has become the defacto standard for writing
> tests in Julia packages. Wouldn't it be a good idea to have it bundled with
> Julia? Any reason to keep the current test framework?
>
> -Júlio
>


Re: [julia-users] errorbar plot in Plots.jl

2016-10-14 Thread Tom Breloff
Already implemented as attributes: yerror and xerror

On Friday, October 14, 2016,  wrote:

> I have just discovered Plots, which I use mostly with the PlotlyJS backend
> because of the inline interactivity in Juliabox, and I have been spoiled by
> it: thank you Tom and Spencer.
>
> I need an errorbar plot (something like http://matplotlib.org/
> examples/statistics/errorbar_demo_features.html): is there any plan to
> add it? I could use the OHLC plot, but I cannot figure out how to remove
> the horizontal bars.
>
>


Re: [julia-users] python-like generators?

2016-10-13 Thread Tom Breloff
I've used them, and I think a Julia Task is a better comparison. So while
the syntax is different you can accomplish the same thing.

On Thursday, October 13, 2016, Neal Becker  wrote:

> julia-0.5 supports generator expressions, ala python, which is very nice.
>
> Any thoughts on supporting the more general python generator functions, as
> described e.g.: https://wiki.python.org/moin/Generators?  I haven't used
> them much myself (well, once), but they seem a really cool idea.
>
>


Re: [julia-users] Error setting limits on log scale in Plots.jl

2016-10-12 Thread Tom Breloff
Just fixed on master:

using Plots; plotlyjs()
plot(rand(10), xlims = (1e-3,1e2), xscale = :log10)



On Wed, Oct 12, 2016 at 2:59 PM, Tom Breloff <t...@breloff.com> wrote:

> The Plots convention is to set the actual number in the "lims" attribute,
> *not* the exponent.  Do "xlims = (1e-3, 1e2)"
>
> However, it seems like the PlotlyJS backend doesn't handle this
> properly... I'll have to look into it.
>
> Also, for anyone else, the best venue for quick questions like this is in
> the Plots gitter: https://gitter.im/tbreloff/Plots.jl   There are usually
> several people ready to answer questions.
>
> On Wed, Oct 12, 2016 at 2:41 PM, r5823 <jmell...@gmail.com> wrote:
>
>> When I call:
>>
>> using Plots
>> plotlyjs()
>> plot(
>> xlims = (0,2),
>> xscale = :log10,
>> )
>>
>> I get a plot where the xaxis is log scale and ranges from 1 to 100, as I
>> would expect. However, if I call:
>>
>>
>> plot(
>> xlims = (-3,2),
>> xscale = :log10,
>> )
>>
>> I do not get a plot where the xaxis is log scale and ranges from 0.001
>> to 100, as I would have expected. Instead I get a domain error. Is this a
>> bug?
>>
>
>


Re: [julia-users] Error setting limits on log scale in Plots.jl

2016-10-12 Thread Tom Breloff
The Plots convention is to set the actual number in the "lims" attribute,
*not* the exponent.  Do "xlims = (1e-3, 1e2)"

However, it seems like the PlotlyJS backend doesn't handle this properly...
I'll have to look into it.

Also, for anyone else, the best venue for quick questions like this is in
the Plots gitter: https://gitter.im/tbreloff/Plots.jl   There are usually
several people ready to answer questions.

On Wed, Oct 12, 2016 at 2:41 PM, r5823  wrote:

> When I call:
>
> using Plots
> plotlyjs()
> plot(
> xlims = (0,2),
> xscale = :log10,
> )
>
> I get a plot where the xaxis is log scale and ranges from 1 to 100, as I
> would expect. However, if I call:
>
>
> plot(
> xlims = (-3,2),
> xscale = :log10,
> )
>
> I do not get a plot where the xaxis is log scale and ranges from 0.001 to
> 100, as I would have expected. Instead I get a domain error. Is this a bug?
>


Re: [julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread Tom Breloff
This should be fixed on master now.  Just add "link = :all" to your
original example.

On Wed, Oct 12, 2016 at 2:48 PM, r5823 <jmell...@gmail.com> wrote:

> Tom, I appreciate the quick response. Your example does produce a plot
> with the appropriate ylimits, however the use of subplots is important for
> my application since I have multiple data sets of varying size that I would
> like to show on different subplots with a common set of ylimits (or
> xlimits). Thanks for looking into this!
>
>
>
> On Wednesday, October 12, 2016 at 2:23:33 PM UTC-4, Tom Breloff wrote:
>>
>> This should work as you want:
>>
>> plot([[1, 2, 4],[1,5,10,3]], layout=2, link=:all)
>>
>> There seems to be a bug with the link attribute when combining subplots.
>> I'll look into it.
>>
>> On Wed, Oct 12, 2016 at 2:13 PM, r5823 <jmel...@gmail.com> wrote:
>>
>>> Is there a way to make the yaxis and/or the xaxis limits uniform across
>>> subplots in Plots.jl?
>>>
>>> For example, given the code:
>>>
>>> using Plots
>>> gr()
>>> p1 = Plots.plot([1, 2, 4])
>>> p2 = Plots.plot([1,5,10,3])
>>> Plots.plot(p1,p2,layout=(1,2))
>>>
>>> The hope would be to substitute something along the lines of
>>> Plots.plot(p1,p2,layout=(1,2), layout_ylim=:auto) that would result in a
>>> ymax for both subplots being 10. Similarly, something along the lines of
>>> Plots.plot(p1,p2,layout=(1,2), layout_xlim=:auto) to make the xmax for both
>>> subplots be 4
>>>
>>
>>


Re: [julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread Tom Breloff
This should work as you want:

plot([[1, 2, 4],[1,5,10,3]], layout=2, link=:all)

There seems to be a bug with the link attribute when combining subplots.
I'll look into it.

On Wed, Oct 12, 2016 at 2:13 PM, r5823  wrote:

> Is there a way to make the yaxis and/or the xaxis limits uniform across
> subplots in Plots.jl?
>
> For example, given the code:
>
> using Plots
> gr()
> p1 = Plots.plot([1, 2, 4])
> p2 = Plots.plot([1,5,10,3])
> Plots.plot(p1,p2,layout=(1,2))
>
> The hope would be to substitute something along the lines of
> Plots.plot(p1,p2,layout=(1,2), layout_ylim=:auto) that would result in a
> ymax for both subplots being 10. Similarly, something along the lines of
> Plots.plot(p1,p2,layout=(1,2), layout_xlim=:auto) to make the xmax for both
> subplots be 4
>


Re: [julia-users] Re: Why does Julia 0.5 keep complaining about method re-definitions?

2016-10-12 Thread Tom Breloff
I just *immediately* found a bug thanks to the redefinition warning:

julia> using Plots; plotlyjs()
> INFO: Recompiling stale cache file /home/tom/.julia/lib/v0.5/Plots.ji for
> module Plots.
> WARNING: Method definition apply_recipe(Base.Dict{Symbol, Any},
> Type{Base.Dates.Date}, Base.Dates.Date) in module Plots at
> /home/tom/.julia/v0.5/RecipesBase/src/RecipesBase.jl:232 overwritten at
> /home/tom/.julia/v0.5/RecipesBase/src/RecipesBase.jl:232.


So... thanks. :)


On Thu, Sep 29, 2016 at 8:07 AM, Daniel Carrera  wrote:

> Hi everyone,
>
> I created a new issue asking the Julia developers to please restore the
> earlier behaviour. I would be immensely grateful if you could write on this
> issue and let the Julia developers know that I am not the only person who
> would be happier without the sea of warnings.
>
> https://github.com/JuliaLang/julia/issues/18725
>
> Cheers,
> Daniel.
>
>
>
> On 28 September 2016 at 15:15, J Luis  wrote:
>
>>
>> This a very heavy install.  It's fetching tons of things that I have not
>>> used.  Not sure what they are, but seems like trashing my system.
>>>
>>
>> Yes, unfortunately Conda is an unbearably big dependency (over 1.xxx Gb)
>> that sneaks in via un-suspicious packages. A dependency this big should
>> never install without a strict user consent. Docs explain how to avoid it
>> but don't find the explanation clear. I had to declare this
>>
>> ENV["JUPYTER"]="C:/programs/WinPython-3.5.2.2_64/python-3.5.
>> 2.amd64/Scripts/jupyter"
>>
>> to really prevent a Conda installation
>>
>>
>>>
>>> On Wednesday, September 28, 2016 at 4:30:32 AM UTC+8, Cedric St-Jean
>>> wrote:

 Yeah, it's because of IJulia, sorry about that. I need it to support
 autoreloading. I could split the package in two, but it's small enough
 already that it doesn't feel like the right call.

 One day we'll get conditional imports...

 On Tue, Sep 27, 2016 at 4:14 PM, Daniel Carrera 
 wrote:

> Thanks! You are a savior!
>
> Here is something odd: when I installed it with Pkg.clone(...) my
> Julia decided that it also had to update Conda and install Jupyter. Is 
> this
> some weird quirk of my setup. I notice that you import IJulia, so I guess
> that has something to do with it. It's not a big deal; I just thought it
> was weird to see the package manager installing stuff like Qt, fontconfig,
> SSL, and libxml just to clobber include().
>
> But other than that, it works fabulously. Thank you so much!
>
> Cheers,
> Daniel.
>
>
>
> On 27 September 2016 at 21:45, Cedric St-Jean 
> wrote:
>
>> I wrote a work-around earlier today:
>>
>> Pkg.clone("git://github.com/cstjean/ClobberingReload.jl.git")
>>
>> using ClobberingReload: sinclude # silent include
>> sinclude("foo.jl")   # no redefinition warnings
>>
>>
>> It's fresh off the press, so please file an issue if you encounter a
>> problem. It calls `include` under the hood; there's no magic involved. I
>> just intercept STDERR and remove the redefinition warnings.
>>
>> On Tuesday, September 27, 2016 at 3:13:00 PM UTC-4, Andrew wrote:
>>>
>>> It seems like a lot of people are complaining about this. Is there
>>> some way to suppress method overwritten warnings for an include()
>>> statement? Perhaps a keyword like include("foo.jl", quietly = true)?
>>>
>>> On Tuesday, September 27, 2016 at 1:56:27 PM UTC-4, Daniel Carrera
>>> wrote:

 Hello,

 I'm not sure when I upgraded, but I am using Julia 0.5 and now it
 complains every time I redefine a method, which is basically all the 
 time.
 When I'm developing ideas I usually have a file with a script that I 
 modify
 and reload all the time:

 julia> include("foo.jl");

 ... see the results, edit file ...

 julia> include("foo.jl");

 ... see the results, edit file ...
 julia> include("foo.jl");

 ... see the results, edit file ...


 And so on. This is what I do most of the time. But now every time I
 `include("foo.jl")` I get warnings for every method that has been 
 redefined
 (which is all of them):

 julia> include("foo.jl");

 WARNING: Method definition (::Type{Main.Line})(Float64, Float64) in
 module Main at /home/daniel/Data/Science/Thesis/SI.jl:4
 overwritten at /home/daniel/Data/Science/Thesis/SI.jl:4.
 WARNING: Method definition (::Type{Main.Line})(Any, Any) in module
 Main at /home/daniel/Data/Science/Thesis/SI.jl:4 overwritten at
 /home/daniel/Data/Science/Thesis/SI.jl:4.
 WARNING: Method definition new_line(Any, Any, Any) in module 

Re: [julia-users] Setting/getting field-like members with side effects

2016-10-09 Thread Tom Breloff
I think that's great, but know that StochasticOptimization is still being
designed and will likely change.

On Sunday, October 9, 2016, Chris Rackauckas  wrote:

> Missed that one, though it should be
>
> mysolver[:linear_system][:parameters][:solver_type] = :GMRES
>
> There's no reason for an algorithm choice to be a String.
>
> But this entire thing seems wrong-headed. The choice of the solver method
> should likely be done by dispatching on the solve method somehow. This
> seems like trying directly match an object-oriented framework which
> shouldn't be recommended (look at how fast it gets messy). You may want to
> see if you can map a framework like StochasticOptimization.jl
>  to
> IterativeSolvers.jl .
>
> On Sunday, October 9, 2016 at 11:34:46 AM UTC-7, Kristoffer Carlsson wrote:
>>
>> That was one of the suggestions?
>
>


Re: [julia-users] Re: macro: with

2016-10-09 Thread Tom Breloff
What about it?  I don't think there's anything like this in Parameters.

On Sun, Oct 9, 2016 at 1:27 PM, Chris Rackauckas <rackd...@gmail.com> wrote:

> What about Parameters.jl <https://github.com/mauro3/Parameters.jl>?
>
>
> On Wednesday, September 7, 2016 at 7:23:47 AM UTC-7, Tom Breloff wrote:
>>
>> Hey all... I just threw together a quick macro to save some typing when
>> working with the fields of an object.  Disclaimer: this should not be used
>> in library code, or in anything that will stick around longer than a REPL
>> session.  Hopefully it's self explanatory with this example.  Is there a
>> good home for this?  Does anyone want to use it?
>>
>> julia> type T; a; b; end; t = T(0,0)
>> T(0,0)
>>
>> julia> macroexpand(:(
>>@with t::T begin
>>a = 1
>>b = 2
>>c = a + b - 4
>>d = c - b
>>a = d / c
>>end
>>))
>> quote  # REPL[3], line 3:
>> t.a = 1 # REPL[3], line 4:
>> t.b = 2 # REPL[3], line 5:
>> c = (t.a + t.b) - 4 # REPL[3], line 6:
>> d = c - t.b # REPL[3], line 7:
>> t.a = d / c
>> end
>>
>> julia> @with t::T begin
>>a = 1
>>b = 2
>>c = a + b - 4
>>d = c - b
>>a = d / c
>>end
>> 3.0
>>
>> julia> t
>> T(3.0,2)
>>
>>


Re: [julia-users] macro: with

2016-10-09 Thread Tom Breloff
Heh... it took a google search to figure out where I put it.

https://github.com/tbreloff/CTechCommon.jl/blob/master/src/macros.jl#L113-L155

On Sun, Oct 9, 2016 at 12:19 PM, Ben Lauwens  wrote:

> Hi Tom
>
> I am interested. I am building a macro mimicking how iterator blocks are
> transformed in a state-machine in C# (as an alternative to Tasks) and this
> is one of the (many) thinks I have to solve. Can you point me to the
> source? Thanks
>
> Ben


Re: [julia-users] Re: Julia and the Tower of Babel

2016-10-08 Thread Tom Breloff
I think sometimes people go overboard with types, but types allow us to
take full advantage of multiple dispatch and abstraction on another level.
For example, a diagonal matrix and a full/dense matrix are both the same
thing, but if you can dispatch on them differently you can massively
improve the effectiveness/performance of the underlying code without much
effort.  A recent thread here was asking about how to do this effectively
in Python, and... well, everyone just kinda laughed at the idea.  Types
allow us flexibility that we can't have otherwise.

On Sat, Oct 8, 2016 at 10:12 AM, Tsur Herman  wrote:

> I noticed this also .. and this is why I chose to "rip" some packages for
> some of its functionality.
>
> From what I observed the problem is the "coolness" of the language and the
> highly creative level of the package writers. Just as the first post here
> states the seemingly two advantages , cool language and super-creative
> package writers .. can some time have a "babel tower" effect.
>
> I encountered this with respect to image processing geometry primitive
> manipulation etc .. the problem is: too many types!!
>
> if something can be represented as an array with some convention for
> example MxN array where M is the Descriptor size and N is the number of
> Descriptors  .. then it is better to use and support that
> than to declare more specialized types.
>
> At least for fast paced research and idea validation it is better.
> Probably for implementation and performance specialized types optimized for
> speed will be required..
>
>
>


Re: [julia-users] Julia and the Tower of Babel

2016-10-07 Thread Tom Breloff
This is something that I've spent a lot of time and energy thinking and
discussing, as part of both Plots and JuliaML.  I think the situation can
be improved in a big way, but this is not something with a "magic
solution".  It takes time, effort, and a constant desire to collaborate and
design with care for the greater community.  As soon as people get lazy, it
starts to get unwieldy.  So I think the "solution" is just to keep at it...
keep trying to collaborate... keep trying to agree on common conventions...
and always look to find common ground.  Use Base as a guide, whenever
possible, and if there are different conventions in place across packages,
then spend the time to agree on shared conventions.  And if people refuse
to collaborate, give them crap about it.

On Fri, Oct 7, 2016 at 12:02 PM, David Anthoff  wrote:

> I don’t have a solution, but I completely agree with the problem
> description.
>
>
>
> I guess one small step would be that package authors should follow the
> patterns in base, if there are any.
>
>
>
> *From:* julia-users@googlegroups.com [mailto:julia-users@googlegroups.com]
> *On Behalf Of *Gabriel Gellner
> *Sent:* Friday, October 7, 2016 8:36 AM
> *To:* julia-users 
> *Subject:* [julia-users] Julia and the Tower of Babel
>
>
>
> Something that I have been noticing, as I convert more of my research code
> over to Julia, is how the super easy to use package manager (which I love),
> coupled with the talent base of the Julia community seems to have a
> detrimental effect on the API consistency of the many “micro” packages that
> cover what I would consider the de-facto standard library.
>
> What I mean is that whereas a commercial package like Matlab/Mathematica
> etc., being written under one large umbrella, will largely (clearly not
> always) choose consistent names for similar API keyword arguments, and have
> similar calling conventions for master function like tools (`optimize`
> versus `lbfgs`, etc), which I am starting to realize is one of the great
> selling points of these packages as an end user. I can usually guess what a
> keyword will be in Mathematica, whereas even after a year of using Julia
> almost exclusively I find I have to look at the documentation (or the
> source code depending on the documentation ...) to figure out the keyword
> names in many common packages.
>
> Similarly, in my experience with open source tools, due to the complexity
> of the package management, we get large “batteries included” distributions
> that cover a lot of the standard stuff for doing science, like python’s
> numpy + scipy combination. Whereas in Julia the equivalent of scipy is
> split over many, separately developed packages (Base, Optim.jl, NLopt.jl,
> Roots.jl, NLsolve.jl, ODE.jl/DifferentialEquations.jl). Many of these
> packages are stupid awesome, but they can have dramatically different
> naming conventions and calling behavior, for essential equivalent behavior.
> Recently I noticed that tolerances, for example, are named as `atol/rtol`
> versus `abstol/reltol` versus `abs_tol/rel_tol`, which means is extremely
> easy to have a piece of scientific code that will need to use all three
> conventions across different calls to seemingly similar libraries.
>
> Having brought this up I find that the community is largely sympathetic
> and, in general, would support a common convention, the issue I have slowly
> realized is that it is rarely that straightforward. In the above example
> the abstol/reltol versus abs_tol/rel_tol seems like an easy example of what
> can be tidied up, but the latter underscored name is consistent with
> similar naming conventions from Optim.jl for other tolerances, so that
> community is reluctant to change the convention. Similarly, I think there
> would be little interest in changing abstol/reltol to the underscored
> version in packages like Base, ODE.jl etc as this feels consistent with
> each of these code bases. Hence I have started to think that the problem is
> the micro-packaging. It is much easier to look for consistency within a
> package then across similar packages, and since Julia seems to distribute
> so many of the essential tools in very narrow boundaries of functionality I
> am not sure that this kind of naming convention will ever be able to reach
> something like a Scipy, or the even higher standard of commercial packages
> like Matlab/Mathematica. (I am sure there are many more examples like using
> maxiter, versus iterations for describing stopping criteria in iterative
> solvers ...)
>
> Even further I have noticed that even when packages try to find
> consistency across packages, for example Optim.jl <-> Roots.jl <->
> NLsolve.jl, when one package changes how they do things (Optim.jl moving to
> delegation on types for method choice) then again the consistency fractures
> quickly, where we now have a common divide of using either Typed dispatch
> keywords versus :method symbol 

Re: [julia-users] REPL sometimes really slow in 0.5

2016-10-06 Thread Tom Breloff
The first thing I'd check is whether you're using any swap (next time you
notice the slowness)... that will bring a system to its knees instantly.

On Thu, Oct 6, 2016 at 9:29 AM, Páll Haraldsson 
wrote:

> Has anyone noticed, for such simple stuff as:
>
> a=[1,2,3,1]
>
> [something like 10 seconds, but yes, instantly after closing Julia and
> opening again.]
>
> just now in Version 0.5.0-rc4+0
>
>
> Yes, I do have something else running (a web browser, Firefox, always at
> 100% CPU..).
>
> I ignored this the first time I noticed, as I thought CPU load the cause.
> Julia and Firefox have the safe priority, the default 20 in Linux.
>
> I didn't notice this before in 0.4. This could in theory be newer Firefox
> (pre-"electrolysis", w/new "Web Content" process). Still doubt that, as
> Linux SHOULD multitask well and while the browser is often problematic, it
> usually doesn't slow down other non-GUI stuff at least..
>
> --
> Palli.
>
>


Re: [julia-users] View (a portion of a) vector as a matrix

2016-10-02 Thread Tom Breloff
Look at 'splitview' in CatViews.jl

On Sunday, October 2, 2016, Alexey Cherkaev 
wrote:

> I have the model where it is convenient to represent one of the variables
> as a matrix. This variable, however, is obtained as a solution of ODEs
> (among other variables). I'm using Sundials to solve ODEs and
> `Sundials.cvode` requires the ODE RHS function to take a vector. So, it
> seems logical to pack the variables into a vector to pass to `cvode` and
> unpack them for more convenient use in my code.
>
> For example, consider `x = fill(1.0, 10)` and the first 6 entries are
> actually a matrix of size 3x2, other 4: other variables. So, I can do `s =
> reshape(x[1:6], (3,2))`. However, this creates a copy, which I would want
> to avoid. And I couldn't find a way to do the view-reshaping by applying
> `view()` function or doing `SubArray` directly. For now I settle on to
> using indices of the form `(i-1)*M + j +1` to retrieve `s[i,j] = x[(i-1)*M
> + j +1]`. But, (1) julia's 1-based arrays make it awkward to use this
> notation and (2) matrix (not element-wise) operations are not available.
>


Re: [julia-users] Is there a way to download a copy of Plots' documentation?

2016-09-25 Thread Tom Breloff
Also I'll state the obvious. The documentation is not a static reference.
If you take a snapshot of it then it'll get outdated.

On Sunday, September 25, 2016, Chris Rackauckas  wrote:

> You have to do what Sundara describes. This is a limitation of
> Documenter.jl with the mkdocs render. That would be a feature request for
> Documenter.jl . I think it's
> planned for the new native renderer, but I couldn't find the issue (and
> Plots would have to switch to the native renderer. It's not hard, but it's
> still a little bit of work).
>
> On Sunday, September 25, 2016 at 6:10:42 AM UTC-7, SundaraRaman R wrote:
>>
>> I don't know if the following is the best or easiest way, but:
>>
>> It appears the Plots.jl doc sources (https://github.com/JuliaPlots
>> /PlotDocs.jl) are in MkDocs format, which by itself only allows html
>> output; however, the author of MkDocs has released a Python package (
>> https://github.com/jgrassler/mkdocs-pandoc) which allows you to convert
>> the mkdocs-style sources into pandoc-style sources - which you can then
>> feed to pandoc, to get PDF, EPUB, etc.
>>
>> On Sunday, September 25, 2016 at 6:00:44 PM UTC+5:30, K leo wrote:
>>>
>>> in epub or even in pdf
>>>
>>


Re: [julia-users] Re: Visualizing a Julia AST (abstract syntax tree) as a tree

2016-09-22 Thread Tom Breloff
Hi David this is very cool and useful!  I'd be happy to have it in
PlotRecipes if you don't find a better home for it.  If there's a generic
function to produce an adjacency list then we could use my graph recipes.
When I have the time (i.e. soonish when I really want nicer graphs) I plan
on incorporating the new GraphLayout into the recipes.  Let me know.

Tom

On Thu, Sep 22, 2016 at 10:12 AM, David P. Sanders 
wrote:

>
>
> 
>
> Here's an example of the output.
>
>
> El miércoles, 21 de septiembre de 2016, 17:24:52 (UTC-4), David P. Sanders
> escribió:
>>
>> Hi,
>>
>> In case it's useful for anybody, the following notebook shows how to use
>> the LightGraphs and TikzGraphs packages
>> to visualize a Julia abstract syntax tree (Expression object) as an
>> actual tree:
>>
>> https://gist.github.com/dpsanders/5cc1acff2471d27bc583916e00d43387
>>
>> Currently it requires the master branch of TikzGraphs.jl.
>>
>> It would be great to have some kind of Julia snippet repository for this
>> kind of thing that is less than a package but
>> provides some kind of useful functionality.
>>
>> David.
>>
>>
>>


Re: [julia-users] how to get rid of axis in Plots ?

2016-09-22 Thread Tom Breloff
This isn't configurable right now, but I've wanted the same thing. Can you
open an issue and I'll add when I have a couple minutes? I think the
plotlyjs backend does this by default though.

On Thursday, September 22, 2016, Roger Herikstad 
wrote:

> Hey,
>  Similar question; how do I remove only the upper and right border? My
> personal preference is to only show the left and bottom border. In Winston,
> I'd do this
>
> p = Winston.plot([1,2,3],[3,4,5])
> Winston.setattr(p.frame, "draw_axis", false)
>
> Thanks!
>
>
> On Wednesday, June 29, 2016 at 2:15:47 AM UTC+8, Henri Girard wrote:
>>
>> I just found in the same time ... Thank you :)
>>
>> Le mardi 28 juin 2016 17:48:34 UTC+2, Henri Girard a écrit :
>>>
>>> I don't see any command to get rid of axis in Plots or hide them
>>> I tried axis=false axes =false idem with none but nothing works...
>>>
>>>


Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-15 Thread Tom Breloff
I like splatfields but I think it's hard to make work with type parameters
(which is normally a deal breaker for me)

On Thursday, September 15, 2016, 'Greg Plowman' via julia-users <
julia-users@googlegroups.com> wrote:

>
> Another variation on Chris's @commonfields and Tom's @base & @extend
> :
>
> This is somewhere between example 2 and 3,
> Avoids copy and paste of example 2
> Avoids delegating to Foo of example 3
>
> abstract AbstractFoo
>
> type Foo <: AbstractFoo
> bar
> baz
> end
>
> type Foobar <: AbstractFoo
> @splatfields Foo
> barbaz
> bazbaz
> end
>
> Also allows for "multiple" composition/inheritance.
>
>
>


Re: [julia-users] Re: Fused broadcasting?

2016-09-15 Thread Tom Breloff
And I must say... I had my doubts about the "dot" operator, but this has
turned out really nicely and brings some powerful syntax.  Nice work Steven!

On Thu, Sep 15, 2016 at 5:38 PM, daycaster  wrote:

> Thanks Steven, "fused" did the trick.


Re: [julia-users] online (streaming) statistics?

2016-09-14 Thread Tom Breloff
https://github.com/joshday/OnlineStats.jl  (note that StreamStats was
deprecated in favor of this)

On Wed, Sep 14, 2016 at 11:44 AM, Neal Becker  wrote:

> Is there a package for online (streaming) statistics?
>
> This would be an object that could be called repeatedly with new data, and
> would produce stats on the accumulated results (without actually having to
> collect all the results at 1 time)
>
> I have made a package for python which wraps some of
> http://www.boost.org/doc/libs/1_61_0/doc/html/accumulators.html
>
> but have no clue how to do this for Julia (hopefully someone else already
> has)
>
>


Re: [julia-users] How to make generic constructors with no arguments work?

2016-09-13 Thread Tom Breloff
julia> type A{T}
 item::Nullable{T}
 function A()
   new(Nullable{T}())
 end
   end

julia> A{Int}()
A{Int64}(Nullable{Int64}())


You only need the name, and it uses the parameters from the type definition.

On Tue, Sep 13, 2016 at 9:28 AM, SZubik  wrote:

> Hi,
>
> For some reason I can't figure out the following, maybe someone
> encountered this before.
> For example I have the following type
>
> type A{T}
>   item::Nullable{T}
> end
>
> and
>
> A{Int64}(2)
>
> returns A{Int64}(Nullable{2}) as expected.
>
> However I want to introduce a constructor with no parameters (so by
> default item is null):
>
> type A{T}
>   item::Nullable{T}
>   function A{T}()
> new{T}(Nullable{T}())
>   end
> end
>
> And I get
>
> WARNING: static parameter T does not occur in signature for call at line 4
> The method will not be callable.
>
>
> As expected, I get some error when try to call it:
>
> A{Int64}()
>
> Error:
>
> LoadError: MethodError: `convert` has no method matching 
> convert(::Type{A{Int64}})
> This may have arisen from a call to the constructor A{Int64}(...),
> since type constructors fall back to convert methods.
>
>
> If someone could help me make sense out of this, it would be much appreciated 
> :)
>
> Thanks
>
>
>


Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-13 Thread Tom Breloff
I stole an hour this morning and implemented this:
https://github.com/tbreloff/ConcreteAbstractions.jl

It's pretty faithful to my earlier description, except that the macros
names are `@base` and `@extend`.  Comments/criticisms welcome!

On Tue, Sep 13, 2016 at 9:57 AM, Michael Krabbe Borregaard <
mkborrega...@gmail.com> wrote:

> First, apologies, I didn't mean that you wanted to 'subvert' (
> http://www.merriam-webster.com/dictionary/subvert) julia. As a non-native
> speaker the finer nuances of English sometimes slip. The word I was looking
> for was perhaps 'sidestep'.
> Also I see your point that as long as the Abstract type cannot be
> instantiated, the problem with putting supertypes in an array should not be
> relevant. So perhaps this is actually a nice general solution to the issue.
>


Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-13 Thread Tom Breloff
To be clear...I'm not trying to subvert anything! Just to make it easier
and more natural to choose the best option. :)  if it wasn't clear from my
example, AbstractFoo would NOT be a concrete type, and couldn't be
constructed.

On Tuesday, September 13, 2016, Michael Borregaard 
wrote:

> Thanks for the enlightening discussion. The emerging consensus is to use
> example #2, but perhaps use macros to make the syntax easier to read and
> maintain. Alternatively, it looks like my idea with having a FoobarData
> object as a field would do the job (but would require
> foobar.foobardata.bazbaz syntax for accessing fields, of course).
>
> It is also interesting to see that there are divergent views. It seems to
> me, for example, that Tom Breloff's macro syntax would subvert the
> inheritance design decision that Stefan Karpinski described, by combining
> the abstract type with the concrete type?
>


Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-12 Thread Tom Breloff
I think #2 is the right solution, but I also wish there was a nicer syntax
to do it.  Here's how I'd probably tackle it... if I get around to it soon
I'll post the implementation:

@abstract type AbstractFoo
bar::Int
end

@extend AbstractFoo type Foo
end

@extend AbstractFoo type Foobar
baz::Float64
end

# then:
Foo <: AbstractFoo
Foobar <: AbstractFoo

and both Foo and Foobar have a field bar.

I suspect this will be dirt-simple to implement for non-parametrics, but
might be a little tricky otherwise.  It's just a matter of injecting fields
(and parameters) into the proper spot of the type definition.


On Mon, Sep 12, 2016 at 6:00 PM, Chris Rackauckas 
wrote:

> Ahh, that makes a lot of sense as well. I can see how that would make
> everything a lot harder to optimize. Thanks for the explanation!
>
> On Monday, September 12, 2016 at 2:44:22 PM UTC-7, Stefan Karpinski wrote:
>>
>> The biggest practical issue is that if you can subtype a concrete type
>> then you can't store values inline in an array, even if the values are
>> immutable – since a subtype can be bigger than the supertype. This leads to
>> having things like "final" classes, etc. Fundamentally, this is really an
>> issue of failing to separate the concrete type – which is complete and can
>> be instantiated – from the abstract type, which is incomplete and can be
>> subtyped.
>>
>> On Mon, Sep 12, 2016 at 3:17 PM, Chris Rackauckas 
>> wrote:
>>
>>> https://en.wikipedia.org/wiki/Composition_over_inheritance
>>>
>>> http://programmers.stackexchange.com/questions/134097/why-
>>> should-i-prefer-composition-over-inheritance
>>>
>>> https://www.thoughtworks.com/insights/blog/composition-vs-in
>>> heritance-how-choose
>>>
>>> That's just the start. Overtime, people realized inheritance can be
>>> quite fragile, so many style guidelines simply forbid you from doing it.
>>>
>>> On Monday, September 12, 2016 at 11:45:40 AM UTC-7, Bart Janssens wrote:

 Looking at this example, it seems mighty tempting to have the ability
 to subtype a concrete type. Are the exact problems with that documented
 somewhere? I am aware of the following section in the docs:

 "One particularly distinctive feature of Julia’s type system is that
 concrete types may not subtype each other: all concrete types are final and
 may only have abstract types as their supertypes. While this might at first
 seem unduly restrictive, it has many beneficial consequences with
 surprisingly few drawbacks. It turns out that being able to inherit
 behavior is much more important than being able to inherit structure, and
 inheriting both causes significant difficulties in traditional
 object-oriented languages."

 I'm just wondering what the "significant difficulties" are, not
 advocating changing this behaviour.

 On Mon, Sep 12, 2016 at 5:28 PM Stefan Karpinski 
 wrote:

> I would probably go with approach #2 myself and only refer to the .bar
> and .baz fields in all of the generic AbstractFoo methods.
>
> On Mon, Sep 12, 2016 at 10:10 AM, Michael Borregaard <
> mkborr...@gmail.com> wrote:
>
>> Hi,
>>
>> I am defining a set of types to hold scientific data, and trying to
>> get the best out of Julia's type system. The types in my example are
>> 'nested' in the sense that each type will hold progressively more
>> information and thus allow the user to do progressively more. Like this:
>>
>> type Foo
>>   bar
>>   baz
>> end
>>
>> type Foobar
>>   bar  # this
>>   baz  # and this are identical with Foo
>>   barbaz
>>   bazbaz
>> end
>>
>>
>
>>


Re: [julia-users] Re: Problem with Plots/Compat on RC4

2016-09-12 Thread Tom Breloff
Josef is really responsive with GR issues... you should open issues when
you find anything: https://github.com/jheinen/GR.jl/issues   Sometimes it's
hard to know if it's a problem with the Plots backend code or with GR
itself, but we'll both see the issues.  GR is pretty mature, but I agree
it's not appropriate for every workflow, and there are still some
unfinished todo items.

I think the original problem might crop up when you try to run Julia from
multiple processes and you have competing compilation, though I'm sure
there's other ways to corrupt your lib directory.

On Mon, Sep 12, 2016 at 7:47 AM, Scott Thomas 
wrote:

> I have not had much luck with the GR backend myself - it looks nice, but
> it has no antialiasing on linux yet and I can't close the plot window once
> it's open. I think it just needs time to mature some more.
>
>
> On Mon, 12 Sep 2016 at 12:31 DNF  wrote:
>
>> Thanks. After deleting .julia/lib and restarting julia I get some
>> warnings before the prompt shows up:
>>
>> WARNING: Method definition cgrad(Any, Any) in module PlotUtils at ~
>> /.julia/PlotUtils/src/color_gradients.jl:82 overwritten at ~/.julia/
>> PlotUtils/src/color_gradients.jl:99.
>> WARNING: Method definition #cgrad(Array{Any, 1}, PlotUtils.#cgrad, Any,
>> Any) in module PlotUtils overwritten.
>> WARNING: could not import Base.lastidx into LegacyStrings
>>
>>
>> Plots with PyPlot backend  now seems to work. But, I am still having some
>> problems with Plots. When I tried using Plots.jl with GR backend, first
>> time it worked. If I close the GTKTerm window that GR draws into, just
>> nothing happens, and occasionally I get a segfault.
>>
>>
>> On Monday, September 12, 2016 at 1:14:30 PM UTC+2, Scott T wrote:
>>>
>>> Oh and just to be a little clearer, that's ~/.julia/lib (the .julia
>>> folder in your home directory) and not the .../julia/lib folder in
>>> Applications.
>>>
>>> On Monday, 12 September 2016 12:12:08 UTC+1, Scott T wrote:

 Try removing .julia/lib (the precompile cache). I had this same issue
 and this appears to have fixed it.

>>>


[julia-users] macro: with

2016-09-07 Thread Tom Breloff
Hey all... I just threw together a quick macro to save some typing when
working with the fields of an object.  Disclaimer: this should not be used
in library code, or in anything that will stick around longer than a REPL
session.  Hopefully it's self explanatory with this example.  Is there a
good home for this?  Does anyone want to use it?

julia> type T; a; b; end; t = T(0,0)
T(0,0)

julia> macroexpand(:(
   @with t::T begin
   a = 1
   b = 2
   c = a + b - 4
   d = c - b
   a = d / c
   end
   ))
quote  # REPL[3], line 3:
t.a = 1 # REPL[3], line 4:
t.b = 2 # REPL[3], line 5:
c = (t.a + t.b) - 4 # REPL[3], line 6:
d = c - t.b # REPL[3], line 7:
t.a = d / c
end

julia> @with t::T begin
   a = 1
   b = 2
   c = a + b - 4
   d = c - b
   a = d / c
   end
3.0

julia> t
T(3.0,2)


Re: [julia-users] Re: another new 2D plotting library for Julia

2016-08-31 Thread Tom Breloff
Hi Igor... any idea how your package compares to other libraries like
GR.jl?  What are the "killer features" which inspired you to work on this?

On Wed, Aug 31, 2016 at 8:55 AM, Igor  wrote:

> Package name changed! now new package name:  https://github.com/ig-or/
> qwtwplot.jl   ("*.jl*" added)
> Also, RPM installation package for underlying qwtw "C" library for
> Fedora-24 x64 added; examples and Readme files slightly changed.  Hope this
> will be included in global Metadata: https://github.com/JuliaLang/
> METADATA.jl/pull/6191
>
> Best regards, Igor
>
> пятница, 26 августа 2016 г., 14:16:20 UTC+3 пользователь Henri Girard
> написал:
>
>> Thanks, I am updating. For julia jupyter is IJulia. Just
>> Pkg.add("IJulia") will install it. They are developing a promising tool
>> jupyterlab which enable to work with most kernels. It's an improved jupyter
>> notebook at the moment in alpha preview. But apparently it develops quiet
>> quickly. Now I use it instead jupyter notebook.
>>
>>
>> Le jeudi 25 août 2016 12:01:30 UTC+2, Igor a écrit :
>>>
>>> Hello!
>>> I made another 2D plotting library for Julia. Please try to test it if
>>> you have some free time. Current version works only for Windows7 x64, but
>>> I'm planning to make everything work for Fedora Linux also.
>>>
>>> It is located here: https://github.com/ig-or/qwtwplot
>>> you'll have to read its description before the installation.
>>>
>>> It is based on underlying "C" library, which I used to use for data
>>> analysis for many years, but now I tried to make a Julia package out of it.
>>> I'm new to github, so your comments will be very appreciated.
>>>
>>> Best regards, Igor
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>


Re: [julia-users] Re: Can someone please update Winston?

2016-08-29 Thread Tom Breloff
The important points of this thread:


   - There hasn't been a tag in a year for Winston, but there have been
   fixes, including from Jeff and Stefan.  Check out master and try again
   - You might consider other packages, because there's lots of options out
   there
   - Chris REALLY wants to specify his own triangles ;)


On Mon, Aug 29, 2016 at 10:07 AM, Chris Rackauckas 
wrote:

> This isn't the thread for this, but I'll bite.
>
> That's exactly the reason why it's a good idea. The backends aren't
> swappable, but the code is. And for the most part that means you can just
> avoid the cons of any backend instead of having to fight against them. You
> could be making all of your plots with the PGFPlots backend for some
> publication, and then realize that you need a trisurf plot. You can just
> switch the backend and re-save your plots without actually writing new
> code, and now they can be all saved and matching in PyPlot.
>
> Another example is when you run into issues with precision. PyPlot is a
> good standard choice, so I was using it to show all of my convergence test
> results. However, once I started testing things like Order 10 Runge-Kutta
> methods I noticed PyPlot simply can't plot values that are below 1e-30. The
> quick fix is to just change the backend, i.e. add the one line of code
> `plotly()`, and now all of the convergence tests how nice plots that work
> in their range.
>
> This is not to mention that Plots adds features to each backend. Since
> it's not focused on making the graphic backend, it's just focused on making
> "recipes" which are convenient commands for doing things like making a
> scatter plot matrix, and will work for any backend. So sure you can't use
> every feature of every backend, but there are more features you can easily
> use through Plots than just using the backend itself. That said, it's still
> a young package so there are places where it needs to wrap more of the
> backend, like with trisurfs you need to be able to specify triangles. But
> Tom is working on that.
>
>
> On Monday, August 29, 2016 at 6:54:44 AM UTC-7, Daniel Carrera wrote:
>>
>> Plots.jl is a good idea, but the backends are not really swappable. You
>> can get a fairly different plot if you swap the backend.
>>
>>
>> On Saturday, 27 August 2016 02:19:45 UTC+2, Chris Rackauckas wrote:
>>>
>>> You should really check out Plots.jl. It's a plotting metapackage which
>>> lets you use the same plot commands to use any backend. It's nice because
>>> if you're using it an one package stops getting updated, you can switch to
>>> another plotting backend without changing your plot commands.
>>>
>>> But I can see that, although Winston hasn't been tagged in almost a
>>> year, there has been some development work. Have you tried
>>> Pkg.checkout("Winston")?
>>>
>>> On Friday, August 26, 2016 at 3:04:22 PM UTC-7, K leo wrote:

 so that it works with version 0.5.
>>>
>>>


Re: [julia-users] AutoGrad port for Julia

2016-08-29 Thread Tom Breloff
Deniz thanks for the package. I plan on reviewing it this week to decide if
it's a good fit for JuliaML. We're in the market for fast and well typed
backprop.

Mose: what version of julia are you on? Anonymous functions and closures
are much faster on 0.5... In fact there should be no performance penalty vs
regular functions, which allows you to rethink your paradigm.

On Monday, August 29, 2016, Deniz Yuret  wrote:

> Hi Mosè,
>
> Thanks for the wonderful feedback!
>
> AutoGrad has some overhead for recording and differentiating primitive
> operators.  However I think there is room for improvement - the current
> design has elements of the original Python package, anonymous functions,
> closures, etc. that are probably not very efficient.  I am working on a
> more efficient design.
>
> Thanks for the derivative info as well!  And here I was thinking: who is
> going to care about the missing derivative of the airy function :)  I
> better get to work...
>
> best,
> deniz
>
>
> On Mon, Aug 29, 2016 at 2:13 AM Mosè Giordano  > wrote:
>
>> Hi Deniz,
>>
>> Announcing AutoGrad.jl : an
>>> automatic differentiation package for Julia. It is a Julia port of the
>>> popular Python autograd  package. It
>>> can differentiate regular Julia code that includes loops, conditionals,
>>> helper functions, closures etc. by keeping track of the primitive
>>> operations and using this execution trace to compute gradients. It uses
>>> reverse mode differentiation (a.k.a. backpropagation) so it can efficiently
>>> handle functions with array inputs and scalar outputs. It can compute
>>> gradients of gradients to handle higher order derivatives.
>>>
>>> Large parts of the code are directly ported from the Python autograd
>>>  package. I'd like to thank autograd
>>> author Dougal Maclaurin for his support. See (Baydin et al. 2015)
>>>  for a general review of automatic
>>> differentiation, autograd tutorial
>>>  for
>>> some Python examples, and Dougal's PhD thesis for design principles.
>>> JuliaDiff  has alternative differentiation
>>> tools for Julia.
>>>
>>> best,
>>> deniz
>>>
>>>
>> Very nice package!  It's one of the most complete yet easy-to-use
>> automatic differentiation packages I've checked out.  Some comments below.
>>
>> I expected (or hoped) that performance of the function returned by "grad"
>> was comparable to that of the actual derivative/gradient.  However:
>>
>> julia> using BenchmarkTools, AutoGrad
>>
>> julia> COS = grad(sin)
>> gradfun (generic function with 1 method)
>>
>> julia> @benchmark cos(0.0)
>> BenchmarkTools.Trial:
>>   samples:  1
>>   evals/sample: 1000
>>   time tolerance:   5.00%
>>   memory tolerance: 1.00%
>>   memory estimate:  0.00 bytes
>>   allocs estimate:  0
>>   minimum time: 4.00 ns (0.00% GC)
>>   median time:  4.00 ns (0.00% GC)
>>   mean time:4.05 ns (0.00% GC)
>>   maximum time: 15.00 ns (0.00% GC)
>>
>> julia> @benchmark COS(0.0)
>> BenchmarkTools.Trial:
>>   samples:  1
>>   evals/sample: 1
>>   time tolerance:   5.00%
>>   memory tolerance: 1.00%
>>   memory estimate:  3.61 kb
>>   allocs estimate:  78
>>   minimum time: 9.14 μs (0.00% GC)
>>   median time:  10.30 μs (0.00% GC)
>>   mean time:10.98 μs (3.46% GC)
>>   maximum time: 3.88 ms (98.04% GC)
>>
>>
>> I found similar results for other simple functions.  Is this to be
>> expected or is there room for improvements?
>>
>> I saw that the derivative dictionaries for most special functions are
>> incomplete.  You can give a look at the derivatives in file src/math.jl
>> 
>> of my Measurements.jl 
>> package (I could use an automatic differentiation library in my package,
>> but I've never found one that suited my needs).  Look at the "result" calls
>> returned by the overloaded functions, the second argument is the derivative
>> or tuple of derivatives.
>>
>> I noticed that you marked the derivative of airyprime as wrong.  I guess
>> that you've been deceived by the misleading docstring of airy:
>> https://github.com/JuliaLang/julia/issues/17032  The second derivatives
>> of airy functions can be computed exploiting the Airy equation
>> .
>>
>> Cheers,
>> Mosè
>>
>


Re: [julia-users] Unable to run Pkg.publish() due to bad credentials

2016-08-21 Thread Tom Breloff
My "solution" is to not use Pkg.publish.

cd 
git remote add forked 
git checkout -b pub

git push forked pub

Then submit the PR from the webpage.

I suspect two factor security makes this more complicated but I'd prefer to
do these steps manually then lose the security.

On Sunday, August 21, 2016, esproff  wrote:

> I'm trying to run Pkg.publish(), however when it asks for my GitHub host
> password I enter it (although nothing shows up when I type), and then I hit
> return and I get:
>
> Error 401: Bad credentials
>
> Does anyone know how to fix this?
>


[julia-users] Plots ecosystem

2016-08-16 Thread Tom Breloff
All: I'm compiling a bunch of images, gifs, and descriptions of community
packages that use Plots/RecipesBase.  If you have something that you'd like
to include, please post a quick blurb and image here:
https://github.com/tbreloff/Plots.jl/issues/439

The WIP page is here: https://juliaplots.github.io/ecosystem/

If you don't have a package, but made something super cool using Plots,
please post that as well!  I'll probably put a "gallery" of sorts at the
bottom.

Best,
Tom


[julia-users] JupyterLab

2016-08-14 Thread Tom Breloff
Just saw this: http://blog.jupyter.org/2016/07/14/jupyter-lab-alpha/

Anyone tried it? Is Julia supported?


Re: [julia-users] overwrite function value

2016-08-11 Thread Tom Breloff
Can't you just change you pattern?

f(x) = x+1
x = 1
x = f(x)

On Thursday, August 11, 2016, digxx  wrote:

> Probably...I just need to get used to it.
>
>


Re: [julia-users] Numer of ones in bitstype

2016-08-11 Thread Tom Breloff
help?> count_ones
search: count_ones count_zeros

  count_ones(x::Integer) -> Integer

  Number of ones in the binary representation of x.

  julia> count_ones(7)
  3


On Thu, Aug 11, 2016 at 1:48 PM, jw3126  wrote:

> I have a bitstype and want to know the number of ones in its bit
> representation as well as the first bit. How to accomplish these in a
> performant way?
>


Re: [julia-users] Interactive Inline IJulia Plots

2016-08-11 Thread Tom Breloff
This is an old video, but it gets the point across.  Plots with PlotlyJS is
nice.

https://www.youtube.com/watch?v=ctlRKL4CSIs

On Thu, Aug 11, 2016 at 7:50 AM, Joseph Obiajulu 
wrote:

> I was wondering if anyone know if interactive plots could be embedded
> inline in IJulia notebooks using the PyPlot package, and if so, how to do
> it? If it can not be done with PyPlot, is there another plotting package
> that allows this functionality?
>


Re: [julia-users] Plots with scale bars

2016-08-10 Thread Tom Breloff
Sure. You could maybe make a recipe, or just make a function that does
this. You'll probably want to make use of 'axis_limits' to get the data
range. Like this:

amin, amax = axis_limits(plt[1][:yaxis])

Here 'plt[1]' returns the first Subplot.

On Wednesday, August 10, 2016, Islam Badreldin <islam.badrel...@gmail.com>
wrote:

> Hi Tom,
>
> Thanks for your input. This solution seems similar to the one proposed on
> matlabcentral. It's fine for now, but it'd be great if switching between a
> plot with x-y axes to a plot with only scale bars can be done neatly using
> a single switch or function, while hiding all the details from the end
> user. For example, figuring out the correct parameters for the text
> annotation is a function of current plot scale (min/max), the text size of
> the displayed text, ... etc. Ideally, the end user shouldn't need to fiddle
> with all these details, and the scale bars functionality should `just work'
> as the x-y axes functionality does!
>
> Thanks,
> Islam
>
> PS: the first plot command gives me `ERROR: Unknown key: axis`. But I
> assume that is because I'm currently on Julia v0.4.6 with Plots v0.8.2.
>
> On Wednesday, August 10, 2016 at 10:55:10 AM UTC-4, Tom Breloff wrote:
>
>> I threw this together really quickly... excuse the mess:
>>
>> using Plots
>>
>> # initial plot
>> plot(linspace(10,34,100), 30rand(100,2).+[0 60],
>>  leg=false, ylim=(-60,150), axis=nothing,
>>  xguide="Time(ms)", yguide="current(mA)")
>>
>> # lines and annotations
>> x,y = 12,-40
>> plot!([x,x,x+10], [y+10,y,y], c=:black,
>>ann=[(x+5,y,text("10 ms",:top,10)),
>> (x,y+5,text("10 mA",:right,10))])
>>
>> png("/tmp/tmp")
>>
>>
>>
>> ​
>>
>> On Wed, Aug 10, 2016 at 10:31 AM, Willem Hekman <hekman...@gmail.com>
>> wrote:
>>
>>> If you'd try to do this using PyPlot you can remove the x- and y-axis by
>>> translating the necesarry matplotlib code i.e.
>>> http://www.shocksolution.com/2011/08/removing-an-axis-or-bot
>>> h-axes-from-a-matplotlib-plot/
>>> to the syntax that PyPlot takes, which is slightly different. You would
>>> get something like
>>>
>>> plot(x,y) # some 2D plot call
>>> ax = gca() # get current axes (the drawing area in PyPlot, dont confuse
>>> axes with axis here)
>>> ax[:get_xaxis][:set_visible](false) # make x-axis invisible
>>>
>>> for inspiration you can have a look at https://gist.github.com/gizmaa
>>> /7214002
>>>
>>> Adding the scale bars I cant seem to come up with a solution straight
>>> away unfortunately, anyone has an idea?
>>>
>>>
>>> On Monday, August 8, 2016 at 6:33:14 PM UTC+2, Islam Badreldin wrote:
>>>>
>>>>
>>>>
>>>> Hello,
>>>>
>>>> Is there a simple way in Julia to add scale bars with labels to plots
>>>> and to hide the x-y axes as well? The way to do in MATLAB involves a lot of
>>>> manual tweaking as described here
>>>> http://www.mathworks.com/matlabcentral/answers/151248-add-a-
>>>> scale-bar-to-my-plot
>>>>
>>>> I'm hoping to find a more elegant way in Julia!
>>>>
>>>> Thanks,
>>>> Islam
>>>>
>>>
>>


Re: [julia-users] Combining composite type & PyPlot methods with @manipulate (regarding a port/extension of QuTiP's Bloch Sphere)

2016-08-10 Thread Tom Breloff
Hi Willem.  If you make a Plots recipe for your type, you should be able to
use your pseudocode by replacing 'render' with 'plot'.

https://juliaplots.github.io/recipes/

On Wed, Aug 10, 2016 at 10:18 AM, Willem Hekman 
wrote:

> Hello all,
>
> I have been spending my time making http://qutip.org/docs/3.1.0/
> guide/guide-bloch.html work in Julia by translating the main parts of the
> source code http://qutip.org/docs/3.1.0/modules/qutip/bloch.html .
> 
>
> In short, what I've worked out is, in pseudo-code:
>
> type Bloch
>some properties.. :: of various types
>vectors ( :: Vector{Vector{Float64}}  ) # Vector of vectors that can
> be plot on the sphere.
> end
>
> Bloch() = Bloch(standard properties, []) # initialize without any vectors
> to plot
>
> function add_vector(b::Bloch,vector::Vector{Float64})
>push!(b.vectors,vector)
> end
>
> function render(b::Bloch)
>   plot a sphere
>   plot equator
>   plot x,y and z axis
>   plot vectors
>   style axes
> end
>
> The actual code I've written so far can be found on
> https://github.com/whekman/edX/blob/master/Other/bloch.jl . Any advice on
> my code much appreciated, I`m quite new to programming.
>
> Now *I`d love to make such rendering compatible with @manipulate*. I know
> that you can use withfig(fig) do  end but somehow I cant figure out how
> to incorporate it in this more object style approach.
>
> Basically, I'm looking for a way to implement, in pseudo-code:
>
> b = Bloch()
> @manipulate for azimuth 0:15:90, latitude -180:15:180
>add_vector(b,azimuth,latitude)
>render(b)
> end
>
> So the goal is to have an easy way to draw points on such a sphere in an
> interactive way. Basically, I am having a hard time figuring out how to
> combine the use of such a composite type with @manipulate.
>
> Anyone know a solution?
>
> As an aside, the PyPlot code that I've written so far may be a nice,
> comprehensive example of 3D plotting using PyPlot . If so, how to make sure
> people can find it?
>
> Furthermore, any hopes of plotting Arrow3D objects from inside Julia? It
> is already possible in matplotlib http://stackoverflow.com/
> questions/29188612/arrows-in-matplotlib-using-mplot3d
>
> - Willem
>


Re: [julia-users] Re: Plots with scale bars

2016-08-10 Thread Tom Breloff
I threw this together really quickly... excuse the mess:

using Plots

# initial plot
plot(linspace(10,34,100), 30rand(100,2).+[0 60],
 leg=false, ylim=(-60,150), axis=nothing,
 xguide="Time(ms)", yguide="current(mA)")

# lines and annotations
x,y = 12,-40
plot!([x,x,x+10], [y+10,y,y], c=:black,
   ann=[(x+5,y,text("10 ms",:top,10)),
(x,y+5,text("10 mA",:right,10))])

png("/tmp/tmp")



​

On Wed, Aug 10, 2016 at 10:31 AM, Willem Hekman 
wrote:

> If you'd try to do this using PyPlot you can remove the x- and y-axis by
> translating the necesarry matplotlib code i.e.
> http://www.shocksolution.com/2011/08/removing-an-axis-or-
> both-axes-from-a-matplotlib-plot/
> to the syntax that PyPlot takes, which is slightly different. You would
> get something like
>
> plot(x,y) # some 2D plot call
> ax = gca() # get current axes (the drawing area in PyPlot, dont confuse
> axes with axis here)
> ax[:get_xaxis][:set_visible](false) # make x-axis invisible
>
> for inspiration you can have a look at https://gist.github.com/
> gizmaa/7214002
>
> Adding the scale bars I cant seem to come up with a solution straight away
> unfortunately, anyone has an idea?
>
>
> On Monday, August 8, 2016 at 6:33:14 PM UTC+2, Islam Badreldin wrote:
>>
>>
>>
>> Hello,
>>
>> Is there a simple way in Julia to add scale bars with labels to plots and
>> to hide the x-y axes as well? The way to do in MATLAB involves a lot of
>> manual tweaking as described here
>> http://www.mathworks.com/matlabcentral/answers/151248-add-a-
>> scale-bar-to-my-plot
>>
>> I'm hoping to find a more elegant way in Julia!
>>
>> Thanks,
>> Islam
>>
>


Re: [julia-users] "Recommendadions" at julialang.org [for e.g. [Py]Plot] for say Julia 0.5

2016-08-09 Thread Tom Breloff
A) there's a discussion happening right now:
https://github.com/JuliaLang/julialang.github.com/pull/399

On Tue, Aug 9, 2016 at 3:06 PM, Tamas Papp  wrote:

> I looked at almost all Julia plotting libraries again recently (last
> week) for a project, running 0.5-rc1 (approximately). Many have issues
> and lots of warnings, and probably need time to catch up to 0.5.
>
> I ended up using VegaLite for my current project, and found it very
> nice. Very close to Gafly/GoG in spirit, even though the actual
> implementation is different. I only played around a bit with Vega, but
> it looks very versatile too (maybe too versatile for my present
> needs). Both are actively maintained and extensively documented.
>
> Even though I like Plots.jl very much, the fact that it does not support
> Gadfly does not imply anything about the latter per se. I am more
> worried about no commits in the past 3 months.
>
> When it comes to plotting libraries, I don't think that there is a clear
> winner at this moment that one could recommend -- each involves some
> kind of compromise. That said, this is the situation in most languages:
> eg while R has a built-in "default" plotting library, for more complex
> plots many people end up using something else.
>
> Best,
>
> Tamas
>
> On Tue, Aug 09 2016, Páll Haraldsson wrote:
>
> > A.
> >
> > First a specific matter:
> >
> > http://julialang.org/downloads/
> >
> > I see PyPlot. I'm not asking for recommendations, just discussiong what
> > should be officially pointed to [in general].
> >
> > I can understand that you would not want to take side (or maybe you do,
> > PyCall.jl is awesome and I guess PyPlot/matplotlib, I just haven't used
> any
> > plots..).
> >
> >
> > Maybe the plan is or should be to recommend (only?) Plots.jl (and not
> > Gadfly since):
> >
> >
> > https://juliaplots.github.io/backends/
> >
> > "Deprecated backends
> > Gadfly"
> >
> >
> > See also: https://juliaplots.github.io/supported/
> >
> > It's clearly not a simple choice.. and since Plot.jl is just an abstract
> > wrapper (that seems awesome!) it's not taking sides pointing to it.
> >
> > I also really like UnicodePlots :) that may be the only pure-Julia only
> > solution..? Maybe leave that implicit in the Plots.jl recommendation?
> >
> >
> > [Maybe the homepage just hasn't been changes yet, as Julia 0.5 isn't out
> > and Plots.jl turned 0.5 only.]
> >
> >
> > B.
> >
> > Juno is also recommended. I expect there is no change, expect the newer
> > Atom-version is now ok and recommended? I've also not tried (seriously)
> in
> > a while.. Any other notable [to add to homepage]? I understand if you do
> > not want to confuse people with choices, why A. seems safe..
> >
> >
> > C.
> >
> > There's another thread on "metapackages" (proposal), should there be more
> > [abstract wrapper/meta] package recommendations?
>
>


Re: [julia-users] PyCall-ing Numba-dependent Libraries

2016-08-09 Thread Tom Breloff
Related to this, I can't render anything with my wrapper to OpenAI's gym,
because of an llvm version clash inside pyglet. If you solve this problem
in a semi-general way, please let us know!

On Tuesday, August 9, 2016, Christoph Ortner 
wrote:

> To reply to my own question, this seems to have worked:
>
> git clone https://github.com/numba/llvmlite
> cd llvmlite
> LLVM_CONFIG=.../julia/usr/tools/llvm-config python setup.py install
> LLVM_CONFIG=.../julia/usr/tools/llvm-config pip install numba
>
>
> Unfortunately it didn't solve my problem since the library I am really
> interested in (chemview) still crashes.
>


Re: [julia-users] Plots with scale bars

2016-08-08 Thread Tom Breloff
Yes likely this could be done easily in a recipe if it's something you'd
want to do repeatedly.

On Monday, August 8, 2016, Islam Badreldin <islam.badrel...@gmail.com>
wrote:

>
> Hi Tom,
>
> It'd be cool if you can add a couple of examples, yes!
>
> I'm not familiar with plot recipes yet, but do you think that such a
> scenario can be handled 'neatly' in a recipe while hiding all manual
> tweaking from the end user?
>
> Thanks,
> Islam
>
> _
> From: Tom Breloff <t...@breloff.com
> <javascript:_e(%7B%7D,'cvml','t...@breloff.com');>>
> Sent: Monday, August 8, 2016 1:03 PM
> Subject: Re: [julia-users] Plots with scale bars
> To: <julia-users@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','julia-users@googlegroups.com');>>
>
>
> There's a bunchof ways to do this with Plots. Draw the lines and add
> annotations or add an inset subplot with labels? I'm not at a computer...
> maybe I'll throw together an example later.
>
> On Monday, August 8, 2016, Islam Badreldin <islam.badrel...@gmail.com
> <javascript:_e(%7B%7D,'cvml','islam.badrel...@gmail.com');>> wrote:
>
>>
>>
>> Hello,
>>
>> Is there a simple way in Julia to add scale bars with labels to plots and
>> to hide the x-y axes as well? The way to do in MATLAB involves a lot of
>> manual tweaking as described here
>> http://www.mathworks.com/matlabcentral/answers/151248-add-a-
>> scale-bar-to-my-plot
>>
>> I'm hoping to find a more elegant way in Julia!
>>
>> Thanks,
>> Islam
>>
>
>
>


Re: [julia-users] Plots with scale bars

2016-08-08 Thread Tom Breloff
There's a bunchof ways to do this with Plots. Draw the lines and add
annotations or add an inset subplot with labels? I'm not at a computer...
maybe I'll throw together an example later.

On Monday, August 8, 2016, Islam Badreldin 
wrote:

>
>
> Hello,
>
> Is there a simple way in Julia to add scale bars with labels to plots and
> to hide the x-y axes as well? The way to do in MATLAB involves a lot of
> manual tweaking as described here
> http://www.mathworks.com/matlabcentral/answers/151248-
> add-a-scale-bar-to-my-plot
>
> I'm hoping to find a more elegant way in Julia!
>
> Thanks,
> Islam
>


Re: [julia-users] I cant view Plots in Juno - Atom IDE

2016-08-08 Thread Tom Breloff
I think this behavior should be changed to match the REPL... There have
been too many questions like this

On Monday, August 8, 2016, Chris Rackauckas  wrote:

> Use the command `gui()`
>
> On Sunday, August 7, 2016 at 9:32:29 PM UTC-7, Erick J Zagal wrote:
>>
>> I have this code:
>>
>> using Plots
>>
>> x = linspace(0, 10, 200)
>> y = sin(x)
>> plot(x, y, color=:blue, linewidth=2, label="sine")
>>
>> when run this in the console , show the plot , but  trying in Juno only
>> show [Plots.jl] Initializing backend:plotly
>> the plot is nothing
>> Add a Screenshot
>>
>> Help
>>
>


Re: [julia-users] @animate @gif using plots

2016-08-07 Thread Tom Breloff
Something like 'legend = :topright' might work.

On Sunday, August 7, 2016, digxx  wrote:

> Is it possible to position the legend manually in a plot(x,y,leg_pos=???)
>


Re: [julia-users] @animate @gif using plots

2016-08-07 Thread Tom Breloff
Did you restart julia after adding ImageMagick?  The errors are because it
can't find either ImageMagick or ffmpeg, one of which is required to make
gifs.

On Sunday, August 7, 2016, digxx  wrote:

> Hey I reinstalled Julia and am now wondering why the animation part of
> plots doesnt work anymore. It did before...
> I presume I'm lacking dependencies though which ones?
>
> The following produces an error.
>
> x=linspace(0,pi,100)
> anim=@animate for i=0:100
> y=sin(x*exp(i/50))
> plot(x,y,xlims=(0,pi),ylims=(-1,1))
> end
> gif(anim, dirname(@__FILE__)*"\\anim.gif", fps=30)
>
> and the error is :
>
> Unzul▒ssiger Parameter - 3
> WARNING: Tried to create gif using convert (ImageMagick), but got error:
> ErrorException("failed process: Process(`convert -delay 3 -loop 0
> 'C:\\cygwin64\\tmp\\jul28E7.tmp\\*.png' -alpha off
> 'C:\\Users\\Diger\\Documents\\Julia\\Plotting\\anim.gif'`,
> ProcessExited(4)) [4]")
> ImageMagick can be installed by executing `Pkg.add("ImageMagick")`
> Will try ffmpeg, but it's lower quality...)
> ERROR: LoadError: could not spawn `ffmpeg -v 0 -framerate 30 -i
> 'C:\cygwin64\tmp\jul28E7.tmp/%06d.png' -y 
> 'C:\Users\Diger\Documents\Julia\Plotting\anim.gif'`:
> no such file or directory (ENOENT)
>  in _jl_spawn at process.jl:262
> while loading C:\Users\Diger\Documents\Julia\Plotting\animation.jl, in
> expression starting on line 6
>
> When I first used the animation thingy I also had this error. But this was
> fixed after adding ImageMagick...
>
> Also now I do have ImageMagick installed and it seemed to have run through
> without any problems, still the error persists...
>


Re: [julia-users] [ANN] Nemo 0.5 released

2016-07-30 Thread Tom Breloff
Marcus if you're looking to do reinforcement learning, I'd like
collaboration on https://github.com/tbreloff/Reinforce.jl. I don't have
docs yet but I got it hooked up to OpenAIGym.jl on friday for benchmarking.

On Saturday, July 30, 2016, Alireza Nejati  wrote:

> Very cool! Is there a page where these changes are described more? How has
> the abstract type hierarchy been changed?
>
> Also, I heard there was supposed to be a complex root isolation method?
>
> On Wednesday, July 27, 2016 at 9:07:44 AM UTC+12, Bill Hart wrote:
>>
>> Hi all,
>>
>> We are pleased to release version 0.5 of Nemo, our computer algebra
>> package written in Julia.
>>
>> Instructions on how to get Nemo are on our website:
>>
>> http://nemocas.org/downloads.html
>>
>> Note that we have moved our repository, so existing users may need to
>> reinstall.
>>
>> Documentation for Nemo, including example code, how to get started etc.,
>> is available online:
>>
>> http://nemocas.github.io/Nemo.jl/latest/
>>
>> The new features of Nemo 0.5 include:
>>
>> * Wrap Arb's arb_mat, acb_mat (matrices over R and C)
>> * Wrap Arb's arb_poly, acb_poly (polys over R and C)
>> * Completely rewritten, online documentation
>> * Wrap Flint's fmpq_mat (matrices over Q)
>> * Nullspace over the integers (using HNF)
>> * Factorisations now return a Dict
>> * Make caching of parent objects optional
>> * Add benchmarks
>> * Remove a lot of type instability
>> * Integrate C libraries with Julia's counted malloc
>> * Redesign abstract type hierarchy
>> * Appveyor continuous integration for Windows
>> * Lots of cleaning up and restructuring of the code base
>> * Many bug fixes
>>
>> We will release a small update in the next few weeks to support Julia 0.5
>> when it comes out, However it should work with nightlies right now with
>> some warnings.
>>
>> Enjoy,
>>
>> The Nemo Developers.
>>
>


Re: [julia-users] Re: A workaround to use "." to access class member functions - is it unJulian?

2016-07-22 Thread Tom Breloff
In julia 0.4, I think this would be considered both slow and ugly.  Since
the improvements to anonymous functions in 0.5, it's now only ugly.  :)

I think you'll find a lot of benefit if you forget about OO-programming,
and use multiple dispatch.  "You must unlearn what you have learned!"

On Fri, Jul 22, 2016 at 1:19 PM, Jeffrey Sarnoff 
wrote:

> Too much riffle-raffle for the gain you mention (imo).
>
>
> On Friday, July 22, 2016 at 1:01:42 PM UTC-4, Zhong Pan wrote:
>>
>> Most people coming from the object-oriented programming (OOP) world are
>> used to using "." to access member methods/functions of a class. Consider
>> the following simple example in Python that defines a class AA which has
>> two members: an integer variable N to store the number of people attended,
>> and a split(cost) function to calculate the cost split evenly among all
>> attendees.
>> class AA:
>> def __init__(self, n):
>> self.N = n
>>
>> def split(self, cost):
>> return float(cost) / self.N
>>
>> groupdinner = AA(20)
>> totalcost = 500.00
>> print("{:d} people attended the group dinner, and each should pay
>> ${:.2f}".format(groupdinner.N,
>>
>> groupdinner.split(totalcost)))
>>
>> Running the above code gives:
>> 20 people attended the group dinner, and each should pay $25.00
>>
>> In Julia, with multiple dispatch and functions as first-class objects,
>> the code would usually be written this way:
>> type AA
>>   N :: Int
>> end
>>
>> split(event::AA, x::Number) = x/event.N
>>
>> groupdinner = AA(20)
>> totalcost = 500.00
>> @printf("%d people attended the group dinner, and each should pay
>> \$%.2f\n", groupdinner.N, split(groupdinner, totalcost))
>>
>> However, if someone insists that a class (or type in Julia) should "own"
>> the member functions, I do see a workaround using inner constructor, like
>> this:
>> type AA
>>   N :: Int
>>   split :: Function
>>
>>   AA(n::Int) = new(n, (x::Number) -> x/n)
>> end
>>
>> groupdinner = AA(20)
>> totalcost = 500.00
>> @printf("%d people attended the group dinner, and each should pay
>> \$%.2f\n", groupdinner.N, groupdinner.split(totalcost))
>>
>> This approach treats member functions as Function objects owned by a
>> type, and the implementations of member functions are actually written in
>> an inner constructor.
>>
>> Obviously this is a workaround and workarounds are awkward. However, I do
>> see one potential practical use: modern IDEs often provide intellisense
>> which will display an object's members once "." is typed after an object
>> name. It's quite handy when I want to use a mature 3rd party module that I
>> don't have time to learn by reading documentation; instead I just want to
>> quickly try and use it by exploring the class hierarchy. It also saves a
>> lot of memorizing/typing when I can be constantly reminded/auto-completed
>> of matching variable/function names filtered by the object before the "."
>> and the first few letters I typed in after the ".".
>>
>> In Julia one can use methods(AA) to display all functions that take AA
>> object(s) as input(s). However, the list produced is often quite long and
>> hard to read, since multiple dispatch will create many versions of the same
>> function, with each differing only in the parameter types, and "methods"
>> will show all of them with parameter types but no meaningful names. Also
>> not sure how intellisense can help here. So the only way to explore for now
>> is to know the function name (or at least a significant leading part of the
>> name) and read its documentation by using "?" in a terminal, separate from
>> the source code editor.
>>
>> With the "." workaround shown above intellisense should be able to prompt
>> the name "split" alongside with "N".
>>
>> I just wonder if this workaround would be considered way too "unJulian"
>> that it ought to be denounced. :-)
>>
>> Thanks,
>> -Zhong
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>


Re: [julia-users] Pipeline interoperability with IOStream and IOBuffer

2016-07-22 Thread Tom Breloff
To be fair, he was told, in that issue, that julia-users was a more
appropriate place to ask this type of question.

On Friday, July 22, 2016, Steven G. Johnson  wrote:

>
>
> On Thursday, July 21, 2016 at 6:09:12 PM UTC-4, William Wong wrote:
>>
>> I'm trying to continue the discussion of
>> https://github.com/JuliaLang/julia/issues/15479
>>
>
> The github issue is the appropriate place for discussion; it's not helpful
> to split the discussion into two separate forums.
>
> (If you want to see progress on an issue, the most effective way is to
> submit a pull request attempting to fix the issue.)
>


Re: [julia-users] Help Julia win a performance comparison!

2016-07-21 Thread Tom Breloff
I had the same thought. Could just make a new AbstractArray which keeps a
larger array and tracks the current usage. I bet it's 10 lines of code to
make it generic.

On Thursday, July 21, 2016, Christoph Ortner 
wrote:

>
> feels like one may want a little auxiliary package that can make available
> small chunks from a long pre-allocated vector.
>
> On Thursday, 21 July 2016 10:37:12 UTC+1, Chris Rackauckas wrote:
>>
>> Maybe. I thought about that, but I don't think that satisfies the
>> "elegant and compactness" requirement, unless there's an easy way to do the
>> growing without too much extra code hanging around.
>>
>> On Thursday, July 21, 2016 at 1:54:10 AM UTC-7, Christoph Ortner wrote:
>>>
>>> could still preallocate and grow as needed?
>>>
>>> On Thursday, 21 July 2016 02:48:58 UTC+1, Chris Rackauckas wrote:

 Most of the arrays are changing size each time though, since they
 represent a population which changes each timestep.

 On Wednesday, July 20, 2016 at 6:47:39 PM UTC-7, Steven G. Johnson
 wrote:
>
> It looks like you are allocating lots of arrays in your doStep
> inner-loop function, so I'm sure you could improve it by moving the
> allocations out of the inner loop.  (In general, vectorized routines are
> convenient but they aren't the fastest way to do things.)
>



Re: [julia-users] Array of vectors in type definition

2016-07-19 Thread Tom Breloff
I think the important thing to know is that Array is an abstract type
unless all parameters have a concrete value. Vector{T} is just a typealias
for Array{T,1}, so Vector{Float64} is a concrete type because
Array{Float64,1} has concrete parameters. However Array{Float64} is NOT
fully specified... It is implicitly the abstract type Array{Float64,N}, and
so you're creating a vector of abstract types, which will hurt performance
in general.

On Tuesday, July 19, 2016, Patrick Kofod Mogensen <
patrick.mogen...@gmail.com> wrote:

> Vector{T} means a vector where the elements are of type T. If T =
> Vector{S} then every element in the original vector is itself a vector with
> elements of type S. In your case, S = Float64 and T = Vector{S} =
> Vector{Float64}. I think it's a pretty good idea to make sure you
> understand this, as the type system is important to understand in order to
> fully exploit multiple dispatch, and to get good performance out of Julia
> programs.
>
> On Tuesday, July 19, 2016 at 12:12:36 AM UTC+2, Ferran Mazzanti wrote:
>>
>> Hi Mauro,
>> your solution seems to work... though I do not understand exactly why :)
>> Even Vector{Array{Float64}} works.
>> Thanks for your kind help :)
>> Ferran.
>>
>


Re: [julia-users] Re: Julia String Manipulation

2016-07-18 Thread Tom Breloff
julia> parse(Float64,ans[1])
200.5


On Mon, Jul 18, 2016 at 3:33 PM, Yared Melese  wrote:

> Thanks for quick response, it works in most cases but when the number is
> float, parse has problem as shown below
>
> How about when the number has decimal points for example
>
> exString = "Exact number 390  \n Exact qty: +200.5 people \n Starting
> number:  5 now 16.5A_C"
> srchStr ="Exact qty:"
> search(exString, srchStr)
> ans = exString[search(exString, srchStr)[end]+1:end] |> strip |> split
> value1= parse(string,ans[1])
>
> Thanks
> Yared
>
>
> On Monday, July 18, 2016 at 1:31:16 PM UTC-5, Yared Melese wrote:
>
>> Hello
>>
>> I was trying to parse a number from string as shown below. Would you
>> please let me know if there is easy way to get the number after
>> a specific string ? please note that the string can be variable(different)
>>
>> goal is to specify search string and put out exact number with out any
>> text before and after the number.
>>
>> The current program shown below has two faults
>> 1. on line 10, I have to manually enter starting word but cannot put a
>> variable as shown below
>> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
>>
>> 2. I have to only get a number, that means anything in front and behind
>> that number should be stripped off
>>
>>
>>
>> exString = "Exact number 390  \n Exact qty: +200 people \n Starting
>> number:  5 now 16.5A_C"
>> srchStr ="Exact qty:"
>> b= split(exString,"\n") # put each line to an array form
>> #find index of excact string match
>> for i in 1:length(b)
>> if contains(b[i], srchStr) == true
>>   srchInd = i
>> end
>>end
>> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
>> d=replace(c.match, srchStr,"")
>> print(d)
>>
>


Re: [julia-users] Julia String Manipulation

2016-07-18 Thread Tom Breloff
Something like this?

julia> search(exString, srchStr)
21:30

julia> exString[search(exString, srchStr)[end]+1:end] |> strip |> split
7-element Array{SubString{ASCIIString},1}:
 "+200"
 "people"
 "Starting"
 "number:"
 "5"
 "now"
 "16.5A_C"

julia> parse(Int, ans[1])
200


On Mon, Jul 18, 2016 at 2:31 PM, Yared Melese  wrote:

> Hello
>
> I was trying to parse a number from string as shown below. Would you
> please let me know if there is easy way to get the number after
> a specific string ? please note that the string can be variable(different)
>
> goal is to specify search string and put out exact number with out any
> text before and after the number.
>
> The current program shown below has two faults
> 1. on line 10, I have to manually enter starting word but cannot put a
> variable as shown below
> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
>
> 2. I have to only get a number, that means anything in front and behind
> that number should be stripped off
>
>
>
> exString = "Exact number 390  \n Exact qty: +200 people \n Starting
> number:  5 now 16.5A_C"
> srchStr ="Exact qty:"
> b= split(exString,"\n") # put each line to an array form
> #find index of excact string match
> for i in 1:length(b)
> if contains(b[i], srchStr) == true
>   srchInd = i
> end
>end
> c = match(r"$srchStr[\w|\w %s%f%f|.|:|+]*", b[srchInd])
> d=replace(c.match, srchStr,"")
> print(d)
>


Re: [julia-users] Suddenly PyPlot giving me grief

2016-07-13 Thread Tom Breloff
Have you tried using the conda local install?

ENV["PYTHON"] = ""
Pkg.build("PyPlot")

Also it's not a real solution, but you could try Plots.jl with a different
backend. It sounds like you have a system library clash of some sort, and
in my experience those sorts of bugs will easily sink a week of debugging
with no good solution.

On Wednesday, July 13, 2016, Ed Scheinerman 
wrote:

> And when I do a simple "using PyPlot" I get these errors. Someone, please
> help :-(
>
>
> julia> using PyPlot
>
> objc[83239]: Class TKApplication is implemented in both
> /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
> /Users/ers/.julia/v0.4/Conda/deps/usr/lib/libtk8.5.dylib. One of the two
> will be used. Which one is undefined.
>
> objc[83239]: Class TKMenu is implemented in both
> /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
> /Users/ers/.julia/v0.4/Conda/deps/usr/lib/libtk8.5.dylib. One of the two
> will be used. Which one is undefined.
>
> objc[83239]: Class TKContentView is implemented in both
> /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
> /Users/ers/.julia/v0.4/Conda/deps/usr/lib/libtk8.5.dylib. One of the two
> will be used. Which one is undefined.
>
> objc[83239]: Class TKWindow is implemented in both
> /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk and
> /Users/ers/.julia/v0.4/Conda/deps/usr/lib/libtk8.5.dylib. One of the two
> will be used. Which one is undefined.
>
>
> julia> plot([1,2],[1,3])
>
> Exception in Tkinter callback
>
> Traceback (most recent call last):
>
>   File
> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/lib-tk/Tkinter.py",
> line 1537, in __call__
>
> return self.func(*args)
>
>   File
> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py",
> line 283, in resize
>
> self.show()
>
>   File
> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py",
> line 355, in draw
>
> tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
>
>   File
> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/tkagg.py",
> line 30, in blit
>
> id(data), colormode, id(bbox_array))
>
> TclError
>
> julia(83239,0x7fff7ce8a000) malloc: *** error for object 0x7fe0916936d0:
> pointer being freed was not allocated
>
> *** set a breakpoint in malloc_error_break to debug
>
>
> signal (6): Abort trap: 6
>
> __pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
>
> Abort trap: 6
>
>
>
> On Wednesday, July 13, 2016 at 8:37:28 AM UTC-4, Ed Scheinerman wrote:
>>
>>
>>
>> On Tuesday, July 12, 2016 at 8:16:03 AM UTC-4, David P. Sanders wrote:
>>>
>>> As a quick solution, I would suggest deleting or renaming ~/.julia/v0.4
>>> and reinstalling all the packages.
>>>
>>>
>>>
>> Good suggestion, minor hassle. Did it and the problem is not solved. I
>> got this today:
>>
>> Exception in Tkinter callback
>>
>> Traceback (most recent call last):
>>
>>   File
>> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/lib-tk/Tkinter.py",
>> line 1537, in __call__
>>
>> return self.func(*args)
>>
>>   File
>> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py",
>> line 283, in resize
>>
>> self.show()
>>
>>   File
>> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py",
>> line 355, in draw
>>
>> tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
>>
>>   File
>> "/Users/ers/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/tkagg.py",
>> line 30, in blit
>>
>> id(data), colormode, id(bbox_array))
>>
>> TclError
>>
>>
>> julia(82876,0x7fff7ce8a000) malloc: *** error for object 0x7fefddbb2ad0:
>> pointer being freed was not allocated
>>
>> *** set a breakpoint in malloc_error_break to debug
>>
>>
>> signal (6): Abort trap: 6
>>
>> __pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
>> Abort trap: 6
>>
>


[julia-users] [ANN] Plots ecosystem

2016-07-12 Thread Tom Breloff
Hi everyone.  I wanted to let you know about some changes that are
happening with the soon-to-be-tagged 0.8 version of Plots.  In an attempt
to organize the ecosystem and thin out the core of Plots, there are a few
relatively new packages, all within the JuliaPlots organization:

PlotUtils.jl: Generic plotting components.  For now this includes a
redesign of the color handling, as well as the optimize_ticks method from
Gadfly.  The hope is that eventually several plotting packages can share
this dependency, but for now it is only used by Plots.

StatPlots.jl: This new package contains:

   - From Plots: DataFrame support and boxplot, violin, and density recipes
   - From PlotRecipes: corrplot and marginalhist recipes
   - Additional: cornerplot (thanks @mauro3) and recipes on Distributions

PlotRecipes.jl: All non-core recipes that don't have a better home.  For
now, there are recipes for:

   - Graphs (spectral, stress-based, tree, arc/chord diagrams)
   - Maps (supports Shapefile.jl)
   - and others

Note: *If you want to plot DataFrames, you need to import StatPlots!!*

Let me know if you have any questions/concerns.  If you create generic
recipes that you think others might use, please consider contributing to
either StatPlots or PlotRecipes!

Best,
Tom


Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Tom Breloff
Yes. They are different numbers. In a way, negative zero represents "a
really small negative number" that can't be represented exactly using
floating point.

On Saturday, July 9, 2016, Davide Lasagna  wrote:

> Hi,
>
> I have just been bitten by a function hashing a custom type containing a
> vector of floats. It turns out that hashing positive and negative floating
> point zeros returns different hashes.
>
> Demo:
> julia> hash(-0.0)
> 0x3be7d0f7780de548
>
> julia> hash(0.0)
> 0x77cfa1eef01bca90
>
> julia> hash(0)
> 0x77cfa1eef01bca90
>
> Is this expected behaviour?
>
>


Re: [julia-users] Dear Sublime Text Users

2016-07-09 Thread Tom Breloff
You has me at LaTeX. :)   Looking forward to checking this out.

On Saturday, July 9, 2016, Randy Lai  wrote:

> Hi all Sublime Text uers,
>
>
> I have just created a tiny package Julia-Unicode
>  to help inserting LaTeX and
> Unicode in Sublime Text. It uses the Julia mappings so you don't have to
> worry about
> the different betwwen ɛ (\varepsilon) and ϵ (\epsilon).
> You may have heard of Julia Completions
>  or UnicodeMath
> , I promise you that
> Julia-Unicode works better than them :).
>
> Check it out from Package Control.
>
> Feedbacks appreciated.
>


[julia-users] IJCAI

2016-07-08 Thread Tom Breloff
Will any julians be in NYC for IJCAI or AGI-16 this week (and next)?


Re: [julia-users] More on Macros

2016-07-05 Thread Tom Breloff
I think you're confused about several things.  First, yes a Void is
expected, because that's what a macro definition will yield.

- It is almost always a bad idea to call "eval(parse(...))".  You'd
probably doing something wrong if you ever feel the need to do that.
- "Parse time" is not always "before you run any code".  In your example,
parsing happens when you call the returnMacro method.
- Macros are not like other functions... think of them as "code swappers".
You look at the parsed expression and replace it with another valid
expression.  There's no concept of run-time values or anything else...
you're just swapping code-for-code.

On Tue, Jul 5, 2016 at 11:04 AM, Rangarajan Krishnamoorthy <
ranga@gmail.com> wrote:

> Consider this function:
>
> function returnMacro()
>   eval(parse("""
>   macro myMacro(anexpr)
> parse(anexpr)
>   end
>   """))
> end
>
> I assign the function's result to a variable:
> mymacro = returnMacro()
>
> Then, typeof(mymacro) returns "Void". Is this correct? Because macros are
> parse time entities, wouldn't it be better for "eval" to raise some sort of
> exception?
>
> -Rangarajan
>


Re: [julia-users] Question on Macros

2016-07-05 Thread Tom Breloff
You ask why the "@" symbol is needed, and then point out that you can have
a macro and function of the same name, and that might lead to subtle
mistakes.  I think you just answered your own question!

Macros are called at parse time, and it's valuable to have a clear syntax
to distinguish from run-time behavior.

On Tue, Jul 5, 2016 at 5:47 AM, Rangarajan Krishnamoorthy <
ranga@gmail.com> wrote:

> Hi,
> I am new to Julia, but have a background in Lisp and other languages. I
> found it interesting that Julia supports Macros similar to Lisp. A few
> questions:
> 1) Julia uses "@" operator as a prefix to a macro call. Why is this needed
> at all? Why not call it like a normal function without the prefix?
>
> 2) Consider this macro:
> macro myEval(anexpr)
> parse(anexpr)
> end
> After defining this macro, the expression:
> typeof(myEval)
> triggers an "undefVarError". Why? The symbol "myEval" is a macro
> definition. There must be some type for it?
> (If this is a "Function", then type is returned correctly.)
>
> 3) Julia allows me to define both a function and a macro to have the same
> name. Isn't this likely to lead to subtle mistakes?
>
> Regards,
> Rangarajan
>


Re: [julia-users] wish a sinusoidal

2016-06-29 Thread Tom Breloff
Again... 'plot' creates a new Plot, and 'plot!' adds to or updates an
existing Plot. Your second plot command need an exclamation point.

On Wednesday, June 29, 2016, Henri Girard  wrote:

> Hi,
> I can't get a sinusoidal like with pyplot, I got it once but I lost my
> config.
> Any help ?
>
>
>
> using Sundials,ODE,Plots
> pyplot(size=(300,200),leg=false,
> guidefont=font(7), titlefont=font(7));
> function oscillator(t, y, ydot)
> ydot[1] = y[2]
> ydot[2] = - 3 * y[1] - y[2] / 10
> end
> initial = [1.0,0.0];   # Initial conditions
> t = float([0:1.125:30]);# Time steps for solution
> xv = Sundials.cvode(oscillator, initial, t);
> xv[1:5,:]
> plot(t,xv[:,1],title="Mouvement",
> bg=RGB(.2,.2,.2),
> xlabel ="Temps",ylabel = "Vitesse")
> vₓ=xv[:,1]
> vᵥ=xv[:,2]
> plot(vₓ,vᵥ,title="Mouvement",
> bg=RGB(.2,.2,.2),
> xlabel ="Temps",ylabel = "Vitesse")
>


Re: [julia-users] how to get rid of axis in Plots ?

2016-06-28 Thread Tom Breloff
Try 'ticks=nothing, border=nothing'

On Tuesday, June 28, 2016, Henri Girard  wrote:

> I don't see any command to get rid of axis in Plots or hide them
> I tried axis=false axes =false idem with none but nothing works...
>
>


[julia-users] Re: Plots with Plots

2016-06-28 Thread Tom Breloff
Ok I don't think you need recipes for this... just a simple call to 'plot'
with the attributes you want. See the "attributes" page of the docs for
descriptions of what's available.

On Tuesday, June 28, 2016, Henri Girard <henri.gir...@gmail.com> wrote:

> Well... It's here I got your examples :
>
> https://github.com/tbreloff/ExamplePlots.jl/blob/master/notebooks/apply_recipe.ipynb
> I just wanted to try it...
> My next aim is to use ODE with plots to do my portrait phase and RLC from
> pyplot to Plots --pyplot-
>
> w0=1/sqrt(L*C)
> Q=sqrt(L/C)/R
> tau=2*Q/w0
> E=6;
> function rlc(y,t)
> return([y[2],-w0^2*y[1]-(w0/Q)*y[2]])
> end;
> y0=[E,0];
> listet=linspace(0,5*tau,1000)
> liste_u_uprime=integrate.odeint(rlc,y0,listet)
> listeu=liste_u_uprime[:,1]
> listeuprime=liste_u_uprime[:,2];
> plt.clf()
> plt.plot(listet,listeu,label="U(t)")
> plt.title("RLC")
> plt.xlabel("t (s)")
> plt.ylabel("U(v)")
> plt.grid()
> plt.legend(loc=4);
> --
> plt.clf()
> plt.plot(listeu,listeuprime,label="U\'=fct(U)")
> plt.xlabel("U (V)")
> plt.ylabel("U' (V/s)")
> plt.title("Portrait de phase  RLC regime libre")
> plt.grid()
> plt.legend(loc=4);
> -
> this with ODE in Plots
> I thaught it would be easy but I was wrong !
> Plots has nicer environment than pyplot (I like your dark one with black
> background I can't make it with pyplot
>
>
>
>
>
>
>
>
> Le vendredi 24 juin 2016 17:37:15 UTC+2, Tom Breloff a écrit :
>>
>> I just uploaded the IJulia notebook which was my JuliaCon workshop:
>> https://github.com/tbreloff/ExamplePlots.jl/blob/master/notebooks/plotswithplots.ipynb
>> .
>>
>> You'll need to be on master or dev to follow along until I tag 0.7.3.
>> The documentation is getting more and more complete, so I recommend giving
>> it a quick read if you're curious about Plots:
>> http://plots.readthedocs.io/en/latest/
>>
>> -Tom
>>
>


[julia-users] Re: Plots with Plots

2016-06-28 Thread Tom Breloff
I think you must be looking at an old example? Can you tell me where you
found it so I can update? '_apply_recipe' doesn't exist, and you shouldn't
have to import it anyways.

Let me know what your end goal is and I can help. I understand the docs
need better organization.

On Tuesday, June 28, 2016, Henri Girard  wrote:

> That's what I get,any help  :
> Pkg.checkout("Plots")
> Pkg.checkout("PlotRecipes")
>
>
> using Plots, PlotRecipes
> pyplot()
> import Plots: _apply_recipe, KW
> immutable F
>f::Function
> end
> getf(f::F) = f.f
> 
>
> WARNING: could not import Plots._apply_recipe into Main
>
> ---
> _apply_recipe(d::KW, f::F, args...; kw...) = (f.f, args...)
> plot(F(sin), 0, 4π)
> ---
> [Plots.jl] Initializing backend: pyplot
>
> LoadError: In convertToAnyVector, could not handle the argument types: (F,)
> while loading In[6], in expression starting on line 3
>
>  [inlined code] from /home/pi/.julia/v0.4/Plots/src/series_new.jl:86
>  in apply_recipe at /home/pi/.julia/v0.4/RecipesBase/src/RecipesBase.jl:235
>  in _plot! at /home/pi/.julia/v0.4/Plots/src/plot.jl:312
>  in plot at /home/pi/.julia/v0.4/Plots/src/plot.jl:52
>
>
> ​
>
>
>


Re: [julia-users] Plots with Plots

2016-06-27 Thread Tom Breloff
For anyone interested, I made a short demo of what's possible with the
GLVisualize backend in Plots, after hacking at JuliaCon with Simon.  Plots,
Interact, and GLVisualize... oh my!

https://www.youtube.com/watch?v=mRvUhLpUq88

I just tagged a new version of Plots... until it's merged you'll need to be
on master or dev.  We're not quite ready for bug reports on GLVisualize...
plenty of things on Simon's todo list :D

On Sat, Jun 25, 2016 at 9:19 AM, daycaster  wrote:

> Plots.jl looks amazing!
>
> A couple of questions:
> Is there any way to control the fonts used in a plot? I can't see any
> obvious way to specify fonts outside the usual range of
> "Helvetica"/"Courier".
>
> Also, I can't get any results from searching the docs. Is search currently
> broken or are there ways to specify words that I don't know?


Re: [julia-users] Multiple JULIA_PKGDIR directories in a hierarchy for supporting a shared environment

2016-06-27 Thread Tom Breloff
Well presumably it could do something that the import logic already does,
but I appreciate that it is complex logic.

David: @wildart is the person to follow for the future of package
management.

On Mon, Jun 27, 2016 at 2:02 PM, Stefan Karpinski 
wrote:

> You can use LOAD_PATH to look in a stack of directories, and you can even
> set ENV["JULIA_PKGDIR"] to change which one Pkg manages, but you cannot
> manage more than one of them at the same time, since it's unclear what this
> would even do.
>
> On Mon, Jun 27, 2016 at 1:28 PM, David Parks 
> wrote:
>
>> I want to set up a specific Julia environment on a cluster for other
>> people to use. I have particular packages, including some that are dev
>> branches, and even some that draw from my own fork of a branch to support a
>> custom feature for this environment. So the package setup is non trivial
>> and I don't want everyone else to have to follow the details.
>>
>> Is there a way (now or in the future) to have a hierarchy of package
>> directories, so I could have a main repository that I setup and control for
>> the relevant packages, but still allow users to extend on that but into
>> their own package directory?
>>
>> Or is there a way good way for me to auto-configure a complex package
>> directory for the user? I suppose the obvious answer is to just write a
>> package setup script, which might be a suitable solution. But I wonder if
>> anything else is possible or on the horizon.
>>
>> Thanks,
>> David
>>
>>
>


Re: [julia-users] using in try catch block

2016-06-27 Thread Tom Breloff
Yichao: is there an alternative "is_installed" definition that would check
the load path?  Lets assume I don't actually want to import it, just check.

On Mon, Jun 27, 2016 at 12:48 PM, Yichao Yu <yyc1...@gmail.com> wrote:

>
> On Jun 27, 2016 12:20 PM, "Tom Breloff" <t...@breloff.com> wrote:
> >
> > Here is what I use for this sort of logic:
> >
> > function is_installed(pkgstr::AbstractString)
> > try
> > Pkg.installed(pkgstr) === nothing ? false: true
>
> Dont do this since this will miss package in load path. Just eval a using
> expression.
>
> > catch
> > false
> > end
> > end
> >
> >
> > On Mon, Jun 27, 2016 at 12:12 PM, David Anthoff <anth...@berkeley.edu>
> wrote:
> >>
> >> I’m trying to use ``using`` in a try catch block, but that doesn’t seem
> to be supported.
> >>
> >>
> >>
> >> Any other way around this? Essentially I want to load a package, and if
> the package is not installed, automatically do a ``Pkg.add``.
> >>
> >>
> >>
> >> I could of course get a list of all the installed packages and see if
> the one I need is there, but given the slowness of the package manager, I
> would prefer to just try to load it first, and only if that fails attempt
> to ``Pkg.add``.
> >>
> >>
> >>
> >> Thanks,
> >>
> >> David
> >>
> >>
> >>
> >> --
> >>
> >> David Anthoff
> >>
> >> University of California, Berkeley
> >>
> >>
> >>
> >> http://www.david-anthoff.com
> >>
> >>
> >
> >
>


Re: [julia-users] using in try catch block

2016-06-27 Thread Tom Breloff
Here is what I use for this sort of logic:

function is_installed(pkgstr::AbstractString)
try
Pkg.installed(pkgstr) === nothing ? false: true
catch
false
end
end


On Mon, Jun 27, 2016 at 12:12 PM, David Anthoff 
wrote:

> I’m trying to use ``using`` in a try catch block, but that doesn’t seem to
> be supported.
>
>
>
> Any other way around this? Essentially I want to load a package, and if
> the package is not installed, automatically do a ``Pkg.add``.
>
>
>
> I could of course get a list of all the installed packages and see if the
> one I need is there, but given the slowness of the package manager, I would
> prefer to just try to load it first, and only if that fails attempt to
> ``Pkg.add``.
>
>
>
> Thanks,
>
> David
>
>
>
> --
>
> David Anthoff
>
> University of California, Berkeley
>
>
>
> http://www.david-anthoff.com
>
>
>


Re: [julia-users] Row/column iterators?

2016-06-27 Thread Tom Breloff
Thanks Tim!  I can always count on you to have solutions for everything :)

On Mon, Jun 27, 2016 at 11:31 AM, Tim Holy <tim.h...@gmail.com> wrote:

> In Base there's mapslices, which may already do what you want.
>
> Something like what you're proposing (but not yet with a nice "high level"
> API
> wrapper, since the low-level stuff is still in flux) is already here:
> https://github.com/timholy/ArrayIteration.jl
> That's aiming at a very general approach that should be efficient for a
> wide
> variety of AbstractArrays (dense, sparse, perhaps even distributed, etc). I
> bet you don't need so much generality?
>
> Assuming you'd be happy with something that works well for just dense
> matrices, your `view(mat, :, i)` idea should work just fine. Given that
> julia-0.5 is just around the corner, my assumption is that it would be
> best to
> put it in a package first, and think about adding to Base later. (But I'm
> not
> opposed to sticking it in now, either.)
>
> Best,
> --Tim
>
> On Monday, June 27, 2016 9:42:33 AM CDT Tom Breloff wrote:
> > I find myself frequently wanting to do something like:
> >
> > mat = rand(100,4)
> > for c in columns(mat)
> > # c is a vector (a view maybe?)
> > end
> >
> > I think ideally this method would return a lazy iterator which returns a
> > `view(mat, :, i)` at each step.  Does this exist already?  If not, would
> it
> > be welcomed in Base?
> >
> > -Tom
>
>
>


Re: [julia-users] Row/column iterators?

2016-06-27 Thread Tom Breloff
Thanks for the link!  I'll continue the discussion there.

On Mon, Jun 27, 2016 at 10:06 AM, Kristoffer Carlsson  wrote:

> https://github.com/JuliaLang/julia/issues/14491


Re: [julia-users] preANN: ArbFloats. the sequel. (extended precision *values* as floating point numbers)

2016-06-25 Thread Tom Breloff
Thanks Jeffrey.  Starred and followed.  For those following from a
distance, ArbFloats (IMO) are a *much* faster alternative to
"fixed-precision Unums 1.0", and could nicely form the basis of interval
arithmetic with open/closed endpoints, paving/uboxing algorithms, and more.

On Sat, Jun 25, 2016 at 4:29 AM, Jeffrey Sarnoff 
wrote:

> If the first ArbFloats.jl was proof of concept, this one is concept of
> proof.
>
> This is a pre-announcement in response to some requests for access and my
> preference.
>
> These quantities are information-richest floating point representations of
> using arithmetic, elementary and some special functions.
> ArbFloats presents digits that neither lead nor mislead the perception of
> value, showing more or fewer digits would be less informative.
>
> When announced (ANN), I will offer more explanation and examples and any
> overlooked details,
> no worries -- if you do not need this now, wait for me to have fuller
> tests written, etc.
> .
> If you do need it or just want to play with it, please do and share your
> experience with me.
>
> https://github.com/jsarnoff-juliacon/ArbFloats.jl
>
>


[julia-users] Plots with Plots

2016-06-24 Thread Tom Breloff
I just uploaded the IJulia notebook which was my JuliaCon workshop:
https://github.com/tbreloff/ExamplePlots.jl/blob/master/notebooks/plotswithplots.ipynb
.

You'll need to be on master or dev to follow along until I tag 0.7.3.  The
documentation is getting more and more complete, so I recommend giving it a
quick read if you're curious about Plots:
http://plots.readthedocs.io/en/latest/

-Tom


Re: [julia-users] Achitecture for solving largish LASSO/elasticnet problem

2016-06-24 Thread Tom Breloff
You could consider streaming data to multiple instances of OnlineStats.jl
in parallel. There should be no problem with memory usage as long as you
don't explicitly load your whole data set at once.

On Friday, June 24, 2016, Matthew Pearce  wrote:

> Hello
>
> I'm trying to solve a largish elasticnet type problem (convex
> optimisation).
>
>- The LARS.jl package produces Out of Memory errors for a test (1000,
>262144) problem. /proc/meminfo suggests I have 17x this array size free so
>not sure what's going on there.
>- I have access to multiple GPUs and nodes.
>- I would potentially need to solve problems of the above sort of size
>or bigger (10k, 200k) many, many times.
>
> Looking for thoughts on the appropriate way to go about tackling this:
>
>- Rewrap an existing glmnet library for Julia (e.g. this CUDA enabled
>one https://github.com/jeffwong/cudaglmnet or
>http://www-hsc.usc.edu/~garykche/gpulasso.pdf)
>- Go back to basics and use and optimisation package on the objective
>function (https://github.com/JuliaOpt), but which one? Would this be
>inefficient compared to specific glmnet solvers which do some kind of
>coordinate descent?
>- Rewrite some CUDA library from scratch (OK - probably a bad idea).
>
> Thoughts on the back of a postcard would be gratefully received.
>
>
> Cheers
>
>
> Matthew
>


Re: [julia-users] pyplot how to change bground color ?

2016-06-24 Thread Tom Breloff
When you say "doesn't work for pyplot", what have you tried?

On Friday, June 24, 2016, Henri Girard  wrote:

> Hi,
> I didn't find anything to modify background in pyplot, it's so easy in
> plots but that doesn't work for pyplot, even maplotlib command ?
> Any help ?
> HG
>


Re: [julia-users] JuliaCon birds of a feather

2016-06-22 Thread Tom Breloff
Let's meet in front of the name-tags at 6:30 and walk somewhere together.
If you haven't already gotten in touch, please let me know if you want to
join.

On Wednesday, June 22, 2016, Cedric St-Jean <cedric.stj...@gmail.com> wrote:

> I'm down. Thank you for organizing.
>
> On Wed, Jun 22, 2016 at 1:19 PM, Tom Breloff <t...@breloff.com
> <javascript:_e(%7B%7D,'cvml','t...@breloff.com');>> wrote:
>
>> For those at JuliaCon today, I'm organizing a dinner to discuss "The
>> future of Machine Learning and Data Science in Julia".  Tonight (Wednesday)
>> 7pm, location TBD.  If you're interested in joining, please let me know.
>>
>> -Tom
>>
>> On Mon, Jun 20, 2016 at 11:15 AM, Cedric St-Jean <cedric.stj...@gmail.com
>> <javascript:_e(%7B%7D,'cvml','cedric.stj...@gmail.com');>> wrote:
>>
>>> +1, definitely interested in some of those subjects
>>>
>>> On Sunday, June 19, 2016 at 11:29:06 PM UTC-4, Tom Breloff wrote:
>>>>
>>>> Time to dredge this topic up again!  With JuliaCon only a couple days
>>>> away, I want to make sure we take advantage of getting people in the same
>>>> room to collaborate.  I'm interested in the following topics, and I'm ready
>>>> to organize lunches, dinners, and/or drinks to discuss:
>>>>
>>>> - graphics in Julia
>>>> - data science: LearnBase and generalized learnable transformations
>>>> - AGI: deep reinforcement learning, dynamic neural net structures, or
>>>> an infinity of other interesting topics
>>>> - Julia in finance: robust trading systems, handling real-time
>>>> workloads, etc
>>>>
>>>> This is a small amount of what interests me, but if you see anything,
>>>> please reach out.  I hope that the hackathon on Saturday will be productive
>>>> collaboration on ideas that are discussed!
>>>>
>>>> Best,
>>>> Tom
>>>>
>>>> On Wed, May 18, 2016 at 9:38 AM, Andreas Noack <andreasno...@gmail.com>
>>>> wrote:
>>>>
>>>>> The Hackathon on Saturday is quite flexible so if somebody volunteers
>>>>> to organize such session then I'm sure we can make it happen. There should
>>>>> be people around that are knowledgeable about the topics.
>>>>>
>>>>>
>>>>> On Tuesday, May 17, 2016 at 10:26:00 AM UTC-4, Josef Sachs wrote:
>>>>>>
>>>>>> Will there be any organized or unorganized opportunities for
>>>>>> birds of a feather sessions at JuliaCon?  I would be particularly
>>>>>> interested in
>>>>>>
>>>>>> (1) Julia on Amazon Web Services, and
>>>>>>
>>>>>> (2) editors and IDEs for Julia (There was talk at one point about
>>>>>> arranging a NYC Julia User Group meeting where we would be talking
>>>>>> about how to get various text editors set up to work with Julia,
>>>>>> but doing it at JuliaCon would probably be even better.  It would
>>>>>> also be great to see a demo of JuliaDT, the Eclipse plugin, if that
>>>>>> could be arranged.)
>>>>>>
>>>>>
>>>>
>>
>


Re: [julia-users] GraphViz.jl alternative on windows

2016-06-22 Thread Tom Breloff
I have a basic graph recipe using a spectral algorithm in PlotRecipes...
You can see a couple examples in the readme. It's not full featured but
might fit your needs.

On Wednesday, June 22, 2016, David Anthoff  wrote:

> Hi,
>
>
>
> GraphViz.jl doesn’t seem to work on Windows. Is there an alternative
> package for this sort of thing? I know about NetworkViz.jl and
> TikzGraphs.jl, but would appreciate pointers to any other package that I
> might have missed.
>
>
>
> Thanks,
>
> David
>
>
>
> --
>
> David Anthoff
>
> University of California, Berkeley
>
>
>
> http://www.david-anthoff.com
>
>
>


Re: [julia-users] Re: JuliaCon birds of a feather

2016-06-22 Thread Tom Breloff
For those at JuliaCon today, I'm organizing a dinner to discuss "The future
of Machine Learning and Data Science in Julia".  Tonight (Wednesday) 7pm,
location TBD.  If you're interested in joining, please let me know.

-Tom

On Mon, Jun 20, 2016 at 11:15 AM, Cedric St-Jean <cedric.stj...@gmail.com>
wrote:

> +1, definitely interested in some of those subjects
>
> On Sunday, June 19, 2016 at 11:29:06 PM UTC-4, Tom Breloff wrote:
>>
>> Time to dredge this topic up again!  With JuliaCon only a couple days
>> away, I want to make sure we take advantage of getting people in the same
>> room to collaborate.  I'm interested in the following topics, and I'm ready
>> to organize lunches, dinners, and/or drinks to discuss:
>>
>> - graphics in Julia
>> - data science: LearnBase and generalized learnable transformations
>> - AGI: deep reinforcement learning, dynamic neural net structures, or an
>> infinity of other interesting topics
>> - Julia in finance: robust trading systems, handling real-time workloads,
>> etc
>>
>> This is a small amount of what interests me, but if you see anything,
>> please reach out.  I hope that the hackathon on Saturday will be productive
>> collaboration on ideas that are discussed!
>>
>> Best,
>> Tom
>>
>> On Wed, May 18, 2016 at 9:38 AM, Andreas Noack <andreasno...@gmail.com>
>> wrote:
>>
>>> The Hackathon on Saturday is quite flexible so if somebody volunteers to
>>> organize such session then I'm sure we can make it happen. There should be
>>> people around that are knowledgeable about the topics.
>>>
>>>
>>> On Tuesday, May 17, 2016 at 10:26:00 AM UTC-4, Josef Sachs wrote:
>>>>
>>>> Will there be any organized or unorganized opportunities for
>>>> birds of a feather sessions at JuliaCon?  I would be particularly
>>>> interested in
>>>>
>>>> (1) Julia on Amazon Web Services, and
>>>>
>>>> (2) editors and IDEs for Julia (There was talk at one point about
>>>> arranging a NYC Julia User Group meeting where we would be talking
>>>> about how to get various text editors set up to work with Julia,
>>>> but doing it at JuliaCon would probably be even better.  It would
>>>> also be great to see a demo of JuliaDT, the Eclipse plugin, if that
>>>> could be arranged.)
>>>>
>>>
>>


Re: [julia-users] Re: JuliaCon birds of a feather

2016-06-19 Thread Tom Breloff
Time to dredge this topic up again!  With JuliaCon only a couple days away,
I want to make sure we take advantage of getting people in the same room to
collaborate.  I'm interested in the following topics, and I'm ready to
organize lunches, dinners, and/or drinks to discuss:

- graphics in Julia
- data science: LearnBase and generalized learnable transformations
- AGI: deep reinforcement learning, dynamic neural net structures, or an
infinity of other interesting topics
- Julia in finance: robust trading systems, handling real-time workloads,
etc

This is a small amount of what interests me, but if you see anything,
please reach out.  I hope that the hackathon on Saturday will be productive
collaboration on ideas that are discussed!

Best,
Tom

On Wed, May 18, 2016 at 9:38 AM, Andreas Noack  wrote:

> The Hackathon on Saturday is quite flexible so if somebody volunteers to
> organize such session then I'm sure we can make it happen. There should be
> people around that are knowledgeable about the topics.
>
>
> On Tuesday, May 17, 2016 at 10:26:00 AM UTC-4, Josef Sachs wrote:
>>
>> Will there be any organized or unorganized opportunities for
>> birds of a feather sessions at JuliaCon?  I would be particularly
>> interested in
>>
>> (1) Julia on Amazon Web Services, and
>>
>> (2) editors and IDEs for Julia (There was talk at one point about
>> arranging a NYC Julia User Group meeting where we would be talking
>> about how to get various text editors set up to work with Julia,
>> but doing it at JuliaCon would probably be even better.  It would
>> also be great to see a demo of JuliaDT, the Eclipse plugin, if that
>> could be arranged.)
>>
>


Re: [julia-users] Plots : subplots ?

2016-06-17 Thread Tom Breloff
http://plots.readthedocs.io/en/latest/layouts/

On Fri, Jun 17, 2016 at 2:46 PM, Henri Girard 
wrote:

> HI,
> I am trying to make a subplot in Plots but I can't ... Is it like with
> pyplot ?
> Help needed
> Regards
> HG
>


Re: [julia-users] Plots 2 pic ?

2016-06-16 Thread Tom Breloff
The double display should be fixed if/when a PyPlot PR is merged:
https://github.com/stevengj/PyPlot.jl/pull/223

...But I think Steven's been busy. In the meantime you could clone my fork
and checkout my 'tb_dispfix' branch.

On Thursday, June 16, 2016, Henri Girard  wrote:

> Thanks to all, it's solved for the frequency resonance graphic(I change x
> and y value to 20,80 to put it in the center( I will look for doing it
> automatically). I will make a new one to get rid of all remarks I have done.
> But I have still problem with double graphic each time, I run it.
>
> using Plots
> #pyplot(reuse=true)
> #plt=PyPlot
> R=40;L=1/pi*360E-2;C=1/(pi*360E+2);w=1/(sqrt(L*C))
> f=1/(2.*pi*sqrt(L*C))
> #omega=2*pi*f
> fr=linspace(20,80,100)
> y= abs(1 ./ (1+im*2*pi*fr*R*C-(2*pi*fr).^2*L*C))
> #using Plots
> #y=abs(1./(1+im.*fr.*R.*C-fr.*fr.*L.*C));
> plot(fr,y,title="Resonance frequency",
> bg=RGB(.2,.2,.2),xlabel ="Hz",ylabel = "Ω")
>
> Le jeudi 16 juin 2016 17:09:33 UTC+2, Henri Girard a écrit :
>>
>> Tom,
>> I have double graph each time in jupyter, before I didn't have this
>> problem with plots ? one is white without grid and the second on is right
>> with black theme ?
>> Any help about this ?
>>
>> Le jeudi 16 juin 2016 09:22:12 UTC+2, Henri Girard a écrit :
>>>
>>> Hi,
>>> When I make my plots I have two plots, but before I hadn't this...
>>> w is the resoning frequency, but it should appear at 0 (zéro) not at
>>> extrem ?
>>> Any help, I already ask for help with pyplot, this link :
>>> https://groups.google.com/forum/#!topic/julia-users/EJSvutfdEus, which
>>> works fine for angular pulsation, but I want frequency resonance with Plots
>>> because I guess I can make more beautifull graphic (anyway I don't know
>>> well PyPlot or Plots). I succeeded once with pyplot but after an error I
>>> couldn't find it back !
>>> Bad luck :)
>>> Kind regards
>>> HG
>>>
>>> using Plots
>>> pyplot(reuse=true)
>>> z=10;u=0.02;s=0.02;w=1/(2*pi*sqrt(u*s))
>>> f=linspace(-30,30)
>>> y=abs(1./(1+im.*f.*z.*s-f.*f.*u.*s));
>>> #fig = figure("Angle")
>>> plot(f, y)
>>>
>>


Re: [julia-users] Re: Plots 2 pic ?

2016-06-16 Thread Tom Breloff
I just copy/pasted your code into IJulia and it seems to work:


​
Is the function wrong?  I'm a little confused.

On Thu, Jun 16, 2016 at 9:13 AM, Henri Girard 
wrote:

> My new tentative (which is not working)
> using Plots
> R=1000;L=1/pi*360E-2;C=1/(pi*360E+2)
> w=1/sqrt(L*C)
> f=1/(2*pi*sqrt(L*C))
> omega=linspace(-f,f)
> y=abs(1./(1+im.*omega.*R.*C-omega.*omega.*L.*C));
> plot(omega,y,title="Fréquence de résonance",
> bg=RGB(.2,.2,.2),xlabel ="Hz",ylabel = "Ω")
> ---
> Working plot in sage,( I think the difference is var("f") and omega
>  which is a symbolic variable
> R=30;L=1/pi*360E-2;C=1/(pi*360E+2)
> var("f")
> omega=2*pi*f
> w=1/(sqrt(L*C))
> Fr=1/(2*pi*sqrt(L*C))
> q=plot(abs(1/(1+i*omega*R*C-omega*omega*L*C)),
> omega,0,100,figsize=4,frame=True,
>  fontsize=8,axes=False,color="red")
> show(q)
> print"Fréquence de résonance = ",round(Fr)," Hz"
> Le jeudi 16 juin 2016 09:22:12 UTC+2, Henri Girard a écrit :
>
>> Hi,
>> When I make my plots I have two plots, but before I hadn't this...
>> w is the resoning frequency, but it should appear at 0 (zéro) not at
>> extrem ?
>> Any help, I already ask for help with pyplot, this link :
>> https://groups.google.com/forum/#!topic/julia-users/EJSvutfdEus, which
>> works fine for angular pulsation, but I want frequency resonance with Plots
>> because I guess I can make more beautifull graphic (anyway I don't know
>> well PyPlot or Plots). I succeeded once with pyplot but after an error I
>> couldn't find it back !
>> Bad luck :)
>> Kind regards
>> HG
>>
>> using Plots
>> pyplot(reuse=true)
>> z=10;u=0.02;s=0.02;w=1/(2*pi*sqrt(u*s))
>> f=linspace(-30,30)
>> y=abs(1./(1+im.*f.*z.*s-f.*f.*u.*s));
>> #fig = figure("Angle")
>> plot(f, y)
>>
>


Re: [julia-users] questions for ploting 3D graph in julia

2016-06-16 Thread Tom Breloff
It crashed? I'm patiently waiting for your issue to be posted ;)

Can you post what you have so far? I could take guesses on what your input
data looks like but that would waste both our time. Also what sort of 3d
graph? Point cloud?wireframe with contours?

On Thursday, June 16, 2016, SHORE SHEN  wrote:

> Hi All
>
> Ima plotting an 3D graph from julia, and have the following requirements:
>
> 1, I got the value of Z, X, Y in a array, z=[Z, X, Y]
>
> 2, not all of the value are listed, in other words, the value of X range
> from 0 to 0.20, the value of Y is MAX(75% of X round to 0.0025, X-0.7)
>
> Im using PyPlot, I tried Plots but it crashed...
>
> Thanks!!!
>


Re: [julia-users] Plots/pyplot

2016-06-14 Thread Tom Breloff
For the first one, you'll need to wrap that tuple:  `plot(rand(10),
xaxis=((0,5),))`  Lesson... axis is expecting a tuple of args, so if you
give it one it'll try to do something with each arg.

For the second one, it's updating the tick marks, because that's what it
assumes a list of numbers represent.

You should probably avoid the "magic args" for this case:  `plot(rand(10),
xlims = (0,5))`

See: http://plots.readthedocs.io/en/latest/attributes/#magic-arguments

On Tue, Jun 14, 2016 at 6:04 PM, digxx  wrote:

> HEy, Sorry for the maybe stupid question but apparently I'm not capable of
> setting the range when plotting with plots
>
> so e.g.
>
> x=0:0.1:1
> y=2*x
>
> plots(x,y,xaxis=(0,0.5)
> this does not work.
>
>
>
> and this deletes my xaxis labeling?
> plots(x,y,xasis=0:0.5)
>
>
> Anyway I just want to set range without changing the input vector.
>
>


  1   2   3   4   5   6   >