Since I do not have Origin (the scientific software, not the EA Steam-copy-paste) I tried to use alternatives like SciDavis or QtPlot. After struggling for hours to get what I needed, I went back to the roots using GNUPlot.
I hereby post a little script that I used to print the same function with different parameters. The function is a LogNormal distribution and I think that, for a fast visualization, my script is more then enough for everyone.
It's not that easy to find all the commands together in a single example and I don't want to waste any more hours looking around.
Comments start with '#' character.
f(x,m,s,d)=1/((x-d)*s*sqrt(2*pi))*exp(-(log(x-d)-m)**2/(2*s*s))
#the function I want to plot with parameters m, s, d and variable x
set autoscale
set border 3 front
set tics nomirror out scale 0.75
#these two lines remove the top and right borders, leaving only the 2 xy axes
set yrange [0:0.22]
set xrange [0:35]
#set the min-max range of the two axes x and yù
set ytics 0.025
set xtics 2
#set the spacing on axes, the tics
set ylabel "p(D)"
set xlabel "E.C.D. [nm]"
#sets the label to the axes
plot f(x, 2.38, 0.38, 0) notitle lt -1 lw 2
#plots the 1st function without graph legend, with lines of color -1 (black) and line width of 2 (thicker line than default)
replot f(x, 1.60, 0.46, 1.8129) notitle lt 1 lw 2
#plots the 2nd graph without erasing the first and changing only the color to 2 (red)
pause -1
#this is needed if you call gnuplot via terminal in order to have the image not disappears after few moments
Nessun commento:
Posta un commento