Is there a standard file extension for gnuplot files?

GnuplotFile Extension

Gnuplot Problem Overview


I have seen .gnu, .plt, and .gplot as file extensions for gnuplot scripts.

I know Linux doesn't care about file extensions, but what extension most universally declares to human beings "I am a gnuplot script!"?

Gnuplot Solutions


Solution 1 - Gnuplot

As Romain, Dr. Person and neillb all point out and [this wikibooks article][1] confirms, there is no official standard extension for gnuplot files.

These three file extensions do seem popular:

.gpi
.plt
.gp

Of these .gp is shortest and seems like it would have the fewest collisions with other programs. But the other two extensions aren't in heavy use either. It [appears that][2] .plt was used by HPGL plotters and therefore some old Autocad files may have this extension. And files with a .gpi extension are used by Garmin GPS devices. Fwiw, googling for "gnuplot file extension gp" returns a few more results than similar searches for .gpi and .plt

While .gnuplot is a fair choice, it is seven characters long. Long file extensions can potentially detract from readability in the terminal because they open up the possibility of file names that are shorter than the file extension and because longer extensions are more likely to cause lines to wrap.

[1]: http://en.wikibooks.org/wiki/Gnuplot#Source_files "The GnuPlot Book at WikiBooks" [2]: http://cstep.luberth.com/hpgl.htm "an article on HPGL that is linked from the HPGL wikipedia page"

Solution 2 - Gnuplot

vim recognises .gpi, for more see Gnuplot Wikibook.

Solution 3 - Gnuplot

Gnuplot uses .gnu for the demos on their [website][1], so I take that to be the standard.

[1]: http://gnuplot.sourceforge.net/demo_4.6/ "Gnuplot demos"

Solution 4 - Gnuplot

> what extension most universally > declares to human beings "I am a > gnuplot script!"?

For that, ".gnuplot" is hard to beat!

It's not common (probably because it's a bit long) but it unambiguously tells a human being what's inside the tin.

In contrast, wikipedia lists six other file formats with the extension .plt.

Solution 5 - Gnuplot

I don't think that ".gnuplot" should have been accepted as THE answer. There really isn't an answer. I've seen and used ".gp" before which is nice.

Solution 6 - Gnuplot

Wikipedia seems to suggest .plt would be standard-ish. That being said, GnuPlot itself doesn't define any standard and makes it freeform, so there isn't really an extension that tells "this is a gnuplot script".

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPhilipView Question on Stackoverflow
Solution 1 - GnuplotNoah SussmanView Answer on Stackoverflow
Solution 2 - GnuplotDavid RichfieldView Answer on Stackoverflow
Solution 3 - GnuplotmarcelnijmanView Answer on Stackoverflow
Solution 4 - GnuplotneillbView Answer on Stackoverflow
Solution 5 - GnuplotSO StinksView Answer on Stackoverflow
Solution 6 - GnuplotRomainView Answer on Stackoverflow