Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    kojix2
    @kojix2
    image.png
    kojix2
    @kojix2
    Wow, there are a lot of Rubyists here... :open_mouth:
    kojix2
    @kojix2
    I like Julia too!
    kojix2
    @kojix2
    Maybe it's my mistake. I'll check it out.
    kojix2
    @kojix2
    My gridit usage was not good. I'll study harder. Thanks.
    kojix2
    @kojix2
    image.png
    I surfaceplot cancer genome data from cBioPortal. It may not make much sense academically, but it looks very beautiful.
    Thank you for your Great GR Framework!
    Josef Heinen
    @jheinen
    :smile:
    Petr Krysl
    @PetrKryslUCSD
    How do I set aspect ratio to give the same scaling along the three axes of a three-dimensional plot? Thanks.
    kojix2
    @kojix2
    How do I use the function named meta?
    I just tried GR.openmeta()
    and got an error.
    cannot connect to host localhost port 8002: 接続を拒否されました
    Ptr{Nothing} @0x0000000000000000
    "接続を拒否されました" means "Your connection has been denied."
    Josef Heinen
    @jheinen
    The meta feature is still WIP and the underlying API is subject to change. Please do not use the meta layer until it's finished (and documented)
    kojix2
    @kojix2
    Thnaks. I'm looking forward to it.
    kojix2
    @kojix2
    But what these meta functions will do? Could you tell me?
    Josef Heinen
    @jheinen
    It's described here (see slides 7, 8)
    kojix2
    @kojix2
    Thank you! I read the slide.
    kojix2
    @kojix2
    I see. Interactive visualization for browsers, especially for Jupyter notebooks!
    zaz1588
    @zaz1588
    hi, I ran the example from GR
    # Create example point data x = 8 .* rand(100) .- 4 y = 8 .* rand(100) .- 4 z = sin.(x) + cos.(y) using GR p=tricont(x, y, z)
    and I need the coordinates of the countourlines. Is it possible to get them?
    Josef Heinen
    @jheinen
    @zaz1588 Right now, the contour lines are calculated internally and can't be accessed from the (Julia) REPL.
    zaz1588
    @zaz1588
    ok. thanks
    Viktor Petukhov
    @VPetukhov

    Hi! I'm trying to plot a thin line and save it as a png, but looks like with png GR has restriction for minimal thickness.
    Code below produces the same result for any linewidth <= 1.0.

    GR.beginprint("test_gr.png")
    GR.setlinewidth(0.01)
    GR.polyline(x, y)
    GR.show()
    GR.endprint()

    Though the line is definitely thicker than 1 pixel. If I save it to svg, everything works well. Is there any way to fix this?
    I was trying to use Ghostscript plugin by adding ENV["GKS_USE_GS_PNG"] = 1, but it fails with "Ghostscript support not compiled in".

    Josef Heinen
    @jheinen
    Thanks for the hint. This is a bug in the GR Cairo plugin. I will fix it ASAP ...
    Josef Heinen
    @jheinen
    The problem ist fixed in GR#master - a MR is on the way ...
    Viktor Petukhov
    @VPetukhov
    Wow, it would save me a whole lot of time for transition to pyplot. Thank you for the fast reaction, @jheinen! However, I tried the latest master commit (jheinen/GR.jl@3c81a12), and the problem is still there. Not sure if it's the right one though, as it only adds setspace3d function.
    Josef Heinen
    @jheinen
    You will have to update the run-time: ENV["GRDIR"]=""; ] build GR
    Viktor Petukhov
    @VPetukhov
    Indeed, it works now perfectly. Thank you so much!
    ak202
    @ak202
    Hi, great work on this, but i'm just curious if there is any way to automatically resize output to fit the dimensions of the Qt window? This exists to at least some extent already, but it looks like the plot gets fit into a perfect square and then that square is what gets resized.
    Josef Heinen
    @jheinen
    GR keeps the aspect ratio. If you want to use the full Qt window, you will have to set both the workstation viewport and the workstation window (as in examples\qml_ex.jl)
    ak202
    @ak202
    I guess I was asking two questions without realizing it, sorry. One thing I was interested in is having the aspect ratio of the plot change automatically, and I'll look into your example if I have time to play around with that. Thanks!
    The second question is how to fill the window even when keeping the aspect ratio. This seems to work correctly if the plot is a perfect square i.e. size = (500, 500), but taller/wider rectangles will not fill the window even in a way that would preserve the aspect ratio. The more extreme the ratio, the smaller the plot is.
    ak202
    @ak202
    For example, if I have a landscape oriented window and have size = (500,500), it will fill vertically but not horizontally as one would expect, but then increasing the width variable will not increase the plot's width but instead decreases its height (also font size), which can create a lot of blank space
    Josef Heinen
    @jheinen
    I understand what you intend to do - it's possible with GR but I should probably find a more convenient way to chose it ...
    xinzhicaishu
    @xinzhicaishu
    Hi, I'm a newer in Julia, so the question below may somewhat stupid, my question is, is there a convenient way to set custom colormaps in contour plotting?
    photor
    @photor

    How do I set aspect ratio to give the same scaling along the three axes of a three-dimensional plot? Thanks.

    I have the same question, any answers? Thanks.

    Sebastian Skejø
    @sebastianskejoe
    Hi! I'm having some problems with the padding around axis labels when using plots.jl and non-default plot size, which I pretty sure comes down to a miscalculation of the label dimensions. However, to propose a fix, I first need to understand how the padding is computed and to do that I first need to understand what gr_inqtext() returns. I don't think the documentation mentions it and it's not immediately clear to me from reading the c-code.
    Josef Heinen
    @jheinen
    This example demonstrates how inqtext works:
    using GR
    
    selntran(0)
    
    settextfontprec(232, 3)
    settextalign(2, 3)
    chh = 0.072
    
    for phi in LinRange(0, 2pi, 360)
        clearws()
        setcharheight(chh)
        setcharup(sin(phi), cos(phi))
        text(0.5, 0.5, "Hello World")
        tbx, tby = inqtext(0.5, 0.5, "Hello World")
        fillarea(tbx, tby)
        updatews()
    end
    There is a similar example for LaTeX math formulas in the GR.jl repo. See here.
    Josef Heinen
    @jheinen
    You don't have to care about alignment. See this code snippet:
    using GR
    
    hor_align = Dict("Left" => 1, "Center" => 2, "Right" => 3)
    vert_align = Dict("Top" => 1, "Cap" => 2, "Half" => 3, "Base" => 4, "Bottom" => 5)
    
    selntran(0)
    setcharheight(0.024)
    
    for angle in 0:360
    
      setcharup(sin(-angle * pi/180), cos(-angle * pi/180))
      setmarkertype(2)
      clearws()
    
      for halign in keys(hor_align)
        for valign in keys(vert_align)
          settextalign(hor_align[halign], vert_align[valign])
          x = -0.1 + hor_align[halign] * 0.3;
          y = 1.1 - vert_align[valign] * 0.2;
          s = halign * "\n" * valign * "\n" * "third line"
          polymarker([x], [y])
          text(x, y, s)
          tbx, tby = inqtext(x, y, s)
          fillarea(tbx, tby)
        end
      end
    
      updatews()
    end
    Sebastian Skejø
    @sebastianskejoe
    Thanks! And tbx and tby are given as percentages of the window, right?
    Sebastian Skejø
    @sebastianskejoe
    Any idea why plot(rand(100), size=(600,400)) and plot(rand(100), size=(300,400)) gives different tby? I don't see why changing the x-size would affect the y-size of the text.
    Josef Heinen
    @jheinen
    All viewport limits (and text or marker heights) are internally handled as normalized device coordinates. Otherwise, text rotation/scaling or window resize operations would not be consistent (on different output devices).