second y-axis

11 views
Skip to first unread message

Karo Lina

unread,
Aug 8, 2022, 6:57:49 AM8/8/22
to dislin-users

Hi all, 

I have two data sets and want to display the curves in one graph. The x-values of both curves are identical but the y-values are very different. So I would like to create a coordinate system with one y-axis at the left end of the x-axis (for the first curve) and a second y-axis with a different scaling at the right end of the x-axis (for the second curve). Is this possible with DISLIN?


Best Regards!

Helmut Michels

unread,
Aug 8, 2022, 7:20:23 AM8/8/22
to dislin-users
Hi,

this is easy to do. You can draw two axis systems at the same position. One for the left
y-axis and one for the right y-axis. For example:

        setgrf ("name", "name", "ticks", "none");  //defines lower x-, left y-axis and upper ticks
        graf (0., 10., 0., 2., 0., 100., 0., 20.);
        curve (...);                                                     // the curve for the left y-scaling
        endgrf ();

        setgrf ("none", "none", "none", "name");     // defines just the right y-axis
        graf (0., 10., 0., 2., 100., 200., 100., 20.);   // plots the right y-axis
        curve (...);                                                       // the curve for the right y-scaling
        endgrf ();

Of cource, you should give some information on your plot, which curve belongs to which
y-scaling.

With best regards,

Helmut
Reply all
Reply to author
Forward
0 new messages