First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 5 years ago

Juanjo gravatar image

You can modify the aspect of the graphic through options of points (or point2d) or through the show method. Try this, for example:

sage: p = points([CDF(a // 5 - 3 + (a % 5 - 2)*i) for a in range(0, 35)], 
....: color="gray", marker="s", size=25)
sage: p.show(ticks=[[-3..3],None])

For a list of the graphic properties than can be changed through show options, type:

sage: p.SHOW_OPTIONS

For help about options, like color, marker or size, you can directly provide, type:

sage: point2d?

See also the documentation for points and graphics objects.

click to hide/show revision 2
No.2 Revision

You can modify the aspect of the graphic through options of points (or point2d) or through the show method. Try this, for example:

sage: p = points([CDF(a // 5 - 3 + (a % 5 - 2)*i) for a in range(0, 35)], 
....: color="gray", marker="s", size=25)
sage: p.show(ticks=[[-3..3],None])

For a list of the graphic properties than can be changed through show options, type:

sage: p.SHOW_OPTIONS

For help about options, like color, marker or size, you can directly provide, type:

sage: point2d?

See also the documentation for points and graphics objects.

EDIT: Some graphic properties can be modified by changing matplotlib rcParams. This is the case of ticks size. Try the following code:

from matplotlib import rcParams, rcdefaults
from matplotlib.ticker import NullFormatter
rcParams['xtick.major.size'] = rcParams['xtick.minor.size'] = 0
rcParams['ytick.major.size'] = rcParams['ytick.minor.size'] = 0

points_dict = dict(color='red', size=25, marker='s', zorder=3)
grid_dict = dict(color='#AAABB8', linestyle='-')
show_dict = dict(ticks=[[-3..3],[-2..2]], tick_formatter=2*[NullFormatter()], 
                 gridlines=True, gridlinesstyle=glsdict, aspect_ratio=1)
p = points([CDF(a // 5 - 3 + (a % 5 - 2)*I) for a in range(0, 35)], **points_dict)
p.show(**show_dict)

rcdefaults() # Just for comparison, reset rcParams...
p.show()     # ... and show points again with no particular option

The option zorder=3 included in points_dict serves to print points on the axes and gridlines. Check what happens without this option or using a lesser value.

click to hide/show revision 3
No.3 Revision

You can modify the aspect of the graphic through options of points (or point2d) or through the show method. Try this, for example:

sage: p = points([CDF(a // 5 - 3 + (a % 5 - 2)*i) for a in range(0, 35)], 
....: color="gray", marker="s", size=25)
sage: p.show(ticks=[[-3..3],None])

For a list of the graphic properties than can be changed through show options, type:

sage: p.SHOW_OPTIONS

For help about options, like color, marker or size, you can directly provide, type:

sage: point2d?

See also the documentation for points and graphics objects.

EDIT: Some graphic properties can be modified by changing matplotlib rcParams. This is the case of ticks size. Try the following code:

from matplotlib import rcParams, rcdefaults
from matplotlib.ticker import NullFormatter
rcParams['xtick.major.size'] = rcParams['xtick.minor.size'] = 0
rcParams['ytick.major.size'] = rcParams['ytick.minor.size'] = 0

points_dict = dict(color='red', size=25, marker='s', zorder=3)
grid_dict = dict(color='#AAABB8', linestyle='-')
show_dict = dict(ticks=[[-3..3],[-2..2]], tick_formatter=2*[NullFormatter()], 
                 gridlines=True, gridlinesstyle=glsdict, aspect_ratio=1)
p = points([CDF(a // 5 - 3 + (a % 5 - 2)*I) for a in range(0, 35)], **points_dict)
p.show(**show_dict)

rcdefaults() # Just for comparison, reset rcParams...
p.show()     # ... and show points again with no particular option

The option zorder=3 included in points_dict serves to print points on onto the axes and gridlines. Check what happens without this option or using a lesser value.

click to hide/show revision 4
No.4 Revision

You can modify the aspect of the graphic through options of points (or point2d) or through the show method. Try this, for example:

sage: p = points([CDF(a // 5 - 3 + (a % 5 - 2)*i) for a in range(0, 35)], 
....: color="gray", marker="s", size=25)
sage: p.show(ticks=[[-3..3],None])

For a list of the graphic properties than can be changed through show options, type:

sage: p.SHOW_OPTIONS

For help about options, like color, marker or size, you can directly provide, type:

sage: point2d?

See also the documentation for points and graphics objects.

EDIT: Some graphic properties can be modified by changing matplotlib rcParams. This is the case of ticks size. Try the following code:

from matplotlib import rcParams, rcdefaults
from matplotlib.ticker import NullFormatter
rcParams['xtick.major.size'] = rcParams['xtick.minor.size'] = 0
rcParams['ytick.major.size'] = rcParams['ytick.minor.size'] = 0

points_dict = dict(color='red', size=25, marker='s', zorder=3)
grid_dict = dict(color='#AAABB8', linestyle='-')
show_dict = dict(ticks=[[-3..3],[-2..2]], tick_formatter=2*[NullFormatter()], 
                 gridlines=True, gridlinesstyle=glsdict, aspect_ratio=1)
p = points([CDF(a // 5 - 3 + (a % 5 - 2)*I) for a in range(0, 35)], **points_dict)
p.show(**show_dict)

rcdefaults() # Just for comparison, reset rcParams...
p.show()     # ... and show points again with no particular option

The option zorder=3 included in points_dict serves to print points onto over the axes and gridlines. Check what happens without this option or using a lesser value.

click to hide/show revision 5
No.5 Revision

You can modify the aspect of the graphic through options of points (or point2d) or through the show method. Try this, for example:

sage: p = points([CDF(a // 5 - 3 + (a % 5 - 2)*i) for a in range(0, 35)], 
....: color="gray", marker="s", size=25)
sage: p.show(ticks=[[-3..3],None])

For a list of the graphic properties than can be changed through show options, type:

sage: p.SHOW_OPTIONS

For help about options, like color, marker or size, you can directly provide, type:

sage: point2d?

See also the documentation for points and graphics objects.

EDIT: Some graphic properties can be modified by changing matplotlib rcParams. This is the case of ticks size. Try the following code:

from matplotlib import rcParams, rcdefaults
from matplotlib.ticker import NullFormatter
rcParams['xtick.major.size'] = rcParams['xtick.minor.size'] = 0
rcParams['ytick.major.size'] = rcParams['ytick.minor.size'] = 0

points_dict = dict(color='red', size=25, marker='s', zorder=3)
grid_dict = dict(color='#AAABB8', linestyle='-')
show_dict = dict(ticks=[[-3..3],[-2..2]], tick_formatter=2*[NullFormatter()], 
                 gridlines=True, gridlinesstyle=glsdict, gridlinesstyle=grid_dict, aspect_ratio=1)
p = points([CDF(a // 5 - 3 + (a % 5 - 2)*I) for a in range(0, 35)], **points_dict)
p.show(**show_dict)

rcdefaults() # Just for comparison, reset rcParams...
p.show()     # ... and show points again with no particular option

The option zorder=3 included in points_dict serves to print points over the axes and gridlines. Check what happens without this option or using a lesser value.