I have generated pstricks-code from data:

    % about 9000 more lines

But LaTeX gives me an out of memory error.

Is there any better (less memory consuming) way to create this plot of about 9000 small lines (two coordinates each)?

The data can be downloaded here: https://paste.ee/p/q08ru (Format: x0,y0 x1,y1)

  • Looks like an exported code from a Programm. Nobody needs so many decimals ... can you provide the complete data for a download? – user2478 Dec 15 '17 at 22:06
  • paste.ee/p/q08ru Format: x0,y0 x1,y1 – user2033412 Dec 15 '17 at 22:12
  • are you trying to plot a city map with pstricks? Maybe this is not the right place to ask this... but how did you get all those points? – Alex Recuenco Dec 16 '17 at 9:11
  • (by the way, judging by how small the distance between points are, I think you can get away trying to plot the points themselves instead of the lines, and it will be visually very similar) – Alex Recuenco Dec 16 '17 at 9:12
  • Yes, indeed. It's a very small part of a map. Plotting the lines like Herbert did works if the lines are very short but makes visible breaks to the roads when they are longer. – user2033412 Dec 16 '17 at 11:19

The lines are really short and it makes more sense to use the plot style dots:



If you still need the lines then you have to increase the TeX input buffer or to create a solution on PostScript level.

And here a solution which needs the data file without a comma between the coordinates (can simply be replaced by a space).


  [ (pstricks.data) run ] /Points exch def  % save data
  Points length 4 div cvi /No exch def      % No of lines
  1 setlinewidth
  1 0 0 setrgbcolor
  0 4 No { 
    /iNo exch def
    Points iNo 4  getinterval aload pop 
    4 2 roll \tx@ScreenCoor
    moveto lineto stroke
  } for 

enter image description here

  • I already increased the input buffer to TeXLives maximum -- still no success. :-( – user2033412 Dec 16 '17 at 8:33
  • for the above example it works with the default setting. – user2478 Dec 16 '17 at 9:13
  • I mean I tried to plot the lines (not the dots) -- and it didn't work (even after increasing the memory limit). – user2033412 Dec 16 '17 at 12:04
  • 1
    I edited my answer with a solution on PostScript level. – user2478 Dec 17 '17 at 20:06
  • I just tried it, the file now has the format x1 y1 x2 y2 (as you mentioned), but with the default toolchain (latex, dvips, ps2pdf) I get a ghostscript error. Is there any hidden pitfall? – user2033412 Dec 17 '17 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.