comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Adding Text/Equations to Plots
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Adding Text/Equations to Plots [message #65705] Mon, 16 March 2009 11:53
Heather is currently offline  Heather
Messages: 2
Registered: March 2009
Junior Member
Hello,
I'm hoping someone can help me figure out a way to add equations to a
plot. I used POLY_FIT to find the coefficients of a line for my data,
and plotted that line. I really want to add the equation of that line
to my plot.

I thought I could use legend.pro (a routine I found at
http://astro.uni-tuebingen.de/software/idl/astrolib/plot/leg end.pro
that I am already calling in my routine anyhow), but that requires the
input "items" be a string. And I couldn't figure out how to create a
string that would call the elements of the array in which the
coefficients are.
(This is what I tried:
IDL> numbers=findgen(10)
IDL> string="This is a number: numbers(6)"
IDL> print, string
This is a number: numbers(6)

Clearly not what I want. And I can't do something like:
IDL> string1="This is a number: "
IDL> print, string1, numbers(6)
This is a number: 6.00000

because what it will actually look like to the legend.pro routine is:
IDL> string2="This is a number: " numbers(6)

string2="This is a number: " numbers(6)
^
% Syntax error.

Any advice would be greatly appreciated, but I'm fairly new to the
world of IDL, so please use "simple" explanations!
Thanks,
Heather
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Running bucles on LINUX terminal
Next Topic: Re: Adding Text/Equations to Plots

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:50:25 PDT 2025

Total time taken to generate the page: 0.00463 seconds