Draw math formulas with ggplotd

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 17 04:57:17 PDT 2016


On Saturday, 17 September 2016 at 11:45:07 UTC, Edwin van Leeuwen 
wrote:
> On Saturday, 17 September 2016 at 11:22:04 UTC, John Colvin 
> wrote:
>> On Saturday, 17 September 2016 at 02:41:15 UTC, brocolis wrote:
>>> How do I draw math formulas programmatically? I want to do on 
>>> screen what latex does on .pdf.
>>>
>>> And I want to draw a math formula in the image generated with 
>>> ggplotd.
>>
>> Generate data from those formulas (I like to do this with 
>> something like iota(0, 10, 0.05).map!(x => sqrt(x) / (1 + 
>> sin(x)^^2)) and then plot that.
>
> For this part ggplotd does have a helper function:
>
> http://blackedder.github.io/ggplotd/ggplotd/stat.html#statFunction
>
> auto gg = statFunction(x => sqrt(x) / (1 +
>   sin(x)^^2), 0.0, 10).geomLine().putIn(GGPlotD());
>
> But I assumed he meant adding the formula onto the plot.

Hah, yes, I should have read the question better. Do you support 
embedding outside images? When I wanted nice mathematical 
notation generated quickly in D I have used pyd to call 
matplotlib's builtin math rendering (much quicker than a full 
latex roundtrip).


More information about the Digitalmars-d-learn mailing list