These are chat archives for jheinen/GR.jl

11th
Jul 2016
Josef Heinen
@jheinen
Jul 11 2016 05:53
@ChrisRackauckas , No. GR has its "own" output drivers for PDF, SVG, PS, and - of course - for native GUI support (Windows => GDI, macOS => CoreGraphics, Linux => X11). For those formats there are NO dependencies. If you need image output (PNG, JPEG, BMP), GR requires either the GhostScript run-time or Cairographics. To create movies (on the fly), GR requires the ffmpeg run-time and MuPDF.
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 05:56
That's pretty cool. I thought so because of the fast installs. I want to change all of my testing to GR through Plots.jl but without the trisurf working it's not doable.
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 06:42
Is there a way to specify the triangles for GR's trisurf?
Josef Heinen
@jheinen
Jul 11 2016 07:29
Screen Shot 2016-07-11 at 09.29.14.png
Right now GR does the triangulation internally, so you can only pass 1D vectors to trisurf:
using GR
N = 500
x = -1 + rand(N) * 2
y = -1 + rand(N) * 2
z = [Float64(x[i]^2 - y[i]^2) for i = 1:N]
trisurf(x, y, z)
@ChrisRackauckas , so you need a triangulate function?
Tom Breloff
@tbreloff
Jul 11 2016 11:06
@ChrisRackauckas I thought i told you. Sorry. I implemented trisurf in Plots last night. It's on the tb_colors branch
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 13:14
Trying tbreloff/Plots.jl#387 on tb_colors. Getting this error:
This message was deleted
error.PNG
@jheinen A triangulate function is usually necessary to properly plot a non-square mesh (at least with the trisurf functions I've used), for example tbreloff/Plots.jl#286. Normally it's provided as giving a matrix where each row is [node1 node2 node3] where those three nodes are the indices for the vertex of a triangle. They tend to default by "filling all triangles in" which work for a square, but not something like that example. Does GR have one hanging around? (I don't find the GR documentation easy to read... or at least I don't understand it)
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 13:22
The error is with GR master, Plots.jl on tb_colors, Windows, Julia v0.5
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 13:52
Works on Linux.
Josef Heinen
@jheinen
Jul 11 2016 14:30
@ChrisRackauckas , should also work with Wndows. You probably have to rebuild GR.
julia> rm(joinpath(Pkg.dir("GR"),"downloads"),recursive=true)
julia> Pkg.build("GR")
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 14:32
:+1:
I was doing Pkg.build("GR") without first removing it.
Works now
Josef Heinen
@jheinen
Jul 11 2016 14:32
Screen Shot 2016-07-11 at 16.28.55.png
Yes, you're right - I need more time for the documentation ... :-)
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 14:38
trisurf.PNG
That should be the same as tbreloff/Plots.jl#286
(It's rough since it defaults to black in this case). It fills in all of the extra triangles so it doesn't just show the lake.
PyPlot does the same thing if you don't give it triangles too.
Tom Breloff
@tbreloff
Jul 11 2016 14:47
@ChrisRackauckas yeah it would be nice to set the colors separately from the z values. i know that i've done this in the past with Plots... i think there's a SO post... i'll look for it
i don't know if this still works
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 14:57
trisurf.PNG
GR's trisurf also doesn't have an edge color, so changing the color doesn't matter if it's an unsolved mesh (i.e., flat)
plot(mesh,zlim=(0,1),linecolor=:black) doesn't make the triangles edge lines black. I think that would be an intuitive command.
Josef Heinen
@jheinen
Jul 11 2016 16:46
@ChrisRackauckas , I will check this (edge color). Will first implement this feature in GR and then make it available in Plots. But I need some time as I'm heading to SciPy (early tomorrow morning) ...
Christopher Rackauckas
@ChrisRackauckas
Jul 11 2016 17:01
It's all good. This all works in PyPlot (triangles and edge color), so I have something to work with in the meantime. Besides, I am not supposed to be working on Julia right now, I have a MATLAB project to finish :worried:.