I am trying to build on a simple example here:
td = Prime[Range[25]]
dsk = Graphics[{Blue, Disk[]}]
ListPlot[td, PlotMarkers -> {dsk, 0.7}]
How can I make Plotmarkers be a function of points being plotted?
|
I am trying to build on a simple example here:
How can I make Plotmarkers be a function of points being plotted? |
|||||
|
|
The description in the question suggests that you may really want to use You want the plot markers to be a function of the points, and that's exactly what In a The shape of the marker is set by the option This means that in addition to your table
we need a data table with three entries for each of the
Now let's plot this:
As an additional way of visualizing the data, we can use the third entry in the point's data to change the color of the disks:
The documentation shows how you can use arbitrary shapes other than disks, too. It also shows that you can combine several data sets in a single plot if desired. Edit One additional issue appears in the answer by kguler and motivated Sjoerd's answer (both of which are fine so I upvoted them of course): it's the question of how to plot these data dependent plot markers and then also draw a line through the data. The answer is actually very simple - and that also means kguler's answer can be used this way: just combine the
That should cover all the possible issues. Edit 2: using There is another alternative to get individually styled plot markers. This may be useful when you don't need or want the dynamic interactivity that's built into An approach that's closer to Continuing with the above prime number example, the
Then I load the package and define a function to create a more or less arbitrary "plot marker" whose size and color are determined by the second number in each tuple of
The actual |
||||
|
|
|
Perhaps something like:
EDIT: The issue of
and use
Still ... Jens's answer using |
||||
|
|
|
Both Chris and kguler's solution work by letting That is all great and fine as long as you don't want to connect the points using the option By manipulating the output of the original plot it can still be done. So, here is the original plot with
Extracting the coordinates:
Replacing the plot markers with something else dependent on the coordinates:
|
|||
|
|
|
Something along these lines perhaps:
|
|||
|
|