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] <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 😩
BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> Is there a way to change the series order in the Plot{Plots.PyPlotBackend() n=9} object?
[slack] <Misha Mikhasenko> ```p = make_myplot() # Plot{Plots.PyPlotBackend() n=9}
pp = p[1] # Subplot{1}
plot(pp)

ERROR: Cannot convert Plots.Series to series data for plotting```

BridgingBot
@GitterIRCbot
[slack] <Misha Mikhasenko> I have two plot and would like to add a line (one series) from the first plot to the lowest layer of the second plot.
p1 = make_first_plot() p2 = make_second_plot() plot(p1[1][1][:x], p1[1][1][:y], lab="model") plot!(sp=1, p2) # replace p1 plot!(sp=1, p2) # also replace p1
BridgingBot
@GitterIRCbot
[slack] <loki._.> A user recipe can take arbitrary keyword arguments and process these
BridgingBot
@GitterIRCbot
[slack] <nils.gudat> So should I basically have one big
@recipe function f(s::MyStruct; type = "main_results") if type == "main_results" [first type of plot] elseif type == "uncertainty" [second type of plot] end end
?
BridgingBot
@GitterIRCbot
[slack] <nils.gudat> Seems to do the trick!
BridgingBot
@GitterIRCbot
[slack] <mkborregaard> or define a seriestype
[slack] <mkborregaard> given that you are not using dispatch anyway
Grigory Starkov
@Gregstrq
Hi. I have a question about 3d plots. How do I make the ticks and labels for the 'z'-axis to be drawn on the left instead of on the right? I am trying to do it with it pyplot backend.
gideonsimpson
@gideonsimpson
hi, i have a problem that the tick labels on my color bar are partially cut off because i used larger font sizes. how can I extend the figure size so they're fully rendered?
BridgingBot
@GitterIRCbot
[slack] <loki._.> you can set the figure size with size = ( width, height )
BridgingBot
@GitterIRCbot
[slack] <daschw> Or you could increase the margin, like e.g bottom_margin = http://5Plots.mm , you have to find the value and unit that fits your needs.
BridgingBot
@GitterIRCbot
This message was deleted
Roman Bange
@rbange
hey guys, any idea on how to decrease the padding between multiple subplots in a layout?
BerndR
@bernd1995
Hey guys, is it somehow possible to 'load' a previously created plot again into julia and retrieve data like x-, y- and z-components?
In particular I would be interested to do this for a *.html file created with the plotly-backend.
HelgavonLichtenstein
@HelgavonLichtenstein

Hello, how could I plot negative numbers with log10? I have

@df df_final_biomass_diff_array_fw_10_industry_high scatter(:body_mass_fw_1,:bio_diff_S33_1, xaxis = :log10, yaxis = log10.(:bio_diff_S33_1 .+ 10))
Which works, but then the yaxis disappears.

image.png
I am using Plots with Julia 1.5
Roman Bange
@rbange
@HelgavonLichtenstein obviously you cannot simply calculate the log10 of negative values, thats why Plots fails to do this
had the same issue a while ago
i modified my data by applying a log-modulus transformation beforehand https://blogs.sas.com/content/iml/2014/07/14/log-transformation-of-pos-neg.html
HelgavonLichtenstein
@HelgavonLichtenstein
Yes, I understand, but I try to make the values positive by adding 10 to the yaxis
A MWE
x = -10:0.01:10
y = x
plot(x, y)
plot(x, y, yaxis = log10.(y .+ 100))
It works, but the scale disappears from y
Roman Bange
@rbange
Ah i see
HelgavonLichtenstein
@HelgavonLichtenstein
I like this log-modulus transformation you shared
Roman Bange
@rbange
Its nice as you can boundlessly plot negative to positive values
I also tested the sample you shared, it does work as expected, but yaxis = log10.(y .+ 100) only yields values from 1.95 to 2.04 so its a straight line
Maybe the yaxis is displayed, but outside of the value space? Meaning y samples are distributed e.g. 0-100, but the yaxis is shown at e.g. y=300
HelgavonLichtenstein
@HelgavonLichtenstein
How do you change the value space?
Roman Bange
@rbange
Guess its fitted to the given data