1

I got a problem with a plot. As you can see there symbolic xcoords and i got some plots. but the bars of the plots overlap. For example last bar vom node2 with first bar of node3. is there a way to define the spacing inbetween the xcoords? like a certain space for every symbolic xcoord?

\begin{axis}[
ybar=3pt,
    title = Tag calculation for datset : 104 messages - 20 nodes.,
    ybar=3pt,
    compat=newest,
    y axis line style = {opacity = 0.5},
     x axis line style = {opacity = 0.5},
    enlarge x limits = 0.2,
    tickwidth         = 0pt,
    legend style={at={(0.5,-0.1)},
      anchor=north,legend columns=-1},
    ylabel={symbolic $Q_OF$},
    ymin=0.0,
    symbolic x coords=     {$Node_{16}$,$Node_{17}$,$Node_{18}$,$Node_{19}$,$Node_{20}$},
    xtick=data,
    width=1\textwidth,
    height=9.5cm,
   bar width=4,
   nodes near coords,
   every node near coord/.append style={font=\scriptsize},
    nodes near coords align={vertical},
    ]
Stefan Pinnow
  • 29,535
mfw
  • 11
  • Welcome to TeX.SE! Please extend your code fragment to complete small document, which we can compile as it is. From your axis options we can 't see, what s your problem. Overlapping is quite specific to particular image (it sizem, number of elements, etc). – Zarko May 28 '19 at 18:10
  • 1
    The space you have available for each group of bars (each symbolic coord) basically depends on 1) on the number of groups, 2) the number of bars in each group (the number of \addplots), 3) the width of the bars (set by bar width), 4) the space between the bars in the group (set by the argument passed to ybar, e.g. ybar=3pt), 5) the total width of the plot (set by the width key) and 6) the distance from the edge of the axis to the bars (for your code set by enlarge x limits). You probably can't do much with 1 and 2, so you'll need to adjust 3-6. – Torbjørn T. May 28 '19 at 18:33

0 Answers0