[julia-users] Re: Gadfly: adding plots to an existing plot
Thanks! On Wednesday, December 31, 2014 8:25:47 PM UTC-6, Daniel Jones wrote: > > My mistake, it should work with append! instead of push!. > > For your second question, here's one option: > a, b, c, d = [rand(10) for _ in 1:4] > > On Wednesday, December 31, 2014 5:58:15 PM UTC-8, AVF wrote: >> >> Sorry, doesn't seem to work: >> >> a = rand(10) >> >> b = rand(10) >> >> c = rand(10) >> >> d = rand(10) >> >> >> p = plot(x=a, y=b) >> >> push!(p.layers, layer(x=c, y=d)) >> >> `convert` has no method matching convert(::Type{Layer}, ::Array{Layer,1}) >> while loading In[185], in expression starting on line 9 >> >> in push! at array.jl:457 >> >> >> As an aside, is there a way to do something like: >> >> [a b c d] = rand(10,4) >> >> >> >> >> On Wednesday, December 31, 2014 11:01:36 AM UTC-6, Daniel Jones wrote: >>> >>> >>> It's not really supported. Adding a "push!" function to add layers to >>> plots was proposed (https://github.com/dcjones/Gadfly.jl/issues/332), >>> but I haven't done so yet. In fact, adding layers to a plot p will usually >>> work with "push!(p.layers, layer(...))", but that's kind of an unofficial >>> solution. >>> >>
[julia-users] Re: Gadfly: adding plots to an existing plot
My mistake, it should work with append! instead of push!. For your second question, here's one option: a, b, c, d = [rand(10) for _ in 1:4] On Wednesday, December 31, 2014 5:58:15 PM UTC-8, AVF wrote: > > Sorry, doesn't seem to work: > > a = rand(10) > > b = rand(10) > > c = rand(10) > > d = rand(10) > > > p = plot(x=a, y=b) > > push!(p.layers, layer(x=c, y=d)) > > `convert` has no method matching convert(::Type{Layer}, ::Array{Layer,1}) > while loading In[185], in expression starting on line 9 > > in push! at array.jl:457 > > > As an aside, is there a way to do something like: > > [a b c d] = rand(10,4) > > > > > On Wednesday, December 31, 2014 11:01:36 AM UTC-6, Daniel Jones wrote: >> >> >> It's not really supported. Adding a "push!" function to add layers to >> plots was proposed (https://github.com/dcjones/Gadfly.jl/issues/332), >> but I haven't done so yet. In fact, adding layers to a plot p will usually >> work with "push!(p.layers, layer(...))", but that's kind of an unofficial >> solution. >> >
[julia-users] Re: Gadfly: adding plots to an existing plot
Sorry, doesn't seem to work: a = rand(10) b = rand(10) c = rand(10) d = rand(10) p = plot(x=a, y=b) push!(p.layers, layer(x=c, y=d)) `convert` has no method matching convert(::Type{Layer}, ::Array{Layer,1}) while loading In[185], in expression starting on line 9 in push! at array.jl:457 As an aside, is there a way to do something like: [a b c d] = rand(10,4) On Wednesday, December 31, 2014 11:01:36 AM UTC-6, Daniel Jones wrote: > > > It's not really supported. Adding a "push!" function to add layers to > plots was proposed (https://github.com/dcjones/Gadfly.jl/issues/332), but > I haven't done so yet. In fact, adding layers to a plot p will usually work > with "push!(p.layers, layer(...))", but that's kind of an unofficial > solution. >
[julia-users] Re: Gadfly: adding plots to an existing plot
It's not really supported. Adding a "push!" function to add layers to plots was proposed (https://github.com/dcjones/Gadfly.jl/issues/332), but I haven't done so yet. In fact, adding layers to a plot p will usually work with "push!(p.layers, layer(...))", but that's kind of an unofficial solution. On Wednesday, December 31, 2014 12:26:49 AM UTC-8, AVF wrote: > > So, if I created a plot in a block of code, and then want to add another > array of data to it in another block of code, is that possible? (I.e., I > find it inconvenient that I have only one chance to plot all the layers... > or did I misunderstand how it works?) >
[julia-users] Re: Gadfly: adding plots to an existing plot
So, if I created a plot in a block of code, and then want to add another array of data to it in another block of code, is that possible? (I.e., I find it inconvenient that I have only one chance to plot all the layers... or did I misunderstand how it works?)
[julia-users] Re: Gadfly: adding plots to an existing plot
Right, it works. Thanks ! Le mardi 10 juin 2014 12:13:46 UTC+2, Johan Sigfrids a écrit : > > I think you can do it with: layer(..., Theme(default_color=color("red"))) > > On Tuesday, June 10, 2014 12:56:19 PM UTC+3, Stéphane Laurent wrote: >> >> Mmm no really need in fact, it's easy with layer(). >> However I don't find how to control the color of a layer ? >> >> >> Le mardi 10 juin 2014 11:00:04 UTC+2, Stéphane Laurent a écrit : >>> >>> Hello is there something in Gadfly like the geom_abline() function in >>> the ggplot2 R package to add a single line to an existing plot ? >>> >>
[julia-users] Re: Gadfly: adding plots to an existing plot
I think you can do it with: layer(..., Theme(default_color=color("red"))) On Tuesday, June 10, 2014 12:56:19 PM UTC+3, Stéphane Laurent wrote: > > Mmm no really need in fact, it's easy with layer(). > However I don't find how to control the color of a layer ? > > > Le mardi 10 juin 2014 11:00:04 UTC+2, Stéphane Laurent a écrit : >> >> Hello is there something in Gadfly like the geom_abline() function in the >> ggplot2 R package to add a single line to an existing plot ? >> >
[julia-users] Re: Gadfly: adding plots to an existing plot
Mmm no really need in fact, it's easy with layer(). However I don't find how to control the color of a layer ? Le mardi 10 juin 2014 11:00:04 UTC+2, Stéphane Laurent a écrit : > > Hello is there something in Gadfly like the geom_abline() function in the > ggplot2 R package to add a single line to an existing plot ? >
[julia-users] Re: Gadfly: adding plots to an existing plot
Hello is there something in Gadfly like the geom_abline() function in the ggplot2 R package to add a single line to an existing plot ?