blackedder / ggplotd Goto Github PK
View Code? Open in Web Editor NEWPlotting library for the D programming library. The design is inspired by ggplot2 for R.
License: Boost Software License 1.0
Plotting library for the D programming library. The design is inspired by ggplot2 for R.
License: Boost Software License 1.0
D has static types so instead of
gg.put( geomPoint( Aes!(typeof(xs), "x", typeof(ys2noise), "y", string[],
"colour" )( xs, ys2noise, ("b").repeat(xs.length).array) ));
it should be possible to do
gg.put( geomPoint( "x", "y", "colour" )( xs, ys2noise, ("b").repeat(xs.length).array) ));
which would be a lot nicer.
Btw ideally as an API user I would like to use something similar to:
geomPoint(xs, ys).put(gg);
And if there are more configs
Config config = {color: "red"};
geomPoint(xs, ys, config).put(gg);
Btw there is a DIP in work that could allow the following:
geomPoint(xs, ys, {color: "red"}).put(gg);
Hi there!
I'm making an image plotting utility for the library I'm working on, and I'd like to extend that utility so it can also draw plots from GGPlotD context. Here is the gist to the short preview of such utility. (Only important parts are left in the code, read on for problem explanation please)
I was planning to wrap the GGPlotD.drawToSurface
call inside the utility's API, but I've got the following problem - In this utility I'm using cairo.ImageSurface from the GtkD library, but the input parameter to drawToSurface
is actually from the cairoD library. Even if ggplotd:ggplotd-gtk
configuration is used, cairo modules are used from cairoD, and not from GtkD library, which makes interfacing with GtkD code bit problematic.
Dirty solution I've got in given gist, was to create the cairoD ImageSurface
for the drawToSurface
, and later to copy it's results to my original GtkD ImageSurface
. Would it be possible to use cairo modules from GtkD in the ggplotd code if ggplotd-gtk configuration is used?
Also, there was another problem with drawToSurface
method, more precisely with ref cairo.Surface
as input. I'm still quite new to D, so I don't know why (but I suppose you do) this code:
Surface surface = new ImageSurface(Format.CAIRO_FORMAT_RGB24, w, h);
surface = gg.drawToSurface(surface, w, h);
... gives me this error (DMD64 D Compiler v2.071.0):
Error: function ggplotd.ggplotd.GGPlotD.drawToSurface (ref Surface surface, int width, int height) const is not callable using argument types (Surface, int, int) const
I've buy-passed this by removing the ref
. May I ask, why was ref needed? Method produces valid results without it. Am I missing something here?
.dub/packages/ggplotd-1.2.1/ggplotd/source/ggplotd/guide.d(398,51): Deprecation: function std.typecons.Nullable!(RGB!("rgb", double, false, cast(RGBColorSpace)0)).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
How tightly ggplotd is integrated with cairo? Could you give some advice where to start to implement custom renderer?
Observed with ggplotd-1.1.6 (via dub).
Code to reproduce some examples:
auto gg = [[18.0, 0.0], [18.1, 1.0], [18.2, 2.0]] // test1.png
//auto gg = [[18.0, 0.0], [18.5, 1.0], [19.0, 2.0], [19.5, 3.0], [20.0, 4.0]] // test2.png
//auto gg = [[18.0, 0.0], [19.0, 1.0], [20.0, 2.0], [21.0, 3.0]] // test3.png
.map!((a) =>
aes!("x", "y", "colour")(a[0], a[1], "red")
)
.geomPoint
.putIn(GGPlotD());
gg = gg + scale();
gg.save("test1.png");
test1.png:
X-Axis should be .. 18.08 .. 18.12 .. -> String formatting issue?
test2.png:
No idea whats going on here, the first 19.2 should be a value < 19.0 (My guess would be 18.8)
test3.png:
Last x-axis value should be < 21,
alsy y-axis values are messed up completely.
The JSON files specifies ~>0.0.5 for the color package. This causes compilation to fail with color 0.0.7 as follows:
../../../.dub/packages/color-0.0.7/color/std/experimental/color/package.d:534:19: error: @nogc function 'std.experimental.color.colorFromStringImpl
' cannot call non-@nogc function 'std.experimental.color.colorFromStringImpl.streqi'
if (streqi(str, k))
^
Modifying the JSON to ==0.0.5 allows ggplotd to compile.
Trying out ggplotd in a dub project by running the histograms example. This results in the following error below:
(base) PS C:\Users\tasty\Devel\think_stats_with_D> dub build --compiler=ldc2 ; ./survey
Performing "debug" build using ldc2 for x86_64.
derelict-util 2.1.0: target for configuration "library" is up to date.
derelict-ft 1.0.2: target for configuration "library" is up to date.
cairod 0.0.1-alpha.3+1.10.2: target for configuration "static-custom-windows" is up to date.
dstats 1.0.5: target for configuration "library" is up to date.
dunit 1.0.15: target for configuration "library" is up to date.
painlesstraits 0.3.0: target for configuration "unittest" is up to date.
ggplotd 1.2.0: target for configuration "default" is up to date.
mir-core 1.0.2: target for configuration "library" is up to date.
mir-algorithm 3.7.2: target for configuration "default" is up to date.
mir-linux-kernel 1.0.1: target for configuration "library" is up to date.
mir-random 2.2.8: target for configuration "extended" is up to date.
survey ~master: building configuration "application"...
..\..\AppData\Local\dub\packages\ggplotd-1.2.0\ggplotd\source\ggplotd\guide.d(398,37): Deprecation: function std.typecons.Nullable!(RGB!("rgb", double, false, cast(RGBColorSpace)0)).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
..\..\AppData\Local\dub\packages\ggplotd-1.2.0\ggplotd\source\ggplotd\guide.d(398,44): Deprecation: function std.typecons.Nullable!(RGB!("rgb", double, false, cast(RGBColorSpace)0)).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
..\..\AppData\Local\dub\packages\ggplotd-1.2.0\ggplotd\source\ggplotd\guide.d(398,51): Deprecation: function std.typecons.Nullable!(RGB!("rgb", double, false, cast(RGBColorSpace)0)).Nullable.get_ is deprecated - Implicit conversion with alias Nullable.get this will be removed after 2.096. Please use .get explicitly.
lld-link: error: undefined symbol: _D7ggplotd6colour11namedColourFNaNbNixAyaZS3std8typecons__T8NullableTSQBb12experimental5color3rgb__T3RGBVAyaa3_726762TdVbi0VEQDeQCdQBs10colorspace13RGBColorSpacei0ZQCmZQEf
>>> referenced by C:\Users\tasty\AppData\Local\dub\packages\ggplotd-1.2.0\ggplotd\source\ggplotd\guide.d:396
>>> .dub\obj\survey.obj:(_D7ggplotd5guide21GuideToColourFunction__T6opCallTAyaZQmMxFxAyabZS3std12experimental5color3rgb__T3RGBVQCaa4_72676261TdVbi0VEQCgQCfQBu10colorspace13RGBColorSpacei0ZQCo)
>>> referenced by C:\Users\tasty\AppData\Local\dub\packages\ggplotd-1.2.0\ggplotd\source\ggplotd\guide.d:153
>>> .dub\obj\survey.obj:(_D7ggplotd5guide__T10GuideStoreVAyaa6_636f6c6f7572ZQBg__T3putTQBeZQjMFxAyadZv)
Error: linking with LLD failed
ldc2 failed with exit code 1.
I should mention that in order to build a dub project I had to put cairo.lib
directly into the root of the dub project and update dub.json
accordingly. I also have c:\gtk3\bin
and c:\gtk3\lib
both added to PATH
.
Testing v1.1.1 w/ dmd 2.072.1 on linux x86-64
Running ./test__ggplotd-gtk
Random seed: 3850067743
Random seed MCMC: 1709140524
This fails due to some assertion in iota (maybe related to Issue 6531 โ assertion failure in std.range.iota).
to have opportunity of adding custom information. For example I have several sets of points and I need to draw an error ellipse for every point set. I guess it would be simpler to do using a cairo context.
The number of bins shouldn't be hard-coded
How to disable drawing axis (line, ticks, labels)?
I try hide it by delegate, but it's not work:
auto gg = GGPlotD().put((YAxis ya){ ya.show = false; return ya; });
Put YAxis
directly don't work too.
I have long text labels. I'd like to rotate them vertically along the X axis.
So I could just give the Aes struct an AA and it will use the keys as it's "x" and the values as it's "y" axes.
if not, I think should be easy add, as a simple helper function
auto data = ["a" : 1.0, "b" : 2.0, "c" : 3.0];
auto aes = hashAes(data);
auto hashAes(T)(T data){
// ... some code check if T is indeed an AA
auto xVals = data.keys;
auto yVals = data.values; // not sure if these will be in the same order (i.e. xVals[0] is the X for yVals[0]. If not, simple enough solution to loop over xVals appending to an array
return Aes!(typeof(xVals), "x", typeof(yVals), "y")(xVals, yVals);
}
After updating dmd from 2.079.1 to 2.080.0 ggplotd does not compiles any more.
Example used:
#39 (comment)
Compiling via dub, compilation output:
Marvin:test519 alex$ dmd --version
DMD64 D Compiler v2.080.0
Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved written by Walter Bright
Marvin:test519 alex$ dub run
Package ggplotd can be upgraded from ~master to 1.1.4.
Use "dub upgrade" to perform those changes.
Selected package ggplotd ~master does not match the dependency specification ~>1.1.4 in package test519. Need to "dub upgrade"?
Performing "debug" build using dmd for x86_64.
derelict-util 2.1.0: building configuration "library"...
derelict-ft 1.0.2: building configuration "library"...
x11 1.0.20: building configuration "library"...
/Users/alex/.dub/packages/x11-1.0.20/x11/source/x11/extensions/XI.d(3,8): Deprecation: Symbol object.string is not visible from module XI because it is privately imported in module string
cairod 0.0.1-alpha.3+1.10.2: building configuration "static-custom-posix"...
dstats 1.0.5: building configuration "library"...
dunit 1.0.14: building configuration "library"...
gtk-d:gtkd 3.3.1: building configuration "library"...
painlesstraits 0.2.0: building configuration "library"...
ggplotd ~master: building configuration "ggplotd-gtk"...
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): Error: constructor std.range.Zip!(double[], double[], string[], double[], double[]).Zip.this(double[] _param_0, double[] _param_1, string[] _param_2, double[] _param_3, double[] _param_4, StoppingPolicy s = cast(StoppingPolicy)0) is not callable using argument types (ZipShortest!(cast(Flag)true, double[], double[], string[], double[], double[]))
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): cannot pass argument zip(_param_0, _param_1, _param_2, _param_3, _param_4) of type ZipShortest!(cast(Flag)true, double[], double[], string[], double[], double[]) to parameter double[] _param_0
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/axes.d(292,30): Error: template instance ggplotd.aes.Aes!(double[], "x", double[], "y", string[], "label", double[], "angle", double[], "size").Aes.__ctor!(double[], double[], string[], double[], double[])
error instantiating
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): Error: constructor std.range.Zip!(double[], double[], string[], double[], bool[], bool[]).Zip.this(double[] _param_0, double[] _param_1, string[] _param_2, double[] _param_3, bool[] _param_4, bool[] _param_5, StoppingPolicy s = cast(StoppingPolicy)0) is not callable using argument types (ZipShortest!(cast(Flag)true, double[], double[], string[], double[], bool[], bool[]))
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): cannot pass argument zip(_param_0, _param_1, _param_2, _param_3, _param_4, _param_5) of type ZipShortest!(cast(Flag)true, double[], double[], string[], double[], bool[], bool[]) to parameter double[] _param_0
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/geom.d(588,60): Error: template instance ggplotd.aes.Aes!(double[], "x", double[], "y", string[], "label", double[], "angle", bool[], "mask", bool[], "scale").Aes.__ctor!(double[], double[], string[], double[], bool[], bool[])
error instantiating
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/ggplotd.d(338,25): instantiated from here: geomAxis!(Aes!(double[], "x", double[], "y", string[], "label", double[], "angle", double[], "size"))
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): Error: constructor std.range.Zip!(double[], double[], double[]).Zip.this(double[] _param_0, double[] _param_1, double[] _param_2, StoppingPolicy s = cast(StoppingPolicy)0) is not callable using argument types (ZipShortest!(cast(Flag)true, double[], double[], double[]))
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): cannot pass argument zip(_param_0, _param_1, _param_2) of type ZipShortest!(cast(Flag)true, double[], double[], double[]) to parameter double[] _param_0
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/legend.d(59,9): Error: template instance ggplotd.aes.Aes!(double[], "x", double[], "y", double[], "colour").Aes.__ctor!(double[], double[], double[])
error instantiating
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/ggplotd.d(370,53): instantiated from here: drawContinuousLegend!(GuideStore!"colour", RGB!("rgba", double, false, cast(RGBColorSpace)0) delegate(double, double, double))
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): Error: constructor std.range.Zip!(Take!(Repeat!double), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), Take!(Repeat!double), Take!(Repeat!double), Take!(Repeat!double)).Zip.this(Take!(Repeat!double) _param_0, MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))) _param_1, MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))) _param_2, Take!(Repeat!double) _param_3, Take!(Repeat!double) _param_4, Take!(Repeat!double) _param_5, StoppingPolicy s = cast(StoppingPolicy)0) is not callable using argument types (ZipShortest!(cast(Flag)true, Take!(Repeat!double), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), Take!(Repeat!double), Take!(Repeat!double), Take!(Repeat!double)))
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/aes.d(238,17): cannot pass argument zip(_param_0, _param_1, _param_2, _param_3, _param_4, _param_5) of type ZipShortest!(cast(Flag)true, Take!(Repeat!double), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), Take!(Repeat!double), Take!(Repeat!double), Take!(Repeat!double)) to parameter Take!(Repeat!double) _param_0
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/legend.d(99,9): Error: template instance ggplotd.aes.Aes!(Take!(Repeat!double), "x", MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), "y", MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), "colour", Take!(Repeat!double), "width", Take!(Repeat!double), "height", Take!(Repeat!double), "fill").Aes.__ctor!(Take!(Repeat!double), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), MapResult!(__lambda1, MapResult!(__lambda2, SortedRange!(Pair[], __lambda1))), Take!(Repeat!double), Take!(Repeat!double), Take!(Repeat!double))
error instantiating
/Users/alex/.dub/packages/ggplotd-master/ggplotd/source/ggplotd/ggplotd.d(378,51): instantiated from here: drawDiscreteLegend!(GuideStore!"colour", RGB!("rgba", double, false, cast(RGBColorSpace)0) delegate(double, double, double))
dmd failed with exit code 1.
The example compiles fine, if compiling with ldc2.
and also:
/Users/timothee/git_clone/D/ggplotd/source/ggplotd/guide.d(439,12): Deprecation: module ggplotd.colour
member RGBA is not visible from module guide
/Users/timothee/git_clone/D/ggplotd/source/ggplotd/geom.d(50,12): Deprecation: module ggplotd.guide
member GuideStore is not visible from module geom
/Users/timothee/git_clone/D/ggplotd/source/ggplotd/ggplotd.d(520,12): Deprecation: module ggplotd.legend
member Legend is not visible from module ggplotd
/Users/timothee/git_clone/D/ggplotd/source/ggplotd/geom.d(28,16): Deprecation: module ggplotd.aes
member hasAesField is not visible from module geom
Serializing composite type Empty which has no serializable fields
/Users/timothee/git_clone/D/ggplotd/source/ggplotd/geom.d(117,24): Deprecation: module ggplotd.aes
member hasAesField is not visible from module geom
/Users/timothee/git_clone/D/ggplotd/source/ggplotd/geom.d(28,16): Deprecation: module ggplotd.aes
member hasAesField is not visible from module geom
I don't see the ability to label individual ticks. This is nessesary for plotting categorical data in bar charts.
I am trying to plot the following data:
Tuple!(real, real)(-0, 0.000226603)
Tuple!(real, real)(17, 0.000226603)
Tuple!(real, real)(20, 0.000226603)
Tuple!(real, real)(21, 0.000226603)
Tuple!(real, real)(22, 0.00067981)
Tuple!(real, real)(23, 0.000226603)
Tuple!(real, real)(24, 0.00158622)
Tuple!(real, real)(25, 0.000226603)
Tuple!(real, real)(26, 0.00362565)
Tuple!(real, real)(27, 0.000226603)
Tuple!(real, real)(28, 0.00543848)
Tuple!(real, real)(29, 0.00203943)
Tuple!(real, real)(30, 0.016542)
Tuple!(real, real)(31, 0.00339905)
Tuple!(real, real)(32, 0.0124632)
Tuple!(real, real)(33, 0.00634489)
Tuple!(real, real)(34, 0.00657149)
Tuple!(real, real)(35, 0.0360299)
Tuple!(real, real)(36, 0.0389758)
Tuple!(real, real)(37, 0.0471335)
Tuple!(real, real)(38, 0.0616361)
Tuple!(real, real)(39, 0.479039)
Tuple!(real, real)(40, 0.121459)
Tuple!(real, real)(41, 0.0815772)
Tuple!(real, real)(42, 0.0464537)
Tuple!(real, real)(43, 0.0197145)
Tuple!(real, real)(44, 0.00521187)
Tuple!(real, real)(45, 0.00135962)
Tuple!(real, real)(46, 0.000226603)
Tuple!(real, real)(47, 0.000226603)
Tuple!(real, real)(48, 0.00067981)
Using the following code snippet:
void histogramXY(Tuple!(real, real)[] data, string fileName) {
auto gg = data
.map!((a) => aes!("x", "y")(a[0], a[1]))
.geomHist
.putIn(GGPlotD());
gg.save(fileName~".svg");
}
What happened to Y axis, why is it scaled to 5?
Do you have any plans to add gganimate?
Or can you somehow create a gif using ggplotd?
Thanks! ๐
import core.thread;
import ggplotd.ggplotd;
import ggplotd.geom;
import ggplotd.aes;
import ggplotd.gtk;
void main()
{
const win_width = 1024;
const win_height = 1024;
const radius = 400.;
auto line_aes11 = Aes!(double[], "x", double[], "y")( [ 0, radius*0.45 ], [ 0, radius*0.45]);
auto line_aes22 = Aes!(double[], "x", double[], "y")( [ 300, radius*0.45 ], [ 210, radius*0.45]);
auto gtkwin = new GTKWindow();
auto tid = new Thread(() { gtkwin.run("plotcli", win_width, win_height); }).start();
auto gg = GGPlotD();
gg.put( geomLine(line_aes11) );
gg.put( geomLine(line_aes22) );
gg.save("figure1.png", win_width, win_height);
gtkwin.draw( gg, win_width, win_height );
}
After programm running the file "figure1.png" contains the lines but the gtk window doesn't.
Can I put both axes at the center of the plot?
nevermind, I was using fill
I tried to compile your ggplotd on my project directory. It failed to build because of "ggplotd/colourspace.d(8): Error: module hsx
is in file 'std/experimental/color/hsx.d' which cannot be read" I checked directory usr/include/d/std/experimental/ ......and there is no folder color. Be careful using color / colour.
How do I get color folder?
eg:
analog to matlab's legend:
legend('sin(x)','cos(x)')
https://www.mathworks.com/help/matlab/creating_plots/add-title-axis-labels-and-legend-to-graph.html
looked at continousLegend+friends (https://blackedder.github.io/ggplotd/ggplotd/legend.html) but couldn't find the above functionality
I've just cloned the library to my Win10 PC, having DMD32 D Compiler v2.083.0 installed. I did a dub build
, which was successful, followed by a dub test
, which was not successful. I got the following errorneous output:
C:\Users\thomas\Documents\Develop\Dtest\ggplot\ggplotd>dub test
Generating test runner configuration 'ggplotd-test-default' for 'default' (library).
Performing "unittest" build using C:\D\dmd2\windows\bin\dmd.exe for x86.
derelict-util 2.1.0: target for configuration "library" is up to date.
derelict-ft 1.0.2: target for configuration "library" is up to date.
cairod 0.0.1-alpha.3+1.10.2: building configuration "static-custom-windows"...
..\..\..\..\..\AppData\Local\dub\packages\windows-headers-1.0.3\windows-headers\source\windows\windows.d(29,15): Error: module `profinfo` is in file 'windows\profinfo.d' which cannot be read
import path[0] = ..\..\..\..\..\AppData\Local\dub\packages\cairod-0.0.1-alpha.3_1.10.2\cairod\src
import path[1] = ..\..\..\..\..\AppData\Local\dub\packages\windows-headers-1.0.3\windows-headers\source
import path[2] = ..\..\..\..\..\AppData\Local\dub\packages\derelict-ft-1.0.2\derelict-ft\source
import path[3] = ..\..\..\..\..\AppData\Local\dub\packages\derelict-util-2.1.0\derelict-util\source
import path[4] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[5] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
import path[6] = C:\D\dmd2\windows\bin\..\..\src\gtkd
C:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.
C:\Users\thomas\Documents\Develop\Dtest\ggplot\ggplotd>
I'm googling for a while now but cannot figure out how to locate the profinfo.d
file. Here, a reference to the windows C header is made, but I don't know how to bring this together at the moment.
Does anyone have a hint? Thanks in advance!
btw: the same error appears if I try to compile one of the example sources given on this website.
OSX:
bash autotest.sh
Linking...
Running ./__test__default__
Random seed: 2067000344
Random seed MCMC: 1226040721
All unit tests have been run successfully.
autotest.sh: line 7: inotify-hookable: command not found
object.Exception@../../../../.dub/packages/gtk-d-3.3.1/gtk-d/src/gtkc/Loader.d(123): Library load failed: libatk-1.0.dylib
README.md only shows sudo apt-get install libcairo2-dev
as a dependency; what about osx? i did do brew install cairo FWIW but should i also have brew install atk
?
EDIT: after that i still get:
$binary
object.Exception@../../../../.dub/packages/gtk-d-3.3.1/gtk-d/src/gtkc/Loader.d(123): Library load failed: libatk-1.0.dylib
Also tried:
DYLD_LIBRARY_PATH=$HOME/homebrew/lib $binary
dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Users/timothee/homebrew//lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Code:
auto f = (double x) { return sqrt(pow(x, 2) - 1); };
auto xs = iota(-5, 5, 0.1).array;
auto ysfit = xs.map!((x) => f(x)).array;
auto gg = GGPlotD().put( geomLine( Aes!(typeof(xs), "x", typeof(ysfit), "y")( xs, ysfit ) ) );
gg.put(xaxisRange(-5, 5));
gg.put(yaxisRange(-5, 5));
gg.save("ggplotd.png", 500, 300);
Expected: http://d.darktech.org/fx.png
Output: http://d.darktech.org/ggplotd.png
Domain: x <= -1, x >= 1
http://www.wolframalpha.com/input/?i=sqrt(pow(x,+2)+-+1)
How can I configure a fixed ratio between x and y axes in ggplotd ?
I easily found what I am looking for in ggplot which ggplotd inspires a lot.
http://www.cookbook-r.com/Graphs/Axes_(ggplot2)/
But ggplotd documentation does not have any info about that. Even I go through the source code spend around half a hour I couldn't figure out how to achieve:
sp <- ggplot(dat, aes(xval, yval)) + geom_point()
sp + coord_fixed(ratio=1/3)
Erdem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.