--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/ovzJIpR0bWY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at https://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.
/**** Name: chart* Author: Srirama Bhamidipati* Description: * Tags: Tag1, Tag2, TagN***/model charts
global {/** Insert the global definitions, variables and actions here */ list<int> prey_available <- [0]; // just to start with 0 list<int> prey_finished <- [0];
reflex randomvalues { add rnd(10) to: prey_available; //add random number to a list add rnd(10) to: prey_finished; //add random number to a list }
}
experiment charts type: gui {/** Insert here the definition of the input and output of the model */ output { display "style_cumulative_style_chart" type: java2D { chart "series chart" type: scatter { data "scatter" value: {sum(prey_available), prey_finished[cycle]} color: #green thickness: 2 marker: true marker_shape: marker_circle; }
}
}
}
To unsubscribe from this group and all its topics, send an email to gama-platform+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at https://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/ovzJIpR0bWY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
Hi Chris,
I am not sure why you get an error with Srirama code, it is working for me…
However, I can try to answer one of your previous questions : have a scatter plot with datalist. I think I may know where the error was :
If you have for example 2 variables (x and y) and 3 agents (1, 2, 3), the value of the datalist should be :
Datalist value :[[x1,y1],[x2,y2],[x3,y3]]
And here is what you are currently giving with your collect statement:
Datalist value :[[x1,x2,x3],[y1,y2,y3]]
Here is an ugly way to correct the error :
Datalist value:rows_list(matrix([[x1,x2,x3],[y1,y2,y3]]));
eg : Datalist value:rows_list(matrix([your x collection, your y collection]))
(does a transposition of the data)
Or whatever other reflex that builds the correct shape.
A better way would be a reverse_data_shape option in the statement… And a good chart documentation :) Soon !
I hope this helps,
Philippe
De : Chris Harvey
Envoyé le :mercredi 9 janvier 2019 04:26
À : gama-p...@googlegroups.com
Objet :Re: [gama (8328)] Re: creating xy chart using datalists
--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
Hi Chris,
Thanks for the model.
The only thing you need for the chart to work now is legends :)
Here it is :
chart "Tarpon Functional Response" type: scatter x_label: "Number of Prey" y_label: "Number of Prey Consumed"
{
datalist legend:Tarpon collect each.name value:rows_list(matrix([Tarpon collect each.num_prey_captured, Tarpon collect each.preyDensity]));
}
And the result :
If this is not what you wanted as a result, tell me !
Hope this helps,
Philippe
De : Chris Harvey
Envoyé le :jeudi 10 janvier 2019 00:00
À : gama-p...@googlegroups.com
Objet :Re: [gama (8330)] Re: creating xy chart using datalists