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}

\psaxes[dx=400, Dx=400]{(->}(1900,4.1)

        gridlabels=0pt, xunit=1cm, yunit=1cm](4,4)

Which gives me something like this: enter image description here

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
    Commented Feb 26, 2014 at 6:50

1 Answer 1


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.) Commented Feb 26, 2014 at 19:14
  • 1
    use pgfplot (run "texdoc pgfplot")
    – user2478
    Commented Feb 26, 2014 at 19:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .