These are chat archives for jheinen/GR.jl

11th
Jun 2017
Ismael Venegas Castelló
@SalchiPapa
Jun 11 2017 15:43
Hello everyone!

How can I save a figure in svg with certain height and length?, ie I have something like this:

PS C:\Users\dell\plot_example> ls


    Directorio: C:\Users\dell\plot_example


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----    11/06/2017  10:32 a. m.             58 plot.jl


PS C:\Users\dell\plot_example> cat plot.jl
using GR
plot(rand(10), rand(10))
savefig("example.svg")

PS C:\Users\dell\plot_example> Measure-Command {julia plot.jl}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 3
Milliseconds      : 364
Ticks             : 33646221
TotalDays         : 3.89423854166667E-05
TotalHours        : 0.00093461725
TotalMinutes      : 0.056077035
TotalSeconds      : 3.3646221
TotalMilliseconds : 3364.6221



PS C:\Users\dell\plot_example> ls


    Directorio: C:\Users\dell\plot_example


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----    11/06/2017  10:42 a. m.          12902 example.svg
-a----    11/06/2017  10:32 a. m.             58 plot.jl


PS C:\Users\dell\plot_example>

But I would like to write something like:

savefig("example.svg", 10cm, 10cm)

I haven't found a method for this:

julia> methods(savefig)
# 1 method for generic function "savefig":
savefig(filename) at C:\Users\dell\.julia\v0.5\GR\src\GR.jl:2881
Ismael Venegas Castelló
@SalchiPapa
Jun 11 2017 15:49
How can I specify the size of the saved image?
Ismael Venegas Castelló
@SalchiPapa
Jun 11 2017 15:56
If plot can recieve size args, then savefig could be made more general:
Ismael Venegas Castelló
@SalchiPapa
Jun 11 2017 16:28
@jheinen I want to know in order to answer this question at SO, the guy who asked also wants to set the witdh and height, I haven't been able to figure it out:
Josef Heinen
@jheinen
Jun 11 2017 17:39
Will check this tomorrow. Currently heading Phil Collins‘ concert in Coöogne ... :smile: