Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5003 > unrolled thread

Re: Defining the labels to display in ContourLabels

Started by"David Park" <djmpark@comcast.net>
First post2011-09-16 09:50 +0000
Last post2011-09-16 09:50 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Defining the labels to display in ContourLabels "David Park" <djmpark@comcast.net> - 2011-09-16 09:50 +0000

#5003 — Re: Defining the labels to display in ContourLabels

From"David Park" <djmpark@comcast.net>
Date2011-09-16 09:50 +0000
SubjectRe: Defining the labels to display in ContourLabels
Message-ID<j4v64i$c65$1@smc.vnet.net>
The Presentations package has a DrawLineLabels routine that can be used to
label any list of curves that are characterized by constant value functions
- such as contour lines. This allows a selected set of lines to be labeled.

Here is the plotting statement for your example.

<< Presentations` 

Module[
 {contourlist = Range[9]/10 // N,
  labeledlist = Range[1, 9, 2]/10 // N, f, g},
 f[x_, y_] := Cos[x*y]/Exp[x^2 + y^2];
 Draw2D[
  {g = ContourDraw[f[x, y], {x, -2, 2}, {y, -2, 2},
     Contours -> contourlist,
     ContourLabels -> None,
     ColorFunction -> ColorData["BrownCyanTones"]],
   g // DrawLineLabels[f[#1, #2] &, 0.4 + #/10 &, 0.001, labeledlist,
     DrawLLTextOptions -> {Background -> ColorData["Legacy", "Gold"], 
       BaseStyle -> {FontSize -> 8, FontFamily -> "Helvetica"}}]},
  Frame -> True,
  ImageSize -> 250]
 ] 

A PDF and notebook with extended discussion, and an additional method, will
appear at Peter Lindsay's site at St. Andrews University. 

http://www.st-andrews.ac.uk/~pl10/c/djmpark/ 


David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/  









From: Luiz Melo [mailto:lmelo@ufsj.edu.br] 

Hi there. Assuming:

ContourPlot[Cos[x*y]/Exp[x^2 + y^2], {x, -2, 2}, {y, -2, 2}, ContourLabels
-> All, Contours -> 9]

I would like to keep the number of contours (9) and to label only those of
values 0.9, 0.7, 0.5, 0.3, 0.1

How?

Thank you.

-- 
Prof. *Luiz Guilherme C.
Melo*<https://sites.google.com/site/luizguilhermecmelo/home>
Telecommunication engineering
Universidade Federal Sao Joao del-Rei
Campus Alto Paraopeba
Rodovia MG 443, Km 7
Ouro Branco - MG
36420-000 - Brazil

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web