Is there a standard file extension for gnuplot files?
Asked Answered
S

9

78

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!"?

Sally answered 31/3, 2011 at 9:42 Comment(0)
P
60

As Romain, Dr. Person and neillb all point out and this wikibooks article 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 .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.

Pestle answered 7/4, 2012 at 10:47 Comment(2)
Gnuplot for Windows now sets the default extension for when you want to open a gnuplot script as *.pltBlend
FWIW, linguist recognizes .gp, .gnu, .gnuplot, .p, .plot, and .plt.Michal
C
34

vim recognises .gpi, for more see Gnuplot Wikibook.

Corespondent answered 20/8, 2011 at 18:55 Comment(4)
What does the i in gpi stand for?Unknot
@knub: The Help for PLTGRAF seems to suggest “gnuplot instruction file” (search for “PLOT NAMING CONVENTIONS”).Ez
As of Vim 8.2.4187, Vim also recognizes .gnuplot files.Ibnsaud
That vim patch is for literal .gnuplot file, not extension. Sigh.Fusion
T
15

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

Tieback answered 27/8, 2012 at 9:39 Comment(0)
D
6

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.

Darya answered 7/5, 2011 at 12:38 Comment(1)
This is the best extension, all others are too cryptic. Shame it has little editor support. The shebang helps Vim there.Surfboat
J
3

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.

Jamilajamill answered 29/9, 2011 at 14:8 Comment(0)
N
1

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".

Nitid answered 31/3, 2011 at 9:59 Comment(0)
G
1

Worth noting. Visual Studio Code has an extension for gnuplot syntax highlighting. It defines 5 extensions for gnuplot files:

  • .gp
  • .gnuplot
  • .gnu
  • .plot
  • .plt
Gyral answered 10/7, 2022 at 8:56 Comment(0)
P
1

At least on Windows, the gnuplot installer associates the following file extensions with gnuplot:

  • .gpl
  • .gp
  • .plt

Creating these file associations is optional.

Source: https://sourceforge.net/p/gnuplot/patches/552/

Paries answered 15/3, 2023 at 10:6 Comment(0)
B
1

In freedesktop, .gp, .gplt, .gnuplot are used

Beheld answered 24/5, 2023 at 20:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.