Message Boards Message Boards

0
|
4899 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Values as PlotMarkers

Posted 10 years ago

I have a list of numbers that I have extracted from a data set that I want to use as PlotMarkers eg. showing the number of a point and/or its x,y value at the position of a point. However, PlotMarker only seems to accept numbers in the form "1" Adding quote marks would be tedious for a long list so how do I get over this?

POSTED BY: malcolm woodruff
2 Replies

Thank you Sean, I had forgotten about the Map function. However, I eventually found that my problem is that PlotMarkers only act on ranges (lists) of points, not individual points. So if you want to label each point differently you have to enclose it in curly brackets so it's a list consisting of one item.

POSTED BY: malcolm woodruff

When you put quotes around something, it becomes a string. Strings are common objects in essentially every programming language.

Mathematica has a function called ToString to make things into strings. You can use Map to map ToString onto a list:

Map[ToString,{1,2,3,4,5}]

Note: Strings often appear in output with their quotes hidden, so if you want to see them, you'll have to run InputForm on the output to see that the quotes are there.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract