You can set the function as #y axis and then you don't need to create a "functionAsModel":

| diag f |

diag := ESDiagramRenderer new.
(diag lineDiagram)
       y: [:x | x*x];
       yAxisLabel: 'X^2';
       rotatedLabels: true;
       regularAxis;
       defaultColor: Color green;
       models: (0 to: 10 by: 0.1).
diag open

On Thu, Mar 22, 2012 at 2:31 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
I would love to have a Pharo-based solution for doing numerical analysis. This implies having a .pdf (or .ps, if simpler) exporter of the graph.

Alexandre


On 22 Mar 2012, at 07:06, Serge Stinckwich wrote:

> Hi all,
>
> i try to use EyeSee to plot mathematical functions with ESLineDiagram.
> They is not easy as i might expect at the beginning :-)
> The problem is EyeSee is using collections as models. I try to
> transform the function as a collection like above but maybe there is a
> better way to do that.
>
> |diag f functionAsModel|
> f := [:x | x*x].
> functionAsModel := (0 to:10 by:0.1) collect:[:each | f value:each].
> diag := ESDiagramRenderer new.
> (diag lineDiagram)
>       y: #yourself;
>       yAxisLabel: 'X^2';
>       rotatedLabels: true;
>       regularAxis;
>       defaultColor: Color green;
>       models: functionAsModel.
> diag open
>
> Regards,
> --
> Serge Stinckwich
> UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
> Every DSL ends up being Smalltalk
> http://doesnotunderstand.org/
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Andre Hora