Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

changing colorbar graph3

40 views
Skip to first unread message

Hanna Liashenko

unread,
Jul 13, 2023, 3:19:20 PM7/13/23
to dislin-users
Hello.
 I have one question. Can i change colorbar (zaxis, the color scale in the picture) in graph3 using DISLIN or create own colors? For example i have 3 axis with values - x,y,z. When z >=1.5, then color - dark red, z>=0.5 - color blue. 1.png

Helmut Michels

unread,
Jul 14, 2023, 6:02:30 AM7/14/23
to dislin-users
Dear Hanna,

yes, you can do this with the routine

     setind (i, xr, xg, xb),

where i is a colour index between 0 and 255 and xr, xb, xg   are the RGB colours in the range 0 to 1.

With best regards,

Helmut

Hanna Liashenko

unread,
Jul 14, 2023, 7:25:46 AM7/14/23
to dislin-users
Dear Helmut, 
thank you for reply. I will try to do this. I need to have scale similar like in the picture. Maybe in this case it is better to convert the z-axis value to color with routine COLRAY? 1.png

пятница, 14 июля 2023 г. в 12:02:30 UTC+2, mic...@dislin.de:

Helmut Michels

unread,
Jul 14, 2023, 1:16:43 PM7/14/23
to dislin-users
Hi Hanna,

here is a short example code where I have changed the Dislin colour table with your colours.
I have used the routine myvlt instead of setind for defining multiple colour entries.
Note, that the entries 0 and 255 are defined with white and black since the plot is in reverse
mode.  The routine colray calculates just colour indices to given z values. I doesn't help you for
changing colours in the colour bar.

With best regards,

Helmut
t1.c
dislin.png

Hanna Liashenko

unread,
Jul 14, 2023, 3:30:10 PM7/14/23
to dislin...@googlegroups.com
Hello, Helmut. Thank you very much for your help and for the code example. I have done the same result but with routine INTRGB and it's also working. I will think about how to solve the problem with the correct marking of values on the color scale, as in the previous example.

пт, 14 июл. 2023 г. в 19:16, Helmut Michels <mic...@dislin.de>:
--
You received this message because you are subscribed to a topic in the Google Groups "dislin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dislin-users/vBlP5z3kdKY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dislin-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dislin-users/fd1e058a-cf14-4799-abba-0da6d1f1776an%40googlegroups.com.

Hanna Liashenko

unread,
Jul 14, 2023, 3:32:14 PM7/14/23
to dislin...@googlegroups.com
Sorry, not INTRGB but SETIND 

пт, 14 июл. 2023 г. в 21:29, Hanna Liashenko <anyalyash...@gmail.com>:

Hanna Liashenko

unread,
Aug 8, 2023, 4:15:32 AM8/8/23
to dislin-users
Hi, Helmut. I have one question. Can i create and save dislin graph as JPG file? 

пятница, 14 июля 2023 г. в 21:32:14 UTC+2, Hanna Liashenko:

Helmut Michels

unread,
Aug 8, 2023, 5:28:03 AM8/8/23
to dislin-users
Hi Hanna,

no, you can save the graph as a PNG file and convert it with a third-party program to a JPG file.
For example with IrfanView.

With best regards,

Helmut

Hanna Liashenko

unread,
Aug 8, 2023, 5:32:43 AM8/8/23
to dislin-users
ok...thank you for the quick reply!

вторник, 8 августа 2023 г. в 11:28:03 UTC+2, mic...@dislin.de:
Reply all
Reply to author
Forward
0 new messages