RE: Using Symbols with Plot

• To: mathgroup at smc.vnet.net
• Subject: [mg32996] RE: [mg32973] Using Symbols with Plot
• From: "David Park" <djmp at earthlink.net>
• Date: Sat, 23 Feb 2002 02:38:18 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Bill,

There sure is. You can use the standard package Graphics`MultipleListPlot`.
But the MultipleListPlot routine itself is not quite as useful as the
routines PlotSymbol, MakeSymbol and RegularPolygon that the package
contains. It is often easier to use the construction I show below. If you
have a set of data points, you can plot the line just by wrapping Line
around the data points. You can plot the symbols just by mapping the symbol
onto the data points.  You could also use the Text statement and StyleForm
to use any character as a plot symbol. You could also map Circle or Disk
onto the points. Here is an example using MakeSymbol and PlotSymbol.

Needs["Graphics`MultipleListPlot`"]
Needs["Graphics`Colors`"]

sindata = Table[{x, Sin[x]}, {x, 0, Pi, Pi/20}];
cosdata = Table[{x, Cos[x]}, {x, 0, Pi, Pi/20}];

cross[size_] :=
MakeSymbol[{Line[{{-size, 0}, {size, 0}}], Line[{{0, -size}, {0, size}}]}]

Show[Graphics[
{Line[sindata],
Line[cosdata],
Blue, cross[4] /@ sindata,
Red, PlotSymbol[Box, 4, Filled -> False] /@ cosdata}],
Frame -> True,
PlotLabel -> "Plotting With Symbols",
ImageSize -> 400
];

Here is an example using Text statements

Show[Graphics[
{Line[sindata],
Line[cosdata],
Text[StyleForm["A", FontSize -> 12, FontColor -> Blue], #] & /@
sindata,
Text[StyleForm["B", FontSize -> 12, FontColor -> Red], #] & /@
cosdata}],
Frame -> True,
PlotLabel -> "Plotting With Symbols",
ImageSize -> 400
]

David Park

> From: Bill Toole [mailto:bill.toole at conexant.com]
To: mathgroup at smc.vnet.net
>
>
> Hi
>
> I would like to be able to use symbols such as +, o, x, square,
> triangle etc when I use Plot[] to plot several functions.
> Is there a package of some sort that allows this?