by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 07 02:09
  • Jul 07 01:44
    OnlywWan starred JuliaPlots/RecipesBase.jl
  • Jul 06 13:59
    PallHaraldsson commented #354
  • Jul 06 13:25

    daschw on master

    Relax, allow all Plots.jl 1.x … Merge pull request #354 from Pa… (compare)

  • Jul 06 13:25
    daschw closed #354
  • Jul 06 13:25
    daschw commented #354
  • Jul 06 13:05
    PallHaraldsson opened #354
  • Jul 04 10:12
    danielw2904 starred JuliaPlots/StatsPlots.jl
  • Jul 02 19:07
    oxinabox commented #133
  • Jul 02 15:13
  • Jul 02 08:44
    JackDevine commented #133
  • Jul 01 18:37
    oxinabox opened #133
  • Jun 30 22:22

    daschw on master

    update compathelper config add github actions ci remove travis and 3 more (compare)

  • Jun 30 22:03
    daschw synchronize #98
  • Jun 30 22:00
    daschw synchronize #98
  • Jun 30 21:13
    daschw opened #98
  • Jun 30 20:58
    joergbuchwald commented #263
  • Jun 30 20:55
    daschw closed #353
  • Jun 30 20:55

    daschw on master

    better fillrange in groupedbar … Merge pull request #353 from Mo… (compare)

BridgingBot
@GitterIRCbot
[slack] <daschw> Exactly
BridgingBot
@GitterIRCbot
[slack] <oxinabox> I can define this as a Integer Programming problem and solve it with JuMP.
BridgingBot
@GitterIRCbot
[slack] <daschw> I am not sure if Jack Devine, who is the maintainer of GraphRecipes, is on slack. So maybe a GitHub issue would be more promising.
BridgingBot
@GitterIRCbot
[slack] <daschw> Maybe somehow related: I recently wrote a recipe for sankey plots and I am not very happy with the positioning of the nodes either. I was also thinking about using JuMP for calculating the layout.: https://files.slack.com/files-pri/T68168MUP-F0165MWSMTP/download/sankey.png
BridgingBot
@GitterIRCbot
[slack] <oxinabox> Woah though. Where is that Sankey Recipe? I needed one of those as was going to use Rcall for it
[slack] <oxinabox> The layout I want and the layout for sankey should be the same I think
[slack] <daschw> Nowhere online yet, I wrote it for a colleague and wanted to improve the layout before putting it somewhere online.
BridgingBot
@GitterIRCbot
[slack] <daschw> That's what I have so far. Maybe this could be done in an easier way.: https://files.slack.com/files-pri/T68168MUP-F0165NWC7SR/download/sankey.jl
BridgingBot
@GitterIRCbot

[slack] <oxinabox> The constrained optimization problem i am thinking for laying out DAGs (which is both Pert charts and I htink Sankey diagrams)

Every node has an X and a Y coord, that are Integer variables.

Every root node is constrained to have X[i] = 0
for every link from node i to node j
we add the constraint that X[i] < X[j]
so it has to be to the right of its partent,
and we add into the objective being minimized:
+ (X[i] - X[j])^2 + (Y[i] - Y[j])^2
which should mean it tries to put things close together.
In particular that should mean that if there is a connection between only 2 nodes then they are places one right of the other.

Then we just need to stop it putting two things in the same place.
Expressing that is harder,
I think what have to do is have a Integery matrix for all possible positions.
And then constrain it so that all elements are <=2
But that means having to reformulate all the earlier constraints in terms of X and Y to be in termsof this matrix somehow, which seems hard.
But this is like a classic scheduling MIP problem of filling slots, and I know i have written those before…

BridgingBot
@GitterIRCbot
[slack] <TheCedarPrince> Not sure if this is a feature, but I know with Julia, just about anything is possible. Can you draw angle measurements between two lines or vectors? Something that looks like this with theta being replaced by an actual degree measurement?: https://files.slack.com/files-pri/T68168MUP-F016XLPNUKA/download/image.png
BridgingBot
@GitterIRCbot
[slack] <oxinabox> I did make a QP based DAG layout algorith,
oxinabox/ProjectManagement.jl#8
[slack] <oxinabox> it worked out pretty well
BridgingBot
@GitterIRCbot
[slack] <asinghvi17> You could draw and fill a Plots.partialcircle
BridgingBot
@GitterIRCbot

[slack] <eirikeb> I want to draw a contour at some levels, specified using levels=[1.0] or something, and then fill areas withing those levels. I did the following:
```using Plots

A = [ix/2 - (ix -5)^2 + 2*iy for ix=1:10, iy=1:10] # Matrix with an expanding ridge in the middle

Want a plot that fills the positive area

p1 = contour(A,levels=[0.0]) # Perfect, only need to fill it
p2 = contourf(A,levels=[0.0]) # Not what I wanted/expected :(
plot(p1,p2) # How can I fill p1```
What am I missing here? I tried google but couldn't find anything :(

BridgingBot
@GitterIRCbot
[slack] <daschw> contourf(A,levels=[-20, 0, 20], clims = (-20, 20))
Is this what you are looking for?

[slack] <daschw> or maybe

    A,
    levels = [-20, 0, 20],
    clims = (-20, 20),
    color = cgrad([:white, :red]),
    colorbar = false,
)

unfortunately we do not support different alpha values for color gradients

BridgingBot
@GitterIRCbot
[slack] <anandj> anyone have plots working using the windows subsystem for linux? i have seen posts on discourse + elsewhere about an X server, but i don't know what to do really
[slack] <anandj> i'm able to plot just using VSCode, but i mean using the windows terminal
BridgingBot
@GitterIRCbot

[slack] <eirikeb> Well, almost! I want to specify a single level, say 0, and fill the area which is above/below this level with color. Like contour(A,levels=[0,0]) draws the outline just like I want it, but I need to fill it. Contourf(ill?)(A,levels=[0,0]) just draws normal contour lines, but with an added contour-line at the specified levels (I think). I want to specify which level(s) the lines are,

I have attached a picture.

I guess if I set clims(-epsilon,epsilon) that could work too, if I find a color scheme that starts at/ends at the colors I want.: https://files.slack.com/files-pri/T68168MUP-F015Z0R0DUP/download/screenshot_from_2020-07-01_15-50-41.png

BridgingBot
@GitterIRCbot
[slack] <daschw> Maybe you can achieve this, by manually calculating the contour lines with https://github.com/JuliaGeometry/Contour.jl and plotting them as filled shapes using Plots.
[slack] <daschw> Maybe we could also build a contour recipe for Plots based on Contour.jl that provides more flexibility than the backend implementations.
BridgingBot
@GitterIRCbot
[slack] <daschw> Nice, I think for sankey it's still a little more complex, though, because nodes and edges have different widths and edges (streams in the nomenclature of my uninformed implementation) can in general cross multiple layers of nodes. I have not managed to formulate a MIP problem solving this yet and I don't think I will have much time for this. Does sound like fun though. Looking at the implementation of sankey plots from e.g. Echarts or d3, they use some heuristic of iteratively relaxing the layout from left to right and right to left and resolving collisions, which I have not completely understood yet.
[slack] <oxinabox> Still sounds like layered DAG drawimg
[slack] <oxinabox> DAGs can cross layers line b->g and a->f, and a->f in the image in the PR
BridgingBot
@GitterIRCbot
[slack] <oxinabox> hopefully what I come up with in LayeredLayout.jl will be flexible enough to be useful to you
[slack] <daschw> Ah, you're right about the layers crossing, of course.
[slack] <daschw> That would be great!
[slack] <oxinabox> It think it will just sit at the same kinda deal as NetworkLayout.jl then GraphPlots.jl and GraphRecipes.jl and Sankey.jl can depend on it
BridgingBot
@GitterIRCbot

[slack] <eirikeb> I actually think the plot in the screenshot was generated by GR a year or two ago, if I can remember correctly. I was trying to find the code, that I used to generate it, but the code is lost on a server I don't have access to anymore :(

Anyways, I ended up doing:
level = 0.0 #What ever desired level I want contourf(A,clims=(level-1e-15,level+1e-15))
This works pretty well:: https://files.slack.com/files-pri/T68168MUP-F016LCJTL3E/download/screenshot_from_2020-07-01_21-19-30.png

[slack] <eirikeb> I actually think the plot in the screenshot was generated by GR a year or two ago, if I can remember correctly. I was trying to find the code, that I used to generate it, but the code is lost on a server I don't have access to anymore :(

Anyways, I ended up doing:
level = 0.0 #What ever desired level I want contourf(A,clims=(level-1e-15,level+1e-15))
This works very well, but feels contrived!

Kaj Wiik
@KajWiik
Is it possible to do 'touching subplots' with Plots like in https://gist.github.com/gizmaa/7214002#subplots (PyPlot, third example)?
BridgingBot
@GitterIRCbot
[slack] <daschw> No
BridgingBot
@GitterIRCbot
[slack] <isentropic> Perhaps you could try doing 3 stacked layout as usual, then supply negative margins to make them overlap
[slack] <isentropic> To make the 'touch' rather
Kaj Wiik
@KajWiik
Yes, I have tried that and while it sort of works, it's quite kludgy... Would it be possible to give the user a way to define the relative plot surface like in matplotlib? https://matplotlib.org/api/axes_api.html
Kaj Wiik
@KajWiik
Axes(fig, rect,...), rect[left, bottom, width, height]
BridgingBot
@GitterIRCbot
[slack] <isentropic> vastly depends on backendyeah you can get it
[slack] <isentropic> its name is plot area Plots.plotarea(p.subplots[1]) would return the actual box where plot gouse
BridgingBot
@GitterIRCbot
[slack] <isentropic> be careful not to plot with p, rather use display, or else Plots would recalculate what it thinks are the best margins
BridgingBot
@GitterIRCbot
[slack] <anandj> http://docs.juliaplots.org/latest/generated/attributes_series/ table not viewable w dark mode on, this might have already been pointed out tho
BridgingBot
@GitterIRCbot
[slack] <isentropic> Yeah you are right, would you mind dropping an issue in PlotDocs?
Fabricio Oliveira
@FabsOliveira
Hi everyone. Hopefully anyone can help me this. I am trying to get a contours plots with they level values. Using GR and the code below, the lines become black if you uncomment contour_labels = true. The whole thing breaks if I try to use PyPlot. I am using Plots version 1.5.3 and PyPlot 2.9.0
using Plots
gr()

n = 500

x1 = range(-1, stop=10, length=n);
x2 = range(-1, stop=10, length=n);

f(x) = (x[1])^2 + (x[2])^2
z = [f([x1[i], x2[j]]) for j = 1:n for i = 1:n];

contour(x1,x2,z,
      levels = [4, 8, 12, 16],
      xaxis = ("x₁", (0,4), (0:1:10)),
      yaxis = ("x₂", (0,4)),
      clims = (1,15),
      # contour_labels = true,
      aspect_ratio = :equal
)

This is the error I get when I try PyPlot as the backend:

type Array has no field surfgetproperty(::Array{Float64,1}, ::Symbol) at Base.jl:33
py_add_series(::Plots.Plot{Plots.PyPlotBackend}, ::Plots.Series) at pyplot.jl:629
_before_layout_calcs(::Plots.Plot{Plots.PyPlotBackend}) at pyplot.jl:947
prepare_output(::Plots.Plot{Plots.PyPlotBackend}) at plot.jl:177
showjuno(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.PyPlotBackend}) at output.jl:258
show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.PyPlotBackend}) at output.jl:212
show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::String, ::Plots.Plot{Plots.PyPlotBackend}) at multimedia.jl:109
displayinplotpane(::Plots.Plot{Plots.PyPlotBackend}) at showdisplay.jl:67
displayandrender(::Plots.Plot{Plots.PyPlotBackend}) at showdisplay.jl:131
(::Atom.var”#208#213"{String})() at eval.jl:136
#invokelatest#1 at essentials.jl:712 [inlined]
invokelatest at essentials.jl:711 [inlined]
macro expansion at dynamic.jl:24 [inlined]
eval(::String, ::Int64, ::String, ::String, ::Bool) at eval.jl:113
invokelatest(::Any, ::Any, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at essentials.jl:712
invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at essentials.jl:711
macro expansion at eval.jl:41 [inlined]
(::Atom.var”#188#189")() at task.jl:358

BridgingBot
@GitterIRCbot
[slack] <ignacio.quintero> New to Plots.jl , but if I call the plot or plot! functions within a function it does not even open de viewer. I'm recursively iterating over a tree to plot each edge using plot! but nothing appears unless I do it manually on one by one.
BridgingBot
@GitterIRCbot
[slack] <Lucy Henley> Wondering if there's an option to make a 2d histogram with a polar projection? I've tried with histogram2d(θ,r,proj = :polar, m = 2) , but I get this error InexactError: trunc(Int32, NaN) . I don't get this when using scatter with the same inputs, so I assume it's just not an option?
BridgingBot
@GitterIRCbot
This message was deleted
BridgingBot
@GitterIRCbot
[slack] <Lucy Henley> Yes, that's exactly what I want it to look like, can only seem to find examples with heatmap and not histograms though
[slack] <Lucy Henley> Oh, it seems to work for a different set of theta and r values, I guess it's something wrong with my data then
BridgingBot
@GitterIRCbot
[slack] <Lucy Henley> Really can't figure this one out... it plots fine with scatter, I'm assuming the histogram2d is trying to round the round the values somehow?