ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 03 Mar 2013 01:08:48 -0600How would you plot these data points?http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/(x=nodes, y=cycles)
the following 3 sets of data points on the same graph:
IZF (color=red): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)]
vs
Actual (color=black): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)]
vs
c_adj (color=blue): [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)]
i'm not even sure what type graph would be appropriate, whereby you can see reasonably where each point y is, because my current plots (due to y going up to 279,930) shows the different data points coinciding, i.e. you cant differentiate between the initial datapoints.
Fri, 01 Mar 2013 07:26:57 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/Answer by ppurka for <p>(x=nodes, y=cycles)</p>
<p>the following 3 sets of data points on the same graph: </p>
<p>IZF (color=red): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)] <br/>
vs <br/>
Actual (color=black): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] <br/>
vs <br/>
c_adj (color=blue): [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)] </p>
<p>i'm not even sure what type graph would be appropriate, whereby you can see reasonably where each point y is, because my current plots (due to y going up to 279,930) shows the different data points coinciding, i.e. you cant differentiate between the initial datapoints.</p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?answer=14615#post-id-14615Use `list_plot` and logarithmic scale on the y-axis.Fri, 01 Mar 2013 14:34:38 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?answer=14615#post-id-14615Comment by jtaa for <p>Use <code>list_plot</code> and logarithmic scale on the y-axis.</p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18121#post-id-18121see what i've done below. the scale still doesn't work very wellSat, 02 Mar 2013 02:54:44 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18121#post-id-18121Answer by jtaa for <p>(x=nodes, y=cycles)</p>
<p>the following 3 sets of data points on the same graph: </p>
<p>IZF (color=red): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)] <br/>
vs <br/>
Actual (color=black): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] <br/>
vs <br/>
c_adj (color=blue): [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)] </p>
<p>i'm not even sure what type graph would be appropriate, whereby you can see reasonably where each point y is, because my current plots (due to y going up to 279,930) shows the different data points coinciding, i.e. you cant differentiate between the initial datapoints.</p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?answer=14618#post-id-14618**what i've done**
o1=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)],color='red',legend_label='izf')
o2=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] ,color='blue',legend_label='act')
o3=point( [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)],color='blue',legend_label='cadj')
o=o1+o2+o3
plot(o,scale='semilogy')
**the plot i get still doesn't look good. some help if possible?** Sat, 02 Mar 2013 02:54:07 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?answer=14618#post-id-14618Comment by ppurka for <p><strong>what i've done</strong> <br/>
o1=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)],color='red',legend_label='izf') <br/>
o2=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] ,color='blue',legend_label='act') <br/>
o3=point( [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)],color='blue',legend_label='cadj') </p>
<p>o=o1+o2+o3</p>
<p>plot(o,scale='semilogy')</p>
<p><strong>the plot i get still doesn't look good. some help if possible?</strong> </p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18120#post-id-18120Try this:
sage: a = list_plot_semilogy([(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)])
sage: b = list_plot_semilogy([(3,35),(4,105),(5,252),(6,420),(7,360)], color='black')
sage: c = list_plot_semilogy([(3,35),(4,105),(5,252),(6,1260),(7,2910)], color='red')
sage: a+b+c
If you look at the help of `list_plot` you will see that it is not encouraged to have 0's on the plot (when the argument `plot_joined` is False - this is the same as using `point()`). That's because 0's on the logarithmic scale don't make sense and are not handled properly by matplotlib.Sat, 02 Mar 2013 04:20:57 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18120#post-id-18120Comment by jtaa for <p><strong>what i've done</strong> <br/>
o1=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)],color='red',legend_label='izf') <br/>
o2=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] ,color='blue',legend_label='act') <br/>
o3=point( [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)],color='blue',legend_label='cadj') </p>
<p>o=o1+o2+o3</p>
<p>plot(o,scale='semilogy')</p>
<p><strong>the plot i get still doesn't look good. some help if possible?</strong> </p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18119#post-id-18119the plot doesn't seem to show the black and red points at x=3Sat, 02 Mar 2013 04:31:33 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18119#post-id-18119Comment by ppurka for <p><strong>what i've done</strong> <br/>
o1=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)],color='red',legend_label='izf') <br/>
o2=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] ,color='blue',legend_label='act') <br/>
o3=point( [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)],color='blue',legend_label='cadj') </p>
<p>o=o1+o2+o3</p>
<p>plot(o,scale='semilogy')</p>
<p><strong>the plot i get still doesn't look good. some help if possible?</strong> </p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18118#post-id-18118This problem with the point at x=3 is fixed with ticket 13528. That needs a review. :(Sat, 02 Mar 2013 12:54:42 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18118#post-id-18118Comment by jtaa for <p><strong>what i've done</strong> <br/>
o1=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,1260),(7,2910)],color='red',legend_label='izf') <br/>
o2=point([(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)] ,color='blue',legend_label='act') <br/>
o3=point( [(0,0),(1,0),(2,42),(3,210),(4,1302),(5,7770),(6,46662),(7,279930)],color='blue',legend_label='cadj') </p>
<p>o=o1+o2+o3</p>
<p>plot(o,scale='semilogy')</p>
<p><strong>the plot i get still doesn't look good. some help if possible?</strong> </p>
http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18117#post-id-18117ok thanks for your help. i've decided to display this information in a table rather than a plot.Sun, 03 Mar 2013 01:08:48 -0600http://ask.sagemath.org/question/9867/how-would-you-plot-these-data-points/?comment=18117#post-id-18117