Re: Shift label positions in contour plots? [message #68159] |
Wed, 30 September 2009 11:16 |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Sep 30, 11:57 am, David Fanning <n...@dfanning.com> wrote:
> It is NOT possible using the direct graphics routine CONTOUR.
>
> You would have a great deal more control if you were to use
> the object graphics routine IDLgrCONTOUR. But, there would
> be a significantly longer learning curve. You might be able
> to use XContour from my web page as a place to jump-start
> the process:
It is easy using icontour instead of contour. The keyword
c_label_interval probably can solve this, using a different interval
for each plot. If its keywords or editing interactively is not enough,
you can get its contour object and change only what is needed, which
would save the work of setting up all the objects.
|
|
|
Re: Shift label positions in contour plots? [message #68160 is a reply to message #68159] |
Wed, 30 September 2009 10:33  |
Charles[1]
Messages: 2 Registered: September 2009
|
Junior Member |
|
|
Thanks, David -- I didn't realize it was a nontrivial problem. I came
up with an inelegant solution that will save time (in the short
term). I can budge the labels a bit by making strings with extra
spaces:
labeltext=' 0.'+STRTRIM(indgen(10),2)+' '
Then I explicitly use those strings as the contour labels:
contour, z0, x, y, c_annotation=labeltext ...
Because of the spaces, there are now slight gaps in the contours but
on the whole it's an improvement.
Chaz
|
|
|
Re: Shift label positions in contour plots? [message #68162 is a reply to message #68160] |
Wed, 30 September 2009 07:57  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Charles writes:
> Using "contour", I've made a contour plot with 3 sets of contours.
> I've got them with no fills and each has a different line style. I've
> labeled the contour levels, so the value of each contour appears along
> the curves in a couple of places:
>
> contour, z0, x, y, levels=findgen(10)/10d, c_labels=findgen(10),
> c_charsize=1, ,c_line=0
> contour, z1, x, y, levels=findgen(10)/10d, c_labels=findgen(10),
> c_charsize=1, ,c_line=1, /overplot
> contour, z2, x, y, levels=findgen(10)/10d, c_labels=findgen(10),
> c_charsize=1, ,c_line=2, /overplot
>
> A sample of the plot is here: http://bit.ly/12e1Y7
>
> My problem is that the labels overlap with each other in several
> places. If the contour sets were similar enough, I would just label
> one set and imply that each label applied to all of the nearest
> curves. But each contour set is different, so I need a label on every
> contour. I'd prefer not to decrease the font size very much.
>
> My question is - it is possible to shift the positions of the labels
> along the contours using "contour" or some other routine?
It is NOT possible using the direct graphics routine CONTOUR.
You would have a great deal more control if you were to use
the object graphics routine IDLgrCONTOUR. But, there would
be a significantly longer learning curve. You might be able
to use XContour from my web page as a place to jump-start
the process:
http://www.dfanning.com/programs/xcontour.pro
XContour is *very* old. If you manage to improve it, I'd like
to hear about it. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|