Legend of markers in Plot3d

classic Classic list List threaded Threaded
5 messages Options
linebergmann linebergmann
Reply | Threaded
Open this post in threaded view
|

Legend of markers in Plot3d

I am trying to do a solubility plot of a salt where I have two independent variables (temperature and pressure). Thus it is a 3d scatter plot. I have figured out how to make different styles of markers and different colors. But I would really like to have a legend where the marker was shown next to the series name.

When I tried legends I got a line and only the first series name. Then I tried legend, but that does only give me an error:
!--error 10000
legend: No 'Polyline' handle found.
at line      73 of function legend called by :  
legend(['error1';'error2'],"in_lower_left");

And I cant figure out what the polyline handle is or how to apply it. Any ideas?

I have written this
T02=[224 223 253 253 171 167 118 98 98.5 100 149 150 245 245 246 245];

P02=[134 126 124 128 12 8 5 478 492 492 500 500 502 482 106 103];

C02=[71 69 58 57 77 76 84 106 108 113 115 121 88 92 58 62];

T4=[96.5 94.5 95.5 94 96 95 153 153 152.5 152.5 151 152 202 202 203 203 202.5 200 200];

P4=[520 480 500 106 106 92 560 512 492 500 500 505 456 500 507 498 499 470 492];

C4=[324 311 307 260 265 255 530 510 500 530 520 490 690 730 760 690 740 730 640];

plot3d(T02,P02,C02);
e02=gce();
e02.surface_mode = "off";
e02.mark_mode = "on";
e02.mark_size = 5;
e02.mark_style = 14;
e02.mark_foreground = 3;
e02.mark_background =2;
plot3d(T4,P4,C4);
e4=gce();
e4.surface_mode = "off";
e4.mark_mode = "on";
e4.mark_size = 5;
e4.mark_style = 3;
e4.mark_foreground = 6;
e4.mark_background =7;
xlabel(["Temperature";"(Celsius)"]);
ylabel(["Pressure";"(bar)"]);
zlabel(["Concentration";"mikromoles/kg H2O"]);
tight_limits = "on";
set(gca(),"data_bounds",[0,-10,0;300,600,800]);
legend(['error1';'error2'],"in_lower_left");
Stanislav Stanislav
Reply | Threaded
Open this post in threaded view
|

Re: Legend of markers in Plot3d

Hi.

Try "legends":

legends(['error1';'error2'],[-e02.mark_style -e4.mark_style],"ur");

Stanislav
linebergmann linebergmann
Reply | Threaded
Open this post in threaded view
|

Re: Legend of markers in Plot3d

Thanks a lot. That helped. Now I would like to not only have the style of the marker in my legend but also the color since I have way more than just these two groups of data in the real set. I have tried typing in background there also, but that just changes the style not the color.

/Line


2013/5/15 Stanislav [via Scilab / Xcos - Mailing Lists Archives] <[hidden email]>
Hi.

Try "legends":

legends(['error1';'error2'],[-e02.mark_style -e4.mark_style],"ur");

Stanislav


If you reply to this email, your message will be added to the discussion below:
http://mailinglists.scilab.org/Legend-of-markers-in-Plot3d-tp4026703p4026704.html
To unsubscribe from Legend of markers in Plot3d, click here.
NAML

Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: Legend of markers in Plot3d

Hello,

________________________________
De la part de linebergmann
Envoyé : jeudi 16 mai 2013 09:14

> Now I would like to not only have the style of the marker in my legend
> but also the color

You can do this by torturing the handles.

Unfortunately, this does not seem to be documented...

By tries and errors, I found out that the legend is represented by a
matrix of handles, called hereafter leg.children

You can see which handle correspond to which graphical element with

leg.children(n).visible="off"

Once you have identified them, everything is "quite simple".

Then try the following

// **********

legends(['error1';'error2'],  [-e02.mark_style -e4.mark_style], "ur");

leg=gce();

leg.children(4).mark_foreground = e02.mark_foreground;
leg.children(4).mark_background = e02.mark_background;

leg.children(2).mark_foreground = e4.mark_foreground;
leg.children(2).mark_background = e4.mark_background;

// **********

Best regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Legend of markers in Plot3d

In reply to this post by linebergmann
Hello,
Le 16/05/2013 09:13, linebergmann a écrit :
> Thanks a lot. That helped. Now I would like to not only have the style
> of the marker in my legend but also the color since I have way more
> than just these two groups of data in the real set. I have tried
> typing in background there also, but that just changes the style not
> the color.
If you have many curves to be legended on the same axes or figure,
you may have a look at http://fileexchange.scilab.org/toolboxes/274000

Samuel
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users