Gnuplot and adding function name to legend

  • Thread starter Thread starter wellcaffeinated
  • Start date Start date
  • Tags Tags
    Function Gnuplot
AI Thread Summary
The discussion centers on the challenge of automatically adding fitted function values to a legend in gnuplot when plotting data. Users express frustration over the lack of a straightforward solution within gnuplot, despite exploring available resources. A suggested workaround involves scripting on a Unix-like system to automate the extraction of fit variables for inclusion in the plot legend, although this is acknowledged to be labor-intensive. Personal experiences highlight the efficiency gained through scripting, with one user recounting how they saved significant time and resources in a professional setting by automating data plotting processes. The conversation also touches on the balance between expertise and job security in the industry, noting that while skills can lead to recognition, they may also pose risks in terms of job stability.
wellcaffeinated
Messages
4
Reaction score
0
Hi,
I've searched endlessly for an answer to this seemingly simple question, without success.
I am fitting a lot of data and I am plotting the data and the fit on the same graph. I would like to have gnuplot automatically add the function (with the values determined by the fit) to the legend. Doing this by hand would be very tedious. Any ideas would be appreciated.

thanks
 
Computer science news on Phys.org
did you try

http://t16web.lanl.gov/Kawano/gnuplot/index-e.html

and the gnuplot site

http://www.gnuplot.info/

I have found both of these helpful
 
Last edited by a moderator:
unfortunately yes :D
I have tried both of those references. thanks anyway.
Any other suggestions?
 
Are you using a *nix box? If so, you could write a script to run the plot and curve fit, then extract teh correct variables out of the fit then put them back into the plot as the legend. Lot of work for something that you could do by hand for a few cases, but if you have many data sets to do it would be worth the effort.
 
Yeah, I considered doing that. I figured for a program such as gnuplot, there would be some easy way of doing it. But it seems that is the only way.
oh well.
thanks
 
Dr Transport said:
Are you using a *nix box? If so, you could write a script to run the plot and curve fit, then extract teh correct variables out of the fit then put them back into the plot as the legend. Lot of work for something that you could do by hand for a few cases, but if you have many data sets to do it would be worth the effort.

That's exactly what I had to do [via a perl script].
 
robphy said:
That's exactly what I had to do [via a perl script].

When I was in grad school, I would spend hours plotting by hand every data set. When I got out and into industry, I started working a job where if I did that I still would be plotting my first test set. I had to learn how to script using sed & awk along with Korn shell. I once went on a range test, we took over 6 Gig of data (raw ascii file format) in two weeks of range time. It took me a week to write the script and get everything the way I wanted, 3 days to run all the plots ( somewhere in the neighborhood of 25K data sets). I figure I saved the company about two years worth of my salary spending the week learning how to script.
 
Dr Transport said:
I figure I saved the company about two years worth of my salary spending the week learning how to script.

Hopefully, your efforts were acknowledged and rewarded. Don't just get paid for your time... also get paid for your expertise. However, one should be cautious about revealing all because, in some sense, you could script yourself out of a job.
 
robphy said:
Hopefully, your efforts were acknowledged and rewarded. Don't just get paid for your time... also get paid for your expertise. However, one should be cautious about revealing all because, in some sense, you could script yourself out of a job.

Sure, we get acknowledged, but when the programs die your still out of luck and lay-offs occur. You go and find another position and go on. You never script yourself out of a job because no matter how much you do, your customer always wants more and they are in the business of getting as much out of you as they can for the money. You always have to check the contract deliverables and go by them, if they want extra they have to pay extra. In this day and age, expertise may keep you in a job, but if you are paid too well you are always on the top of the list to get laid off. In industry today, a PhD equals more money, but can also equal less securtiy if you can get a job at all.
 

Similar threads

Back
Top