x_tick_unit

22 views
Skip to first unread message

Chris Harvey

unread,
Feb 4, 2020, 4:51:17 PM2/4/20
to GAMA
Hello everyone,

I have made a chart, however I am struggling to show the correct x tick values for the chart.  For my chart, would like to place an x tick once a day.  The x tick itself simply needs to  be a value of 1, 2, 3 ....  I have gone around with this for several hours now and have not made progress.  My simulation has a step = 20 minutes, therefore each day has 72 steps.  I have come close to getting it right a few times, but have not actually managed to have a tick value that is 100% correct.  Here is my code:

display "Functional Response" 
        {
            chart "Tarpon Functional Response" type: series  x_label: 'Days' y_label: "Number of Shrimp Captured" y_tick_unit: 5  x_tick_line_visible:true
            tick_font: 'Monospaced' tick_font_size: 14 tick_font_style: 'bold' label_font: 'Serif' label_font_size: 18 label_font_style: 'plain' 
            x_tick_unit: int(cycle/72)

            {
                datalist value: (Tarpon collect each.chartCount) legend:(Tarpon collect each.name) style: line color: # green;
            }

        }    




I would appreciate any assistance.

Thank you,

Chris

Benoit Gaudou

unread,
Feb 5, 2020, 4:17:00 AM2/5/20
to gama-p...@googlegroups.com
Hi Chris,

The best I can get is the following one:
- I refresh the display every day (to display 1 point per day)
- the information on the x axis is the day number (in x_serie_labels)

display "Functional Response" refresh: every(1 #day)

        {

            chart "Tarpon Functional Response" type: series  x_label: 'Days' y_label: "Number of Shrimp Captured" 

            y_tick_unit: 5  x_tick_line_visible:true

            x_serie_labels: int( (cycle+1)/72)

            {

                datalist value: (Tarpon collect each.chartCount) legend:(Tarpon collect each.name) style: line color: (Tarpon collect each.c);

            }


        }    


I admit that the number on the x axis seems a little bit buggy, as only the value 2 and 7 appears.

Perhaps you could add an issue on the Github.

Cheers

Benoit

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/1f9e313f-ce2a-4378-8b60-d7bf45afd35e%40googlegroups.com.

Philippe Caillou

unread,
Feb 5, 2020, 7:39:11 AM2/5/20
to gama-p...@googlegroups.com
Hi,

Buggy, the charts?  :)
If I understand correctly, this should work:

x_tick_unit: 72 x_serie_labels:int(cycle/72)

Tell me if this is not what you are looking for!

Philippe

Chris Harvey

unread,
Feb 5, 2020, 7:48:51 AM2/5/20
to GAMA
Thank you Benoit.  I will post a bug report when I get home from work tonight. 

Chris

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/-kp3WM0N0ww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/CAD4GtYFyymmUeOc7UO_FjE5SkfciQiQ887e0FUTiq62PbGA3sA%40mail.gmail.com.

Chris Harvey

unread,
Feb 5, 2020, 7:49:46 AM2/5/20
to GAMA
I will test both of these when I get home from work tonight.  Thank you.

Chris

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/-kp3WM0N0ww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gama-platform/CANLjV6nHkkM0j5KEsDr51ABjx7Pf0rH12HgREwOgpU5eGtBwqA%40mail.gmail.com.

Srirama Bhamidipati

unread,
Feb 5, 2020, 8:17:57 AM2/5/20
to GAMA
Philippe Caillou :)

Chris Harvey

unread,
Feb 5, 2020, 9:41:41 PM2/5/20
to GAMA
Hi Philippe,


You were close, however there is one thing.  I am attaching a screenshot of my chart.  If you look at the Functional Response chart (the one with a green line) on the x-axis it reads 0 0 1 2 .  It is that 0 0 that I would like to fix so that it reads 0 1 2 3.  Any ideas?


Chris
To unsubscribe from this group and stop receiving emails from it, send an email to gama-p...@googlegroups.com.

--
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-p...@googlegroups.com.
Screenshot from 2020-02-05 19-46-27.png

Chris Harvey

unread,
Feb 5, 2020, 10:19:38 PM2/5/20
to GAMA
I also tried this code:

display "Functional Response"  refresh: 1 #day

        {
            chart "Tarpon Functional Response" type: series  x_label: 'Days' y_label: "Number of Shrimp Captured" y_tick_unit: 5  x_tick_line_visible:true
            tick_font: 'Monospaced' tick_font_size: 14 tick_font_style: 'bold' label_font: 'Serif' label_font_size: 18 label_font_style: 'plain' 
            x_tick_unit: 72 x_serie_labels:int(cycle/72)+1


            {
                datalist value: (Tarpon collect each.chartCount) legend:(Tarpon collect each.name) style: line color: # green;
            }

        }   
               

and it produced this:


instead of 0 0  1 2 it now goes 1 1 2 3







On Wednesday, February 5, 2020 at 6:39:11 AM UTC-6, Philippe Caillou wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to gama-p...@googlegroups.com.

--
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-p...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages