Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot 2D/3D points with labels #35

Closed
octavian-ganea opened this issue Sep 29, 2016 · 7 comments
Closed

plot 2D/3D points with labels #35

octavian-ganea opened this issue Sep 29, 2016 · 7 comments

Comments

@octavian-ganea
Copy link

Is it possible to plot 2d/3d points with labels? That would be useful for visualizing word embeddings for example. Thanks.

@Atcold
Copy link
Contributor

Atcold commented Oct 11, 2016

You can use the gnuplot.raw() function to enable it.

@suryabhupa
Copy link
Contributor

suryabhupa commented Dec 6, 2016

As an example, for anyone wondering in the future:

g = require 'gnuplot'
g.pngfigure('plots.png')
g.title('Plots of data')
g.raw("plot 'data.txt' using 2:3:(sprintf('(%d)', $1)) with labels point pt 7 offset char 1,1 notitle")
g.raw("set term png size 1280, 960") -- sets size of plot
g.xlabel('x')
g.ylabel('y')
g.plotflush()

where data.txt might look like this:

1     0.34    0.5
2     0.26    0.6
3     0.11    0.7
...

@suryabhupa
Copy link
Contributor

However, are there ever plans to add labeling support natively? Labels seem important and someone not versed in gnuplot may struggle with finding the right raw command.

@soumith
Copy link
Member

soumith commented Dec 7, 2016

@suryabhupa the answer is no, unless someone sends a PR.

@suryabhupa
Copy link
Contributor

While the labeling might be more of a specific case, I can add an example in the docs?

@soumith
Copy link
Member

soumith commented Dec 7, 2016

sounds good

@suryabhupa
Copy link
Contributor

See #39.

@soumith soumith closed this as completed Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants