# Automatic axes for graphs with PSTricks

I have datas from Matlab and I would like to plot them using PSTricks. My datas are in a .data file.

So far I have done a graph but only with Manual adjustment of the axes:

\psset{xunit=0.025mm, yunit=1cm}
\begin{pspicture}(-200,-0.5)(1900,4.25)
\fileplot[plotstyle=line,linewidth=1pt,
linecolor=blue]{coordonnees.data}

\psaxes[dx=400, Dx=400]{(->}(1900,4.1)
[$\mathbf{x}$,0][$\mathbf{y}$,90]

\psgrid[griddots=5,subgriddiv=1,
gridlabels=0pt, xunit=1cm, yunit=1cm](4,4)
\end{pspicture}


Which gives me something like this:

The graph is ok but I would like PSTricks to generate such squared graph (e.g. 4cm x 4cm) with the values of the axes automatically adjusted with regards to the datas contained in the .data file (I currently have to adjust it manually). How can I achieve this?

• Any example of PSTricks I have seen with respect to plotting with axes explicitly scales them inside tex code; perhaps the \dataplot command can do some automatic scaling? – user31729 Feb 26 '14 at 6:50

For some historical reason it is not possible. Labels are set on TeX level and all plotting is done on PostScript level. It is not a big deal to change that behaviour, but on PS level you do not really know which font was used in TeX for the labels.

However, it has some advantages that the axes must be set by the user. Often the output of the automatic scaling is not what a user want.

• Do you know if there exist other functions - packages that allows for automatic axes? (\dataplot, tickz package, ....). I never scaled axes of graphs myself in years since it is usually handled automatically by other softwares (Matlab, Mathematica, etc.) – Alexandre Willame Feb 26 '14 at 19:14
• use pgfplot (run "texdoc pgfplot") – user2478 Feb 26 '14 at 19:51