Mathematica - Label plot ticks using strings

Click For Summary
SUMMARY

The discussion focuses on labeling tick marks in a ListSurfacePlot3D graphic using strings in Mathematica. User Christina seeks to label ticks on the x, y, and z axes with specific strings corresponding to data points. The provided code snippet demonstrates an attempt to label the y-axis but fails to display labels on the x and z axes. A solution involves ensuring the data falls within the specified tick range and utilizing the PlotRange option for proper visibility.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of ListSurfacePlot3D graphics
  • Knowledge of tick mark customization in Mathematica
  • Basic grasp of data ranges and plotting parameters
NEXT STEPS
  • Explore the use of PlotRange in Mathematica for effective data visualization
  • Learn about the Ticks option in Mathematica for custom tick labeling
  • Investigate the Generalizations & Extensions section of the Mathematica documentation
  • Research functions for generating dynamic tick labels based on data ranges
USEFUL FOR

Mathematica users, data visualizers, and anyone looking to enhance their 3D plotting capabilities with custom tick labels.

ChristinaJ
Gold Member
Messages
34
Reaction score
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
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
 

Similar threads

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