Re: HLU contour plots lack line labelling, no control

From: Dave Kennison (kennison AT unknown)
Date: Thu Jul 29 1999 - 10:27:43 MDT


All,

Attached are (1) a question posted by John Glendening and (2) a response
from "ncarg-talk-owner". The response was fine as far as it went, but one
other key suggestion needed to be made.

I strongly suspect that what John needs to do is to increase the value of
the CONPACK parameter "RWC" from the default "100" to something larger (in
which case he may also need to increase the dimension of the real workspace
array that he is using).

When you contour from a very large array of data, each contour line is
defined by a large number of points and a 100-point chunk of such a contour
line won't stretch very far across the plotter frame. Because all of the
label-positioning schemes in CONPACK work with such chunks, it appears to
them as if there's no room for labels on such short line segments. Using
200-point chunks or 500-point chunks or 1000-point chunks solves the problem.

I apologize for the lateness of this response (I've been tied up adding
county boundaries and Canadian provinces to the EZMAP database), but I'm
posting it in hopes that it may still be of interest.

Dave Kennison

(original messages follow)

John Glendening wrote:
---- ---------- ------

> I have just finished an HLU contour plotting program, but find the
> plots it produces confusing, and even more importantly unpublishable,
> because the HLU line labelling produces _very_ few line labels so the
> value of many of the lines is ambiguous. HLU gives no control over
> the spacing between labels on a given contour so I seem to have no way
> of fixing the problem. Perhaps someone who uses HLU contour plotting
> (does anyone?) will have a brilliant solution.
>
> These are not plots with strange or jagged contour patterns. There
> is plenty of space for the labels, given the label size and the
> spacing between differing contour lines. There is no tightly packed
> contours problem and the lines are fairly smooth. A sample plot has
> about 9 contour lines of reasonable length, many extending over the
> entire x domain - but at best I can get only 2 of the lines to be
> labelled. This is despite trying to force _every_ line to be labelled
> by setting
> cnMonoLevelFlag = True
> cnLevelFlag = LineAndLabel
>
> I have been using the default value of cnLineLabelPlacementMode, but
> setting it to "Computed" gives the same result and setting it to
> "Constant" gives 0 labelled lines, so that is not a solution.
>
> The only thing that I can think is unusual is that the grid consists
> of a large number of points in the x direction (960) and perhaps lines
> that appear relatively smooth in the displayed plot have a fine-scale
> jaggedness which confuses the line label plotting routine. But if
> that were really the problem, I wouldn't think it would produce _any_
> line labels, yet it does - just not very many.

"ncarg-talk-owner" replied:
------ ---- ------ --------

> We apologize for the scarcity of documentation on this issue, but in fact
> it is possible to control the density of line labels in an HLU contour plot.
>
> First, you need to know that for the "Constant" line label placement mode, the
> labels are actually rendered as part of a line dash pattern. Admittedly,
> this is not obvious, particularly when you are using the default solid line
> pattern. However, the consequence is that you can control the spacing between
> labels by setting the line dash segment length resource, cnLineDashSegLenF.
>
> Although there are no native HLU resources for controlling line label
> placement when using the "Randomized" or "Computed" modes, there is a
> currently undocumented resource that allows access to a number of otherwise
> inaccessible parameters belonging to the LLU Conpack package that underlies
> the HLU ContourPlot. It is a string array resource called cnConpackParams.
> Here is an example of its use in a resource file:
>
> *cnConpackParams: (/ RC1:0.05 , RC2:0.1 , RC3:0.05 , \
> PC1:7.0 , PC2:20.0 , PC3:120.0 , PC4:0.01 , PC5:0.05 , PC6:0.05 , \
> PW1:0.0 , PW2:0.0 , PW3:0.0 , PW4:0.0 /)
>
> Each element of the array is a string consisting of a Conpack parameter
> name and its desired value separated by the colon character. If set
> in the program source you would need to quote each string. This example
> includes all the parameters that affect the "Randomized" and "Computed"
> placement modes, and the values set should result in the appearance of
> more labels than the default settings. Look at
>
> http://ngwww.ucar.edu/ngdoc/ng4.1/supplements/conpack/#ParameterDescriptions
>
> for a description of each of these parameters, and at
>
> http://ngwww.ucar.edu/ngdoc/ng4.1/supplements/conpack/#IntroPenaltyScheme
>
> for a discussion of the algorithm and parameters used by the "Computed"
> placement mode.
>
> I should mention that the only Conpack parameters accessible using the
> cnConpackParams resource are ones that are never set in the HLU code and
> have been judged to have no interaction with any parameters the HLU code
> does set. Here is a categorized list of the Conpack parameters that can be
> set using cnConpackParams:
>
> Contour hachuring control
> HCL
> HCS
> HCF
>
> High/low label density
> HLX
> HLY
>
> "Computed" label placement ("Penalty scheme" in Conpack)
> PC1
> PC2
> PC3
> PC4
> PC5
> PC6
> PW1
> PW2
> PW3
> PW4
>
> "Randomized" label placement ("Regular scheme" in Conpack)
> RC1
> RC2
> RC3
>
> Point interpolation for lines and edges
> PIC
> PIE
>
> Low level workspace control parameters
> IWM
> RWC
> RWG
> RWM
>
> cnConpackParams has not been documented as a resource because the intention
> has always been to provide access to these features through the HLU
> interface. However, since it may be some time before we have the chance
> to implement HLU access, perhaps we should document the control that
> is available. Once again, apologies for the current lack of information
> on this subject.



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:40:37 MDT