I'm having trouble passing GNUplot parameters through JavaPlot. I've been able to use JavaPlot for several different graphs, but I can't seem to get JavaPlot to activate the "polar" setting in GNUPlot.
The GNUPlot command to change to polar mode is simply "set polar". I understand that I probably need to give a .set("polar") command to some PropertyHolder object of the JavaPlot. But which object?
Intuitively, I would try (after creating an image terminal called png):
GNUPlotParameters params = new GNUPlotParameters();
params.set("polar");
GNUPlot p = new GNUPlot(params);
p.setTerminal(png);
FunctionPlot func = new FunctionPlot("sin(x)");
p.addPlot(func);
But this does not work - the build fails on addPlot(). I also tried setting the GNUPlot object itself, but GNUPlot.set() requires a ("keyword","value") argument set, and the command i'd like to sent to GNUPlot is simply "set polar". But doing it this way:
p.set("polar","");
also results in a build failure. Anyone have a clue how to set a specific GNUPlot parameter (such as polar)?
It turns out that setting the
polar
keyword SHOULD happen as an attribute of the plot itself, and indeed the variable needs to bet
. For completeness, this is what I needed to make it work (with two example functions, one being pre-defined as a function plot):