Ask Your Question
0

Markers in list_plot

asked 2012-11-28 13:23:35 +0200

v_2e gravatar image

updated 2015-01-15 11:47:40 +0200

FrédéricC gravatar image

Hello! I discovered today that one cannot use the marker property with list_plot(). So I would like to know if this hasn't been implemented yet (but planned) or there is another way to be used?

Thanks!

Edit: I tried to use

list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v')

and it indeed let me use different form of markers, but in the case when DATA_LIST consists of only one element, the point placed incorrectly on the resulting plot.

Edit 2: I remembered that there were some problems associated with the logarithmic scales on the axes. That is why I re-read this thread and realized that I have to add an axes_pad=0 parameter in order to get the correctly placed points. So the resuling work-around for a loglog scale would look like this:

list_plot(DATA_LIST, plotjoined=True, linestyle="", marker='v', scale='loglog', axes_pad=0)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2012-11-28 14:19:50 +0200

kcrisman gravatar image

I use line with an empty linestyle.

sage: l = enumerate(range(10))
sage: l
<enumerate object at 0x10d433190>
sage: line(l,linestyle='', marker='v')

This seems to work with just one point, as does

sage: list_plot([(1,2)],plotjoined=True,linestyle='',marker='v')
edit flag offensive delete link more

Comments

Yes, it turned out that in my case the problem was because of the 'loglog' scale. I added a 'axes_pad=0' parameter and obtained a correct result. Thanks!

v_2e gravatar imagev_2e ( 2012-11-28 14:39:12 +0200 )edit
1

answered 2015-01-15 11:41:32 +0200

FrédéricC gravatar image

You can use scatter_plot instead

sage: scatter_plot([(1,1),(2,2),(4,-1)],markersize=30,edgecolor=(1, 0, 0), marker='x')
edit flag offensive delete link more

Comments

Nice. I think there is current work, maybe now merged, for this to work with point() as well.

kcrisman gravatar imagekcrisman ( 2015-01-16 03:15:33 +0200 )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

Stats

Asked: 2012-11-28 13:23:35 +0200

Seen: 1,494 times

Last updated: Jan 15 '15