Gnuplot problems (maybe wrong category)

  • Thread starter Thread starter Inferior89
  • Start date Start date
  • Tags Tags
    Gnuplot
Click For Summary
SUMMARY

The discussion centers on issues encountered while using Gnuplot with the epslatex terminal, specifically regarding the disappearance of axis labels. The user provided a code snippet that successfully generates a plot but initially only viewed the .dvi file, which did not display the labels correctly. The solution involved converting the .dvi file to a .ps file, which resolved the issue and allowed the labels to appear as intended.

PREREQUISITES
  • Familiarity with Gnuplot version 5.4 or later
  • Understanding of terminal types in Gnuplot, specifically epslatex
  • Basic knowledge of LaTeX for formatting plots
  • Experience with file conversions from .dvi to .ps
NEXT STEPS
  • Learn how to use Gnuplot's epslatex terminal effectively
  • Research methods for converting .dvi files to .ps files
  • Explore advanced Gnuplot features for customizing plot labels
  • Investigate troubleshooting techniques for common Gnuplot issues
USEFUL FOR

This discussion is beneficial for data scientists, physicists, and anyone using Gnuplot for scientific visualization, particularly those facing issues with LaTeX formatting in plots.

Inferior89
Messages
127
Reaction score
0
Hey, this might be the wrong place to ask this question but I have a few problems using gnuplot. The problem is that when using the epslatex terminal my labels on the axis dissapears.

This is the code I am using
Code:
set terminal latex or epslatex color or wxt
set output "psifunc.tex"
h = 1.054571628E-34
psi(x) = 1/((pi*h)**(1.0/4.0))*exp(-1/(2*h)*x**2)
set title ''
set format xy '$%g$'
set ylabel 'Sannolikhetstathet'
set xlabel '$A$'
set xrange [-4*sqrt(h/2):4*sqrt(h/2)]
set xtics ('$-4\sqrt{\frac{\hbar}{2}}$' -4*sqrt(h/2),\
     '$-2\sqrt{\frac{\hbar}{2}}$' -2*sqrt(h/2),\
     '0' 0,\
     '$2\sqrt{\frac{\hbar}{2}}$' 2*sqrt(h/2),\
     '$4\sqrt{\frac{\hbar}{2}}$' 4*sqrt(h/2)) nomirror
plot psi(x)**2 title '$|\psi_1(A)|^2$'
unset output

And here are the results:
http://i.imgur.com/rGW73.png

Don't really know why it is not working. It seems to work fine in the other terminals.
 
Physics news on Phys.org
I figured it out but it is almost too embarrasing to say what I did wrong..

There was nothing wrong with my gnuplot code. The problem was I was only looking at the freaking .dvi file. What you need to do is run .dvi --> .ps and then watch the .ps file and everything will work.

Here are the graphs when I got it to work:

http://imgur.com/30Bll.png
http://imgur.com/4gZ8g.png
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
24
Views
3K
  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K