Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
BridgingBot
@GitterIRCbot
[slack] <Peter J> ah sorry. I suggest you post on discourse and open an issue in Plots.jl, you will get more attention there.
BridgingBot
@GitterIRCbot
[slack] <niklas.korsbo> Hello,
is there some simple way of just increasing the resolution of a png image when created with the pgfplotsx() backend? dpi does not seem to work and if I increase size then I get tiny labels, etc.
[slack] <niklas.korsbo> aah, maybe Plots.scalefontsizes() could come to the rescue!
[slack] <kristofferc> There is a dpi option in PGFPlotxX at least, maybe the option from Plots is not passed to it? Or it doesn't work correctly..
[slack] <niklas.korsbo> It seems pretty dead to me right now but I'm stuck in a slightly old env that breaks when I update it so I don't know if it has already been fixed.
BridgingBot
@GitterIRCbot
[slack] <Peter J> Usually I export to a vector graphics format and then scale appropriately.
BridgingBot
@GitterIRCbot
[slack] <niklas.korsbo> hehe, this was a bit hacky but it worked:
using PGFPlotsX pgfsave("test.png", plot!().o.the_plot, dpi=600)
BridgingBot
@GitterIRCbot
[slack] <niklas.korsbo> Thanks for the suggestions!
BridgingBot
@GitterIRCbot
[slack] <briochemc> Am I missing something with the number of bins here?: https://files.slack.com/files-pri/T68168MUP-F01QN62BQ72/download/screen_shot_2021-03-03_at_12.19.26_pm.png
[slack] <Moelf> randn(100) or rand(100) .* 10
[slack] <Moelf> some bug is going on here that it doesn't like when bins are too close to each other or something
[slack] <Moelf> if you try my example you will know bins=4 functions in most normal cases
[slack] <briochemc> Yes I get that it works in other cases, I'm just surprised it does not here in the very simple case
[slack] <Moelf> julia> fit(Histogram, rand(100); nbins=4) Histogram{Int64, 1, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}}} edges: 0.0:0.5:1.0 weights: [61, 39] closed: left isdensity: false
[slack] <Moelf> looks like a bug in StatsBase?
BridgingBot
@GitterIRCbot
[slack] <Moelf> nbins=10 works though
[slack] <briochemc> BTW I can fail your examples too:
[slack] <Moelf> yeah please file an issue in StatsBase
[slack] <Moelf> I think nbins=4 is just broken
[slack] <briochemc> no but I just showed you nbins=19
[slack] <Moelf> julia> fit(Histogram, randn(100); nbins=19) Histogram{Int64, 1, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}}} edges: -4.0:0.5:3.0 weights: [1, 1, 0, 1, 5, 6, 19, 16, 13, 11, 19, 5, 2, 1] closed: left isdensity: false
[slack] <Moelf> again, StatsBase's behavior
[slack] <Moelf> will you file an issue? I can take a look soon
[slack] <Moelf> > nbins: if no edges argument is supplied, the approximate number of bins to use along each dimension (can be either a single integer, or a tuple of integers).
[slack] <briochemc> JuliaStats/StatsBase.jl#410
[slack] <Moelf> technically, this is documented. keyword being approximate
[slack] <briochemc> Already this one
BridgingBot
@GitterIRCbot
[slack] <briochemc> I guess it is documented in Plots as approximate too
[slack] <briochemc> OK thanks
[slack] <Moelf> you can always do:
histogram(rand(10), bins=range(0,1; length=4+1))
BridgingBot
@GitterIRCbot
[slack] <briochemc> I know I was just surprised that the supplied bins number is used as an indication and not enforced
BridgingBot
@GitterIRCbot
[slack] <dalarev> Hey everybody, which plot type would be best to generate the image attached? Tried bar but all bars start at the axis. Looked into boxplot but I don't think this will do it. I will need to create separate bars for any one category (e.g., see m1 in image). Stacked bar plot looks close, but I don't think it's quite it. Appreciate the help!: https://files.slack.com/files-pri/T68168MUP-F01Q6VCU9FD/download/image.png
BridgingBot
@GitterIRCbot
[slack] <loki._.> I would probably use Shape s
BridgingBot
@GitterIRCbot
[slack] <dalarev> Thought so. Thanks!
BridgingBot
@GitterIRCbot

[slack] <Misha Mikhasenko> ```@recipe function f(dx::Tuple, dy::Tuple)
box = Shape(
[dx[1], dx[1], dx[2], dx[2], dx[1]],
[dy[1], dy[2], dy[2], dy[1], dy[1]]
)
(box,)
end

plot()
plot!((1,2), (2,4), c=:red)
plot!((2,3), (6,8), c=:green) ```

BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> should work.
Working with recipes might easier
[slack] <dalarev> Yup, this works! Also a nice way for me to learn what recipes do and how to use them. Much appreciated!
[slack] <Misha Mikhasenko> guys, is there a simple way to remove padding between minimal value of the y axis and zero?: https://files.slack.com/files-pri/T68168MUP-F01Q6VC1FUJ/download/image.png
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> I do not want to specify ylims, just remove the shift
[slack] <Moelf> what's the different between setting ylims and "just remove the shift"? aren't the result identical?
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> Wooow, I did not know this trick
[slack] <Misha Mikhasenko> 🔥
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> Cannot figure out how to to italic capital greek letters with Plots (gr)
https://tex.stackexchange.com/questions/87238/greek-letters-in-italic-in-math-equation
Any thoughts?
thanks
BridgingBot
@GitterIRCbot
[slack] <sverek> if ok to switch backend you can do it with PGFPlotsX

[slack] <sverek> ```julia> pgfplotsx()
Plots.PGFPlotsXBackend()

julia> push!(Plots.PGFPlotsX.CUSTOM_PREAMBLE, raw"\usepackage{amsmath}")
1-element Vector{String}:
"\usepackage{amsmath}"

julia> plot(xlabel=L"\mathit{\Pi}")```

[slack] <sverek> this is using LaTeXStrings too
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> oh, wow. Since when? I used to like auto in Mathematica and missed it a lot in Julia
Great that it is there!