Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have tried to load the "PlotLegends'" package. Here is my code,

MLPutFunction(lp,"EvaluatePacket", 1L);

MLPutFunction(lp, "Get", 1);
MLPutString(lp, "PlotLegends`");
while((pkt = MLNextPacket(lp),pkt) && pkt != RETURNPKT)
{
    MLNewPacket(lp);

    if(MLError(lp))
        error(lp);

}
MLNewPacket(lp);        
MLPutFunction(lp, "ToString", 1);
MLPutFunction(lp, "ToExpression", 1);

inputStr = "ListDensityPlot[Transpose[{{1, 2, 3, 5, 6}, {1, 2, 3, 5, 6}}],DataRange -> {{0, 500}, {900, 5100}}, ColorFunction -> \"Rainbow\",PlotLegends -> Automatic]";


func_str="Export[\"D:/test_colour_plot.gif\","+ inputStr + "]";

const_func = func_str.c_str();
MLPutString(lp,const_func);
MLEndPacket(lp);

while((pkt = MLNextPacket(lp),pkt) && pkt != RETURNPKT)
{
    MLNewPacket(lp);

    if(MLError(lp))
        error(lp);

}

share|improve this question
    
In the future, please use the Code button on the toolbar (the button that looks like "{}") to format your code. –  Rahul Sep 17 '13 at 5:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.