Ask Your Question

How would you plot these data points?

asked 2013-03-01 07:26:57 -0500

jtaa gravatar image

(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)]
Actual (color=black): [(0,0),(1,0),(2,0),(3,35),(4,105),(5,252),(6,420),(7,360)]
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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-03-01 14:34:38 -0500

ppurka gravatar image

Use list_plot and logarithmic scale on the y-axis.

edit flag offensive delete link more


see what i've done below. the scale still doesn't work very well

jtaa gravatar imagejtaa ( 2013-03-02 02:54:44 -0500 )edit

answered 2013-03-02 02:54:07 -0500

jtaa gravatar image

updated 2013-03-02 02:54:18 -0500

what i've done
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')



the plot i get still doesn't look good. some help if possible?

edit flag offensive delete link more


Try 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.

ppurka gravatar imageppurka ( 2013-03-02 04:20:57 -0500 )edit

the plot doesn't seem to show the black and red points at x=3

jtaa gravatar imagejtaa ( 2013-03-02 04:31:33 -0500 )edit

This problem with the point at x=3 is fixed with ticket 13528. That needs a review. :(

ppurka gravatar imageppurka ( 2013-03-02 12:54:42 -0500 )edit

ok thanks for your help. i've decided to display this information in a table rather than a plot.

jtaa gravatar imagejtaa ( 2013-03-03 01:08:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-03-01 07:26:57 -0500

Seen: 158 times

Last updated: Mar 02 '13