How to Specify Tick Number and Distance in Mathematica Plot?

  • Context: Mathematica 
  • Thread starter Thread starter iva_bg
  • Start date Start date
  • Tags Tags
    Mathematica Plot
Click For Summary

Discussion Overview

The discussion revolves around how to specify the number of ticks and their distances in Mathematica plots, particularly focusing on the use of the Ticks option in various plotting functions, including DateListPlot.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant inquires about specifying the number of ticks at equal distances without explicitly listing positions.
  • Another participant suggests using Ticks -> {Range[-1, 5, 2], Automatic} to label every other integer on the x-axis, indicating it can be modified for specific applications.
  • A later reply questions the applicability of the suggested Ticks option with DateListPlot, implying uncertainty about its functionality in that context.
  • Another participant provides a link to the Mathematica documentation for DateListPlot, noting that it requires tick values in a specific format and suggests either entering a list or creating a function to generate the desired tick values.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of the Ticks option in DateListPlot, indicating that the discussion remains unresolved regarding its application.

Contextual Notes

The discussion highlights limitations related to the specific requirements for tick values in DateListPlot and the potential need for custom functions to generate ticks.

iva_bg
Messages
8
Reaction score
0
Hello,

does anyone know how to specify the number of ticks to be labelled in a plot at an equal distance, without writing the list of positions explicitly?

Thanks!
 
Physics news on Phys.org
Ticks -> {Range[-1, 5, 2], Automatic}

will label every other integer between -1 and 5 on the x-axis and auto label the y axis. Modify this as necessary for your application.
 
Nothing happens... Do you know if that works with DateListPlot?
 
http://reference.wolfram.com/mathematica/ref/DateListPlot.html

Then click on Options then click on Ticks

and you see that DateListPlot Ticks requires "tick values" in the form
Ticks->{{{2007,4,12},{2008,4,18}},Automatic}
So you either enter a list like this for your desired "tick values" or you craft up a function to generate the tick values you want.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K