Opened 7 years ago

Last modified 6 days ago

#14995 new enhancement

Control subticks in 2d plot

Reported by: kcrisman Owned by:
Priority: minor Milestone: sage-9.3
Component: graphics Keywords:
Cc: kcrisman, slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by slelievre)

In Ask Sage question 691, the very reasonable question of controlling subticks was asked. Meanwhile, Mark Edgington has implemented this!

Here is a description, from the Ask Sage question and answer, of the new functionality:

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

This was made available, as based on Sage 5.10, on bitbucket.

A branch would be needed, with doctests. Some of the stuff on that branch is also for other issues like #8478.

The bitbucket repo is gone, but archived at Software Heritage.

Change History (4)

comment:1 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:2 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:4 Changed 6 days ago by slelievre

  • Cc kcrisman slelievre added
  • Description modified (diff)
  • Milestone changed from sage-6.4 to sage-9.3

Updating ticket description with Software Heritage link.

Hoping this can be revived.

Note: See TracTickets for help on using tickets.