Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I've implemented this in a branch of sage available here. Hopefully it (or some improved version of it) will get incorporated into the sage codebase at some point.

Here's an example in which it is used (this will produce a plot with no minor ticks on the y-axis, and with 0.1-unit spaced minor ticks on the x-axis) :

g = plot(x^2)
g.show(dpi=200, axes=True, ticks=[0.5, 0.2], minor_ticks=[0.1,None])

If the minor_ticks option is not specified, then minor-tick behavior will follow previous Sage defaults. If the option is specified, then the following examples describe the behavior:

minor_ticks=None, or =[None,None] -- no minor ticks will appear on either x or y axes
minor_ticks=3 -- minor ticks every 3 units on x axis ; Sage defaults on y axis
minor_ticks=[3,None] -- minor ticks every 3 units on x axis ; none on y axis
minor_ticks=[3,[2,7]] -- minor ticks every 3 units on x axis ; at 2 and 7 on y axis
click to hide/show revision 2
try to work around crappy formatting

I've implemented this in a branch of sage available here. Hopefully it (or some improved version of it) will get incorporated into the sage codebase at some point.

Here's an example in which it is used (this will produce a plot with no minor ticks on the y-axis, and with 0.1-unit spaced minor ticks on the x-axis) :

g = plot(x^2)
g.show(dpi=200, axes=True, ticks=[0.5, 0.2], minor_ticks=[0.1,None])

If the minor_ticks option is not specified, then minor-tick behavior will follow previous Sage defaults. If the option is specified, then the following examples describe the behavior:

minor_ticks=None, or =[None,None] -- no minor ticks will appear on either x or y axes
minor_ticks=3 -- minor ticks every 3 units on x axis ; Sage defaults on y axis
minor_ticks=[3,None] -- minor ticks every 3 units on x axis ; none on y axis
minor_ticks=[3,[2,7]] -- minor ticks every 3 units on x axis ; at 2 and 7 on y axis
click to hide/show revision 3
apparently bold isn't possible within link names?

I've implemented this in a branch of sage available here. Hopefully it (or some improved version of it) will get incorporated into the sage codebase at some point.

Here's an example in which it is used (this will produce a plot with no minor ticks on the y-axis, and with 0.1-unit spaced minor ticks on the x-axis) :

g = plot(x^2)
g.show(dpi=200, axes=True, ticks=[0.5, 0.2], minor_ticks=[0.1,None])

If the minor_ticks option is not specified, then minor-tick behavior will follow previous Sage defaults. If the option is specified, then the following examples describe the behavior:

minor_ticks=None, or =[None,None] -- no minor ticks will appear on either x or y axes
minor_ticks=3 -- minor ticks every 3 units on x axis ; Sage defaults on y axis
minor_ticks=[3,None] -- minor ticks every 3 units on x axis ; none on y axis
minor_ticks=[3,[2,7]] -- minor ticks every 3 units on x axis ; at 2 and 7 on y axis
click to hide/show revision 4
replaced example with one based on the questioner's example

I've implemented this some control over minor-ticks in a branch of sage available here. Hopefully it (or some improved version of it) will get incorporated into the sage codebase at some point.

Here's an example in which it is used (this will produce a plot with no should achieve what was sought after by the questioner (except that minor ticks on the y-axis, and with 0.1-unit spaced minor ticks on the x-axis) are smaller than major ticks, which may not have been desired) :

g = plot(x^2)
g.show(dpi=200, axes=True, ticks=[0.5, 0.2], minor_ticks=[0.1,None])
var('x')
p=plot(5*sin(x/10)*sin(x),(x,0,20*pi))
p.show(ticks=[[0,5*pi,10*pi,15*pi,20*pi],5], minor_ticks=pi,
       tick_formatter="latex")

If the minor_ticks option is not specified, then minor-tick behavior will follow previous Sage defaults. If the option is specified, then the following examples describe the behavior:

minor_ticks=None, or =[None,None] -- no minor ticks will appear on either x or y axes
minor_ticks=3 -- minor ticks every 3 units on x axis ; Sage defaults on y axis
minor_ticks=[3,None] -- minor ticks every 3 units on x axis ; none on y axis
minor_ticks=[3,[2,7]] -- minor ticks every 3 units on x axis ; at 2 and 7 on y axis
click to hide/show revision 5
still fighting with crappy URL formatting

I've implemented some control over minor-ticks in a branch of sage available here. Hopefully it (or some improved version of it) will get incorporated into the sage codebase at some point.

Here's an example which should achieve what was sought after by the questioner (except that minor ticks are smaller than major ticks, which may not have been desired) :

var('x')
p=plot(5*sin(x/10)*sin(x),(x,0,20*pi))
p.show(ticks=[[0,5*pi,10*pi,15*pi,20*pi],5], minor_ticks=pi,
       tick_formatter="latex")

If the minor_ticks option is not specified, then minor-tick behavior will follow previous Sage defaults. If the option is specified, then the following examples describe the behavior:

minor_ticks=None, or =[None,None] -- no minor ticks will appear on either x or y axes
minor_ticks=3 -- minor ticks every 3 units on x axis ; Sage defaults on y axis
minor_ticks=[3,None] -- minor ticks every 3 units on x axis ; none on y axis
minor_ticks=[3,[2,7]] -- minor ticks every 3 units on x axis ; at 2 and 7 on y axis

I've implemented some control over minor-ticks in a branch of sage available here. Hopefully it (or some improved version of it) will get incorporated into the sage codebase at some point.

Here's an example which should achieve what was sought after by the questioner (except that minor ticks are smaller than major ticks, which may not have been desired) :

var('x')
p=plot(5*sin(x/10)*sin(x),(x,0,20*pi))
p.show(ticks=[[0,5*pi,10*pi,15*pi,20*pi],5], minor_ticks=pi,
       tick_formatter="latex")

If the minor_ticks option is not specified, then minor-tick behavior will follow previous Sage defaults. If the option is specified, then the following examples describe the behavior:

minor_ticks=None, or =[None,None] -- no minor ticks will appear on either x or y axes
minor_ticks=3 -- minor ticks every 3 units on x axis ; Sage defaults on y axis
minor_ticks=[3,None] -- minor ticks every 3 units on x axis ; none on y axis
minor_ticks=[3,[2,7]] -- minor ticks every 3 units on x axis ; at 2 and 7 on y axis