Gnuplot and adding function name to legend

  • Thread starter Thread starter wellcaffeinated
  • Start date Start date
  • Tags Tags
    Function Gnuplot
Click For Summary

Discussion Overview

The discussion revolves around the use of Gnuplot for plotting data and fitting functions, specifically focusing on the challenge of automatically adding function names to the legend based on fit values. Participants explore various approaches and share their experiences with scripting and manual methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses frustration over the inability to automatically add function names to the legend in Gnuplot, seeking suggestions for a solution.
  • Another participant suggests checking specific Gnuplot resources but acknowledges that the original poster has already tried them.
  • A participant proposes writing a script to automate the plotting and fitting process, extracting variables for the legend, noting that while it is labor-intensive, it may be worthwhile for multiple datasets.
  • Some participants share personal experiences of having to script their plotting processes due to the volume of data, highlighting the time savings achieved through automation.
  • Concerns are raised about job security in relation to automation and scripting, with participants discussing the balance between efficiency and the risk of becoming dispensable in their roles.

Areas of Agreement / Disagreement

Participants generally agree that scripting is a viable solution for handling multiple datasets in Gnuplot, but there is no consensus on whether there is an easier built-in method to achieve the desired functionality.

Contextual Notes

Participants mention the limitations of manual plotting versus scripting, as well as the potential risks associated with automation in the workplace.

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 the 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 the 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

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 2 ·
Replies
2
Views
5K