|
From: Thomas S. <t.s...@fz...> - 2009-10-05 07:25:47
|
in histogram mode data belonging together are grouped and each group gets one label. if you specify several 'xtic's the last one overwrites the earlier one. the label should appear in the middle (which it currently only does for an odd gap size, e.g.: set style histogram gap 1) air0day wrote: > > Hey folks, > > Pretty new to gnuplot and I've managed to get my graph to look ALMOST > exactly how I want. I have a histogram where I'm comparing two data sets > side by side and I want each bar to have its own label, but instead each > pair is getting a single label (the second one of the pair). Any way to > stop this? > > This is my .gnu file: > > set terminal png > set output 'lcom_projects.png' > set style data histograms > plot 'data.dat' every 1::0::3 using 2:xtic(1) title 'TDD' fs solid 0.7, \ > 'data.dat' every 1::4::7 using 2:xtic(1) title 'Non-TDD' fs pattern 1 > > > And this is my data: > > JUnit 0.129 > HTMLParser 0.265 > Fitnesse 0.241 > Hudson 0.149 > Jericho 0.239 > JTidy 0.112 > JSPWiki 0.22 > XWiki 0.179 > > > This is the result: > http://www.nabble.com/file/p25744498/lcom_projects.png lcom_projects.png > > > If you look, you can see that each "pair" is labeled Jericho, JTidy, > JSPWiki, and XWiki, even though the correct bar (the red one) is being > shown for the other half of the data. I just can't make the labels appear > side by side. > > Any help would be greatly appreciated. > > -- View this message in context: http://www.nabble.com/Histogram-combining-x-axis-labels-tp25744498p25746201.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2009-10-05 15:35:22
|
plot "data.dat" every 1::0::3 using 2:xtic(1) title 'TDD' fs solid 0.7, \ "" every 1::4::7 using 2:xtic(1) title 'Non-TDD' fs pattern 1, \ "" every 1::0::3 using 0:2:1 with labels right offset 0,1 notitle, \ "" every 1::4::7 using 0:2:1 with labels left offset 0,1 notitle air0day wrote: > > That makes sense I guess. But are you saying there's no way to do what I > want with GNUPlot, or no way to do what I want with gnuplot using > histograms? > > I'd be happy creating new labels for the four groupings (they do belong > together for a reason after all) if there were a way of putting individual > labels on, say, the tip of each bar. Is that possible? > > > > Thomas Sefzick wrote: >> >> in histogram mode data belonging together are grouped and each >> group gets one label. if you specify several 'xtic's the last one >> overwrites the earlier one. >> the label should appear in the middle (which it currently only >> does for an odd gap size, e.g.: set style histogram gap 1) >> >> >> air0day wrote: >>> >>> Hey folks, >>> >>> Pretty new to gnuplot and I've managed to get my graph to look ALMOST >>> exactly how I want. I have a histogram where I'm comparing two data >>> sets side by side and I want each bar to have its own label, but instead >>> each pair is getting a single label (the second one of the pair). Any >>> way to stop this? >>> >>> This is my .gnu file: >>> >>> set terminal png >>> set output 'lcom_projects.png' >>> set style data histograms >>> plot 'data.dat' every 1::0::3 using 2:xtic(1) title 'TDD' fs solid 0.7, >>> \ >>> 'data.dat' every 1::4::7 using 2:xtic(1) title 'Non-TDD' fs pattern >>> 1 >>> >>> >>> And this is my data: >>> >>> JUnit 0.129 >>> HTMLParser 0.265 >>> Fitnesse 0.241 >>> Hudson 0.149 >>> Jericho 0.239 >>> JTidy 0.112 >>> JSPWiki 0.22 >>> XWiki 0.179 >>> >>> >>> This is the result: >>> http://www.nabble.com/file/p25744498/lcom_projects.png >>> lcom_projects.png >>> >>> >>> If you look, you can see that each "pair" is labeled Jericho, JTidy, >>> JSPWiki, and XWiki, even though the correct bar (the red one) is being >>> shown for the other half of the data. I just can't make the labels >>> appear side by side. >>> >>> Any help would be greatly appreciated. >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Histogram-combining-x-axis-labels-tp25744498p25752993.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2009-10-05 17:39:26
|
set style histogram gap 1 plot "data.dat" every 1::0::3 using 2:xtic(1) title 'TDD' fs solid 0.7, \ "" every 1::4::7 using 2:xtic(1) title 'Non-TDD' fs pattern 1, \ "" every 1::0::3 using 0:2:1 with labels rotate left offset -3,1 notitle, \ "" every 1::4::7 using 0:2:1 with labels rotate left offset 3,1 notitle you need to adjust the offset if you plot with another gap size or another number of histogram bars. see: http://www.gnuplot.info/docs/node238.html http://www.gnuplot.info/docs/node253.html air0day wrote: > > > Yes! Awesome! Thank you so much! > > How do I control the labels that are now showing up? Like with xtic I can > set the rotation to be -45 degrees, is there a way to do that with the > labels? > > > Thomas Sefzick wrote: >> >> plot "data.dat" every 1::0::3 using 2:xtic(1) title 'TDD' fs solid 0.7, \ >> "" every 1::4::7 using 2:xtic(1) title 'Non-TDD' fs pattern 1, \ >> "" every 1::0::3 using 0:2:1 with labels right offset 0,1 notitle, \ >> "" every 1::4::7 using 0:2:1 with labels left offset 0,1 notitle >> >> >> air0day wrote: >>> >>> That makes sense I guess. But are you saying there's no way to do what >>> I want with GNUPlot, or no way to do what I want with gnuplot using >>> histograms? >>> >>> I'd be happy creating new labels for the four groupings (they do belong >>> together for a reason after all) if there were a way of putting >>> individual labels on, say, the tip of each bar. Is that possible? >>> >>> >>> >>> Thomas Sefzick wrote: >>>> >>>> in histogram mode data belonging together are grouped and each >>>> group gets one label. if you specify several 'xtic's the last one >>>> overwrites the earlier one. >>>> the label should appear in the middle (which it currently only >>>> does for an odd gap size, e.g.: set style histogram gap 1) >>>> >>>> >>>> air0day wrote: >>>>> >>>>> Hey folks, >>>>> >>>>> Pretty new to gnuplot and I've managed to get my graph to look ALMOST >>>>> exactly how I want. I have a histogram where I'm comparing two data >>>>> sets side by side and I want each bar to have its own label, but >>>>> instead each pair is getting a single label (the second one of the >>>>> pair). Any way to stop this? >>>>> >>>>> This is my .gnu file: >>>>> >>>>> set terminal png >>>>> set output 'lcom_projects.png' >>>>> set style data histograms >>>>> plot 'data.dat' every 1::0::3 using 2:xtic(1) title 'TDD' fs solid >>>>> 0.7, \ >>>>> 'data.dat' every 1::4::7 using 2:xtic(1) title 'Non-TDD' fs >>>>> pattern 1 >>>>> >>>>> >>>>> And this is my data: >>>>> >>>>> JUnit 0.129 >>>>> HTMLParser 0.265 >>>>> Fitnesse 0.241 >>>>> Hudson 0.149 >>>>> Jericho 0.239 >>>>> JTidy 0.112 >>>>> JSPWiki 0.22 >>>>> XWiki 0.179 >>>>> >>>>> >>>>> This is the result: >>>>> http://www.nabble.com/file/p25744498/lcom_projects.png >>>>> lcom_projects.png >>>>> >>>>> >>>>> If you look, you can see that each "pair" is labeled Jericho, JTidy, >>>>> JSPWiki, and XWiki, even though the correct bar (the red one) is being >>>>> shown for the other half of the data. I just can't make the labels >>>>> appear side by side. >>>>> >>>>> Any help would be greatly appreciated. >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Histogram-combining-x-axis-labels-tp25744498p25754745.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |