Skip to content

surface, array, shades=shades has problems. #1507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jtappin opened this issue Feb 8, 2023 · 4 comments
Closed

surface, array, shades=shades has problems. #1507

jtappin opened this issue Feb 8, 2023 · 4 comments

Comments

@jtappin
Copy link

jtappin commented Feb 8, 2023

I was actually quite surprised that this even attempted to do anything, but the shades keyword to colour a surface plot clearly has problems.

r = [0b, 255b, 255b, 0b, 0b]
g = [0b, 255b, 0b, 255b, 0b]
b = [0b, 255b, 0b, 0b, 255b]

device, decomp = 0
tvlct, r, g, b

pattern = hanning(120, 120)

shades = replicate(1b, 120, 120)

locs = where(pattern gt 0.3)
shades[locs] = 3b
locs = where(pattern gt 0.5)
shades[locs] = 4b
locs = where(pattern gt 0.7)
shades[locs] = 2b

surface, pattern, shades = shades, charsize = 2

end

IDL produces: idl_surf
GDL produces: gdl_surf
and a lot of error messages like:

*** PLPLOT WARNING ***
plcol1: Invalid cmap1 index
Further information relevant to this warning:
Invalid index = -4.993116e-01
Corrected index = 0.000000e+00

I'm guessing that we're pushing plplot over the edge again!

@GillesDuvert
Copy link
Contributor

Yes... And no, plplot pretends to be able to colorize surfaces, too. Due to clunky documentation the passing of arguments to the plplot function may not be OK. looks like it is related to an ancient plplot's problem with colormaps.

@GillesDuvert
Copy link
Contributor

@jtappin in fact plplot proposes to colorize the mesh, but only as a function of z, in a undescribed manner, but roughly from color0 (bottom) to color255 (top).
try:

 tvlct, r, g, b
(...)
surface, pattern, shades = shades = [0,3,2,4,6,8,20], charsize = 2,zv=0.5

the zv=0.5 is to prevent the plplot errors, themselves related to the shade_surf problem #1438 , that I hope to solve soon.

@GillesDuvert
Copy link
Contributor

OK, found a workaround (yet another)...
#1515 provides now a better shade_surf and surface (not in all cases though, due to inherent limitation of plplot),
but I've removed the SHADE option as it is absolutely impossible to reproduce with plplot at all.

@jtappin
Copy link
Author

jtappin commented Feb 17, 2023

OK, found a workaround (yet another)... #1515 provides now a better shade_surf and surface (not in all cases though, due to inherent limitation of plplot), but I've removed the SHADE option as it is absolutely impossible to reproduce with plplot at all.

That's a pity, though I did rather suspect from the results that I was getting that that would be the case. Thanks for investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants