Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 08 22:28
  • Apr 08 22:27
    cata0309 starred JuliaPlots/PlotDocs.jl
  • Apr 08 18:42
    mlwn-00 commented #233
  • Apr 08 17:00
    BeastyBlacksmith commented #434
  • Apr 08 15:59
    nilshg commented #434
  • Apr 08 14:54
    BeastyBlacksmith commented #233
  • Apr 08 14:52
    BeastyBlacksmith commented #434
  • Apr 08 14:51
    BeastyBlacksmith commented #434
  • Apr 08 14:51
    BeastyBlacksmith commented #434
  • Apr 08 10:25
    nilshg commented #434
  • Apr 08 07:02
    BeastyBlacksmith commented #434
  • Apr 07 13:15
    JontySinai commented #67
  • Apr 07 13:15
    JontySinai commented #67
  • Apr 07 00:42
    mlwn-00 opened #233
  • Apr 07 00:38
  • Apr 04 04:59
    bicepjai commented #198
  • Apr 01 20:40
    naccib opened #435
  • Apr 01 18:04

    daschw on master

    modify install doc Merge branch 'master' into mast… Merge pull request #231 from uc… (compare)

  • Apr 01 18:04
    daschw closed #231
  • Apr 01 18:04
    daschw synchronize #231
BridgingBot
@GitterIRCbot
[slack] <dpsanders> What’s the correct way to plot a dictionary of frequencies?
[slack] <dpsanders> Such that I can use plot and the lines will look right.
[slack] <jling> do you mean like a dictionary with freq => intensity and you want to plot intensity like bars with x at freq?
BridgingBot
@GitterIRCbot
[slack] <dpsanders> yes
[slack] <dpsanders> well I mean value => frequency
[slack] <dpsanders> as in 1 => 17 if the number 1 occurs 17 times

[slack] <dpsanders> You can do

     ks = collect(keys(frequencies))
     vs = collect(values(frequencies))

     p = sortperm(ks)

     plot(ks[p], vs[p], m=:o)
 end

but that is… pretty complicated

[slack] <jling> I don't see a good way, but you can just loop over pairs and bar! maybe
BridgingBot
@GitterIRCbot
[slack] <jling> incidentally, if your Dict was a histogram, you can plot that directly 😉
[slack] <jling> actually, my bad, plot can handle Dict directly
[slack] <dpsanders> It can “handle” it but not in the correct order order, so the lines are random
[slack] <dpsanders> That’s why I need to sort them in the code above
[slack] <jling> oh I see, you want a line-shape instead of scatter/bars
[slack] <dpsanders> right, it works with scatter and bars
[slack] <dpsanders> but that is not plot 😉
[slack] <dpsanders> Basically we need a plot recipe for Dicts
[slack] <jling> weeeel, plot(.... st=:scatter)
[slack] <jling> but I get your point
[slack] <dpsanders> or countmap should return a special CountMap type
BridgingBot
@GitterIRCbot
[slack] <jling> ah, ok

[slack] <jling> ```julia> a = SortedDict(x=>rand() for x = 1:10)
SortedDict{Any,Any,Base.Order.ForwardOrdering} with 10 entries:
1 => 0.305353
2 => 0.042019
3 => 0.507064
4 => 0.677382
5 => 0.523015
6 => 0.0424785
7 => 0.942855
8 => 0.519996
9 => 0.487269
10 => 0.328405

julia> plot(a)```

[slack] <jling> SortedDict from DataStructures.jl
[slack] <dpsanders> OK that seems like a good solution, thanks!
BridgingBot
@GitterIRCbot
[slack] <jling> (looks like you can convert a Dict (generally any itr ) and it will be sorted automatically)
BridgingBot
@GitterIRCbot
[slack] <mkborregaard> Hi @dpsanders no doubt Plots needs a recipe for this. Which is essentially the code you already wrote
[slack] <mkborregaard> or maybe this is easier to read than your code at the top of the thread?
ks = sort!(collect(keys(frequencies))) plot(ks, [frequencies[k] for k in ks])
[slack] <jling> I tried to find that recipe (for Dict) but failed, where are the recipe now?
[slack] <mkborregaard> yeah I also felt like there was one already
[slack] <mkborregaard> but otherwise there shudl be
[slack] <dpsanders> how would you go about finding where that was? Just @which?
[slack] <jling> no, it's really convoluted
[slack] <jling> basically I was trying to find where the code from: JuliaPlots/Plots.jl#2133 is moved to
Alberto Lusiani
@alusiani

hspan!() has an odd behaviour in Plots v1.6.6, instead of plotting from -Inf to +Inf over x it plots from 1 to 2. Minimum example

julia> plot(0:9)
julia> hspan!([2,3])

I am surprised to see this definition, that seems plain wrong

@recipe function f(::Type{Val{:hspan}}, x, y, z)
    n = div(length(y), 2)
    newx = repeat([1, 2, 2, 1, NaN], outer = n)
    newy = vcat([[y[2i - 1], y[2i - 1], y[2i], y[2i], NaN] for i = 1:n]...)
    linewidth --> 0
    x := newx
    y := newy
    seriestype := :shape
    ()
end

I think that using Inf similarly to vspan would fix this issue

@recipe function f(::Type{Val{:vspan}}, x, y, z)
    n = div(length(y), 2)
    newx = vcat([[y[2i - 1], y[2i - 1], y[2i], y[2i], NaN] for i = 1:n]...)
    newy = repeat([-Inf, Inf, Inf, -Inf, NaN], outer = n)
    linewidth --> 0
    x := newx
    y := newy
    seriestype := :shape
    ()
end
Greg Werner
@jgwerner
Apologies for taking so long to respond, but after more testing, the solution was fixed by locking the Plots package to v1.5.3 and using the GR backend. The solution works well in any Plots version with one color, but only works well with 1.5.3 when using a color gradient. This is consistent regardless of whether we use Py3.7 / Py3.8 with the Conda distribution or the standard Python distribution with Ubuntu. We also tested using the standard docker build-deps Python debian-based image with no vCPU / Mem limits on a standard Ec2 Ubuntu Bionic instance with 8 cores and 32 Gb mem.
Frederico
@sunbubble
Hello there, how do I set the aspect_ratio of the axes of a 3d plot? I'm using the plotly backend
doing aspect_ratio=:equal doesn't seem to work
BridgingBot
@GitterIRCbot

[slack] <rveltz> Hi,

I would like to do a isosurface in GR. So far so good but:
• how can I specify the number of levels? (levels = 3?
• how can I zoom out (I see rotation, tilt but not the radius
Thank you a lot for your help

Josef Heinen
@jheinen
Are you using plain GR or the gr backend in Plots?
In plain GR, you can only specify an isovalue (= threshold)
BridgingBot
@GitterIRCbot
[slack] <rveltz> I am using GR
[slack] <rveltz> but how can you zoom out?
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> Are there any dirty hacks to put the cross of errorbar to the legend?: https://files.slack.com/files-pri/T68168MUP-F01C10U9WER/download/image.png
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> Are there any hacks to put the cross of errorbar to the legend with Plots/pyplot?
BridgingBot
@GitterIRCbot

[slack] <nils.gudat> I guess you could scatter with a cross marker and just put it outside the bounds of the visible area? Example:

```julia> scatter(rand(10))

julia> scatter!([0],[-1], marker = :cross, label = "Standard error", ylim = (0.0,1.0), color = "black")```

BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> good idea. althogh looks a bit different: https://files.slack.com/files-pri/T68168MUP-F01CUAVSX32/download/image.png
[slack] <Misha Mikhasenko> good idea. although looks a bit different
[slack] <Misha Mikhasenko> :+ does pretty well
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> It is so annoying to open the picutre in inkscape and manually modify 😩