1
$\begingroup$

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: BBbarComparison

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

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

$\endgroup$
3
  • $\begingroup$ Specify the ticks as $\{\{x_1,{label}_1,\{{positivelength}_1,{negativelength}_1\},\ldots\}$ ?(see Ticks >> Details) $\endgroup$
    – kglr
    Commented Jun 23, 2021 at 15:02
  • $\begingroup$ I am sorry, I phrased the question incorrectly. I meant I would like the PlotMarkers to be wider, not the tickmarks. $\endgroup$
    – Christian
    Commented Jun 23, 2021 at 15:12
  • 1
    $\begingroup$ It seems like you have asked the question twice. Please delete the other question, so you only have one version $\endgroup$
    – Dunlop
    Commented Jun 24, 2021 at 3:28

1 Answer 1

4
$\begingroup$

You can define custom graphics for the plot markers. Example

g1 = Graphics[{Red, Rectangle[{0, 0}, {10, 1}]}];
g2 = Graphics[{Black, Rectangle[{0, 0}, {10, 1}]}];

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 -> {{g1, 20}, {g2, 30}}, 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 produces

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you so much! This is exactly what I was looking for. $\endgroup$
    – Christian
    Commented Jun 23, 2021 at 15:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.