How to Specify Tick Number and Distance in Mathematica Plot?

In summary, to specify the number of ticks to be labelled in a plot at an equal distance, you can use the Ticks option with a list of tick values or a function to generate the desired tick values. This works for both regular plots and DateListPlots.
  • #1
iva_bg
8
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
  • #2
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.
 
  • #3
Nothing happens... Do you know if that works with DateListPlot?
 
  • #4
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.
 
  • #5


I am familiar with Mathematica and the Plot Ticks option. To specify the number of ticks to be labeled in a plot at an equal distance, you can use the "Automatic" option. This will automatically determine the number and placement of ticks based on the range of your data. Alternatively, you can use the "Scaled" option to specify a fraction of the total range to be used for the ticks. For example, "Scaled[{0.1,0.9}]" will place ticks at 10% and 90% of the range. I hope this helps!
 

1. What is the purpose of the "Plot Ticks" option in Mathematica?

The "Plot Ticks" option allows you to specify the specific tick marks and labels displayed on the axes of a plot in Mathematica. This can be useful for customizing the appearance of your plot and making it easier to interpret.

2. How do I use the "Plot Ticks" option in Mathematica?

To use the "Plot Ticks" option, you need to specify it as part of the options list when creating a plot using the Plot function in Mathematica. You can specify the tick marks and labels you want to use using a list or a function.

3. Can I customize the tick marks and labels in the "Plot Ticks" option?

Yes, you can customize the tick marks and labels in the "Plot Ticks" option by providing a list or function with the specific values you want to use. You can also use built-in functions in Mathematica, such as "Automatic" or "Scaled" to generate tick marks and labels automatically.

4. How can I change the number of tick marks displayed on an axis using the "Plot Ticks" option?

To change the number of tick marks displayed on an axis, you can use the "Plot Ticks" option to specify the exact number of tick marks you want to display or use a function to automatically generate the desired number of tick marks. You can also use the "Ticks" option within the "Plot Ticks" option to further customize the tick marks.

5. Can I use the "Plot Ticks" option for 3D plots in Mathematica?

Yes, the "Plot Ticks" option can be used for 3D plots in Mathematica. You can specify the tick marks and labels for each of the three axes separately, or use a single list or function to generate tick marks and labels for all three axes. The "Ticks" option can also be used within the "Plot Ticks" option for further customization.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
261
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Back
Top