Warning: incorrect parameter in LEGSEL

16 views
Skip to first unread message

Andi Z

unread,
Apr 4, 2026, 2:11:54 PMApr 4
to dislin-users
Hi Helmut & community,

I am using custom legend features using LEGPAT and LEGSEL since I have a lot of points/curves to plot but want to only show the legend entries of a subset. When selecting to show more than 30 lines (curves) in the legend with Dislin 11.5, I get an "incorrect parameter in legsel" warning. My understanding is that now up to 80 legend lines can be shown in principle, but LEGSEL may still issue a warning if size(iray) > 30 (but  < 80); this is possibly an oversight since the other legend-related subroutines don't issue warnings in this case. 

Best,
Andi

Helmut Michels

unread,
Apr 8, 2026, 4:05:26 AM (11 days ago) Apr 8
to dislin-users
Hi Andi,

you are right, I have forgotten to make the change also in LEGSEL. Which Dislin library are you using?
I will try to send you a updated library.

With best regards,

Helmut

Andi Z

unread,
Apr 8, 2026, 1:03:32 PM (11 days ago) Apr 8
to dislin-users
Thank you for confirming this. I currently use the Windows "Intel compilers icl, ifort 64-bit" library, though I mostly use 30 or less legend entries, so no rush.

I have a related, more niche question about LEGPAT (possibly a feature request).  I may be overlooking something that could be done with the current options, in that case I'd appreciate some hints for that.
The issue: Is there a straightforward way to save all curve properties with LEGPAT or similar routines to fully reproduce the style and color shown on the plot with CURVE once generating the LEGEND? I noticed that LEGPAT does not retain information about the specifics related to calls to LNCAP ("ROUND") vs. ("CUT") etc., when these attributes change between different curves plotted on the same graph (or when I use a non-standard line type). It is also not easy to assign the correct color of a curve in the legend when more than one color palette is used (different ones loaded for different curves, but only one loaded prior to the call to LEGEND). In some of my plots, I use negative color values to load e.g. a grey scale palette while positive color values refer to my standard (custom) palette. It may be possible to code a workaround for that by splitting the legend into different parts, but if LEGPAT would store the RGB value and additional pattern and line capping attributes directly as used in the call to CURVE, that would be more versatile and convenient. This is more of an issue in cases where I need to use LEGPAT to store only a small subset of symbols/curves out of a set that exceeds the maximum number of legend lines. Any ideas for how to best handle such cases would be appreciated.

Best,
Andi

Helmut Michels

unread,
Apr 9, 2026, 5:01:32 AM (10 days ago) Apr 9
to dislin-users
Okay, LNCAP is not taken into account in legend lines. I can fix this. LEGPAT accepts colour  values for the
legend lines. A colour value can either be an index of a colour table, or an explict RGB value, that can be
created with the Dislin routine INTRGB. For example:  iclr = intrgb (red, green, blue), where red, green, blue are
values between 0 and 1. This should solve the problem with multiple colour tables.

With best regards,

Helmut

Andi Z

unread,
Apr 9, 2026, 6:45:22 PM (9 days ago) Apr 9
to dislin-users
Thank you, good to know about both. I was now able to use a call to GETIND(iclr, red, green, blue) followed by the iclr = intrgb(red, green, blue) function to set the explicit RGB value I needed based on the custom color table loaded prior to GETIND.

Best,
Andi

Reply all
Reply to author
Forward
0 new messages