Export to LaTeX a "one piece" bounded function (PSTricks)

Michel Iroir shared this idea 7 years ago
Answered

Hi, (or ciao :) ) with 5.0.77. By an example :

--> a nice export for the function f(x)=x^2 : no problem

--> an export working for f(x)=If[-1<=x<=1,x^2] but using peace functions/segments with many lines/segments (pixel by pixel ?) so using many codes and lines. (Maybe it is diffcult to find/translate the bounds or it is easier to translate like that all the commands using many pieces with many If[]).

--> a nice export for Integral[x^2,-1,1] where the bounds are read and the code is :

    \pscustom[linecolor=zzttqq,fillcolor=zzttqq,fillstyle=solid,opacity=0.1]{\psplot{-1.}{1.}{x^(2.0)}\lineto(1.,0)\lineto(-1.,0)\closepath}

so maybe you could export a bounded function (at least for a "one piece" bounded function) to something like that :

    \pscustom[linecolor=zzttqq,fillcolor=zzttqq,fillstyle=solid,opacity=0.0]{\psplot{-1.}{1.}{x^(2.0)\psplot{1.}{-1.}{x^(2.0)}\closepath}

if you can't export to :

    \psplot{-1.}{1.}{x^(2.0)}

Cheers. Michel

Comments (2)

photo
1

Hi miir,

Some exports affected my little knowledge of latex and its dialects and can definitely be improved. Functions with if I thought redo a real expression parsing was overly complex in front of the design point by point (with the average file size that are used today, some k in most did not seem significant). I will try to study as much as you propose (made in google translator)

Giuliano

photo
1

Hi, an easier workaround to export to LaTeX (PSTricks) the (graph of the) function : f=If[-1<=x<=1,x^2]

-> don't show f

-> create a=Integral[f,f,-1,1]

-> SetCaption[a, "y=f(x)"]

-> export to PSTricks

© 2022 International GeoGebra Institute