# Wide PlotMarkers Option For ListPlot?

0

I am creating some Listplots of some data with the following bit of code:

bbbarexpmasses = {{1, 9.4449}, {2, 9.8999}, {3, 10.023}, {4,
10.163}, {5, 10.260}, {6, 10.355}, {7, 10.579}}

bbbartheorymasses = {{1, 9.4258128}, {2, 9.884308}, {3,
9.9751791}, {4, 10.145617}, {5, 10.270137}, {6, 10.197768}, {7,
10.430176}}

BBbarcomparison =
ListPlot[{bbbarexpmasses, bbbartheorymasses},
PlotMarkers -> {Automatic, Medium}, ImageSize -> Large,
Frame -> All,
Ticks -> {{{1, "1S"}, {2, "1P"}, {3, "2S"}, {4, "1D"}, {5,
"2P"}, {6, "3S"}, {7, "4S"}}, {9.4449, 9.8999, 10.023, 10.163,
10.260, 10.355, 10.579}}]


which works fine and produces the following plot:

But now I would like to have the PlotMarkers to be wider, more like the markers in this plot.

Is there an option in Mathematica to do something like this? Thanks.

• That plot looks more like a BarChart in my opinion, that should make this type of plot easier. You can then use ChartElementFunction to draw the lines Jun 24, 2021 at 8:04

Use PlotMarkers to specify your shape, add Scaled[] with each shape to have the right size, and use PlotStyle to specify the color of each series. Because of the large shapes, the PlotRange should be specified manually.

Table used to generate PlotMarkers shapes, each with some variation.

ListPlot[{bbbarexpmasses, bbbartheorymasses}, ImageSize -> Large,
Frame -> All,
Ticks -> {{{1, "1S"}, {2, "1P"}, {3, "2S"}, {4, "1D"}, {5, "2P"}, {6,
"3S"}, {7, "4S"}}, {9.4449, 9.8999, 10.023, 10.163, 10.260,
10.355, 10.579}},
PlotMarkers ->
Table[{Graphics[Rectangle[{0, 0}, {10, i}, RoundingRadius -> .7]],
Scaled[.02*i + .1]}, {i, {1, 1.2}}],
PlotStyle -> {GrayLevel[.3], GrayLevel[.7]},
PlotRange -> {{.5, 7.5}, Automatic}]


Result:

• Thank you, this is very useful! Jun 24, 2021 at 10:35