Mathematica - Label plot ticks using strings

In summary, the conversation discusses labeling tick marks using strings on a ListSurfacePlot3D graphic. The individual would like to know how to evenly distribute a list of strings along an axis. A Ticks construction is provided, but it may not be working due to the data being outside the given range. A suggestion is made to write a function to generate the desired ticks, and a resource for this is provided.
  • #1
ChristinaJ
Gold Member
35
1
All,

I have a ListSurfacePlot3D graphic and wish to label the tick marks using strings. For example if I have X={x1,x2,x3} I would like to label each tick mark at that point with a string, i.e. x1="a", x2="b" etc.

I would also like to know how to take a list of strings and distribute them evenly along the axis.

So far I have

ListSurfacePlot3D[ data , BoxRatios -> {1,1,1}, Ticks ->{{{1,"a"} , {2,"b"} , {3,"c"}} , {{1,"d"} , {2,"e"} , {3,"f"}} , {{1,"h"} , {2,"j"} , {3,"k"}}} ]

This gives the labels "d" , "e" ,"f" on the y-axiz but nothing on the x or z-axes.

Any help gratefully received.

Many thanks,
Christina
 
Last edited:
Physics news on Phys.org
  • #2
Your Ticks construction is fine -- it's probably that your data is outside the range you gave the ticks. Put in an explicit PlotRange to check.

Maybe you should look at writing a function that takes the min and max of the axis and generates the ticks you want. See the Generalizations & Extensions section of http://reference.wolfram.com/mathematica/ref/Ticks.html
 

Related to Mathematica - Label plot ticks using strings

1. What is the purpose of labeling plot ticks using strings in Mathematica?

The purpose of labeling plot ticks using strings in Mathematica is to provide descriptive and easily understandable labels for the tick marks on the axes of a plot. This can help the reader to better understand the data being presented and make it easier to interpret the plot.

2. How can I label plot ticks using strings in Mathematica?

To label plot ticks using strings in Mathematica, you can use the TickLabels option in the Plot function. By specifying the tick labels as a list of strings, they will be displayed on the axes instead of the default numeric values.

3. Can I use custom labels for plot ticks in Mathematica?

Yes, you can use custom labels for plot ticks in Mathematica. The TickLabels option allows you to specify any list of strings to be used as tick labels, giving you the flexibility to create custom labels that best represent your data.

4. How can I change the font or formatting of the tick labels in Mathematica?

To change the font or formatting of the tick labels in Mathematica, you can use the TickStyle option in the Plot function. This allows you to specify various formatting options such as font size, font family, font color, and more.

5. Is it possible to label both the x-axis and y-axis ticks using strings in Mathematica?

Yes, it is possible to label both the x-axis and y-axis ticks using strings in Mathematica. You can use the TickLabels option for both the Plot and PlotRange functions to specify the tick labels for each axis separately.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
299
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
88
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
56
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
902
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top