Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Josef Heinen
    @jheinen
    The PNGs created by GR are transparent - so when you include it (ie.g. in any document) you will have to add a background (image or what ever).
    Sameer Deshmukh
    @v0dro
    Ah. So is there some method like set_facecolor in matplotlib for setting the background color of a particular Axes?
    Or maybe window?
    Rob J Goedman
    @goedman

    Hi, this morning GR was updated ( [28b8d3ca] ↑ GR v0.37.0 ⇒ v0.38.0 ) and since then I’m getting:

    using Plots
    gr(size=(500,500));
    plot(1:10)
    
    ERROR: error compiling _plot!: error compiling _display: could not load library "libGR.so"
    dlopen(libGR.so.dylib, 1): image not found
    Stacktrace:
     [1] #plot#136(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(plot), ::UnitRange{Int64}) at /Users/rob/.julia/packages/Plots/UQI78/src/plot.jl:57

    I did try Pkg.build(“GR”) but get:

    julia> Pkg.build("GR")
      Building GR → `~/.julia/packages/GR/R1wHp/deps/build.log`
    ┌ Error: Error building `GR`: 
    │   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    │                                  Dload  Upload   Total   Spent    Left  Speed
    100 66830    0 66830    0     0  89388      0 --:--:-- --:--:-- --:--:-- 89344
    │ tar: Unrecognized archive format
    │ tar: Error exit delayed from previous errors.
    │ [ Info: Downloading pre-compiled GR 0.38.0 Darwin binary
    │ ERROR: Error while loading expression starting at /Users/rob/.julia/packages/GR/R1wHp/deps/build.jl:63

    Any hints?

    Josef Heinen
    @jheinen
    There was a problem (change?) with the GitHub download link. We have fixed this in the meantime and tagged a new version, which hopefully will be merged soon.
    Sorry for the noise!
    Rob J Goedman
    @goedman
    Thank you, in the meantime ]rm GR and add GR@0.37.0 works for those who really can’t live without …
    Josef Heinen
    @jheinen
    ... or use GR#master
    Rob J Goedman
    @goedman

    Yip, better solution, I do see:

    Warning: No strict ticks found
    └ @ PlotUtils ~/.julia/packages/PlotUtils/GxT73/src/ticks.jl:173Warning: No strict ticks found
    └ @ PlotUtils ~/.julia/packages/PlotUtils/GxT73/src/ticks.jl:173Warning: No strict ticks found
    └ @ PlotUtils ~/.julia/packages/PlotUtils/GxT73/src/ticks.jl:173
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    ┌ Warning: No strict ticks found
    └ @ PlotUtils ~/.julia/packages/PlotUtils/GxT73/src/ticks.jl:173
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    ┌ Warning: No strict ticks found
    └ @ PlotUtils ~/.julia/packages/PlotUtils/GxT73/src/ticks.jl:173
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    ┌ Warning: No strict ticks found
    └ @ PlotUtils ~/.julia/packages/PlotUtils/GxT73/src/ticks.jl:173
    GKS: Rectangle definition is invalid in routine SET_WINDOW
    GKS: Rectangle definition is invalid in routine SET_WINDOW

    but plots look ok.

    Josef Heinen
    @jheinen
    This means that either xmin >= xmax or ymin >= ymax in the window specification. Do you have a MWE?
    Rob J Goedman
    @goedman
    Not really, I’ll keep my eyes open for several other places where I use GR.
    Josef Heinen
    @jheinen
    GR v0.38.1 is merged - the GR update(s) should work now
    Rob J Goedman
    @goedman
    Hmm, not sure if this solves the LibGR problem (on OSX at least). Earlier, with master, it seemed to work in the REPL but not in Jupiter. With 0.38.1 neither works. Just now I used v0.38.1 on Travis and it worked so maybe just on OSX? I tried both Julia v1.1 and v1.2-
    Josef Heinen
    @jheinen
    Please remove any GR folders (deps/downloads, deps/gr) and try again. With ENV["GRDIR"]=""; ] build GR you should also be able to force a rebuild including a "fresh" download of the GR run-time.
    Rob J Goedman
    @goedman
    That looks a whole lot better! Thanks a lot!
    Sameer Deshmukh
    @v0dro
    @jheinen is there a way of setting the width/height of the full output image? For example, say I want a PNG that is 200x200 pixels.
    Josef Heinen
    @jheinen
    You can set the width/height using figsize (in inch). Unfortunately, you cannot change the internal DPI setting (which is 600) - I will add a DPI keyword argument in a future release - so for now, a 200x200 pixel output can be achieved using figsize=(200,200)./600
    Sameer Deshmukh
    @v0dro
    Thank you!
    Sameer Deshmukh
    @v0dro
    @jheinen how can I draw a circle using GR? Could not find anything in the C library.
    Josef Heinen
    @jheinen
    using GR; drawarc(0,1,0,1,0,360)
    Sameer Deshmukh
    @v0dro
    @jheinen Also, is there any way of setting the fill opacity?
    Ah
    Thanks!
    Josef Heinen
    @jheinen
    GR.setfillintstyle(GR.INTSTYLE_SOLID)
    Sameer Deshmukh
    @v0dro
    IN that example I can only see RGB values being set. Where is the opacity parameter?
    Josef Heinen
    @jheinen
    GR.settransparency(alpha)
    Sameer Deshmukh
    @v0dro
    @jheinen is it possible to explicitly set the X/Y co-ordinates on the axes and not rely solely on the parameters passed to gr_axes?
    Alish Dipani
    @alishdipani

    Hello,

    I am trying to install GR library for C on Ubuntu 18.04, I followed the steps mentioned on the website here. This did not work and gave the error :
    foo.c:1:10: fatal error: gr.h: No such file or directory

    include <gr.h>

          ^~~~~~

    compilation terminated.

    I also tried source install from git mentioned here but it gives the same error.

    I also tried using GR prebuilt binaries using this command : gcc -L/home/alu57202/Downloads/gr/lib -I/home/alu57202/Downloads/gr/include -lGR foo.c
    This command recognizes gr but then gives the following error :
    /tmp/cckVLH59.o: In function main': foo.c:(.text+0xc0): undefined reference togr_polyline'
    foo.c:(.text+0xd5): undefined reference to gr_tick' foo.c:(.text+0xef): undefined reference togr_tick'
    foo.c:(.text+0x11f): undefined reference to `gr_axes'
    collect2: error: ld returned 1 exit status

    Can anyone help me regarding this?

    Thank You.

    Josef Heinen
    @jheinen
    cc -I/usr/local/gr/include foo.c -L/usr/local/gr/lib -lGR -Wl,-rpath,/usr/local/gr/lib - probably a candidate for an alias or script
    ... or should be explained in the documentation

    @v0dro :

    @jheinen is it possible to explicitly set the X/Y co-ordinates on the axes and not rely solely on the parameters passed to gr_axes?

    It's on our TODO list ...

    Alish Dipani
    @alishdipani
    cc -I/usr/local/gr/include foo.c -L/usr/local/gr/lib -lGR -Wl,-rpath,/usr/local/gr/lib - probably a candidate for an alias or script
    This works perfectly. Thank You.
    scuervo91
    @scuervo91
    Hi, Is there a way to have multiple X axis in Gr?
    Josef Heinen
    @jheinen
    With the low-level GR routines you can use/draw multiple X and/or Y axis. But you have to set the window/viewport information for each axis (pair).
    Sameer Deshmukh
    @v0dro
    @jheinen I can't find an easy way of setting the output image size in inches from the C API. Can you please point me in the right direction?
    Josef Heinen
    @jheinen
    You mean for a PNG image?
    Josef Heinen
    @jheinen
    currently, GR uses 600dpi, so setwsviewport(0, 6 * 0.0254, 0, 3 * 0.0254) would create a 6 by 3 inch @ 600dpi image
    Sameer Deshmukh
    @v0dro
    @jheinen I'm unable to modify the dimensions of the image even after using setwsviewport. It still outputs a PNG of 2400x2400 pixels. For example, if I use setwsviewport(0, 6 * 0.0254, 0, 3 * 0.0254).
    Josef Heinen
    @jheinen
    Could you please prove a MWE - just the C code
    Sameer Deshmukh
    @v0dro
    OK holdon
    a.v.mantzaris
    @mantzaris
    Hello! thinking about making an user interface and having GR in it
    was wondering: Does the Qt/QML inherit any of the restrictions in license from https://www.qt.io/terms-conditions/ qt.io?
    a.v.mantzaris
    @mantzaris
    Can GR be used as a display canvas within GTK?
    for GTK.jl
    Josef Heinen
    @jheinen
    a.v.mantzaris
    @mantzaris
    @jheinen , no, did not see that, thanks alot!
    a.v.mantzaris
    @mantzaris
    Any reason why the animation example
    p = plot([sin, cos], zeros(0), leg=false) anim = Animation() for x = range(0, stop=10π, length=100) push!(p, x, Float64[sin(x), cos(x)]) frame(anim) end
    would fail if convert and ffmpeg are installed?
    p = plot([sin, cos], zeros(0), leg=false) produces and displays an empty frame which then on the effort to start the animation, closes