Talk:Stem-and-leaf plot: Difference between revisions

m
lang tags replaced by syntaxhighlight
(→‎Less Useful for negative numbers?: The concept's flawed, but the task is fine)
m (lang tags replaced by syntaxhighlight)
 
(11 intermediate revisions by 7 users not shown)
Line 38:
 
:: Agreed, and it's notable that this is a style of plotting that's fallen out of favour. From the perspective of RC tasks though, the main problem was that it was very poorly described in the first instance. We could do with a test dataset that forces correct handling of negative numbers too. –[[User:Dkf|Donal Fellows]] 15:07, 16 December 2009 (UTC)
 
:: I would prefer we leave out negatives. Stem plots look crap for negative numbers. --[[User:Paddy3118|Paddy3118]] 08:18, 18 December 2009 (UTC)
 
::: I rather agree about leaving out negatives, it does complicate the programming. &nbsp; It took a few extra REXX statements to handle the case of &nbsp; '''-0''' &nbsp; and &nbsp; '''0''' &nbsp; to be handled as separate indices. &nbsp; It would be nice to have a companion Rosetta Code task to handle negative numbers &nbsp; (and also zeroes). &nbsp; An '''extra credit''' at this late point would be a day late and a dollar short. &nbsp; '''But''', I disagree about the stem plots looking like crap for negative numbers. &nbsp; See the output for the 2<sup>nd</sup> REXX version. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:57, 4 June 2016 (UTC)
 
:: Should I appear smug at this point? ;) --[[User:Glennj|glennj]] 16:09, 16 December 2009 (UTC)
 
==Data set==
Kevin, is this task still under development? From your comments here, it sounds like it's pretty much fixed. --[[User:Glennj|glennj]] 16:09, 16 December 2009 (UTC)
 
: It needs a data set which is less sparse -- more obvious humps, and less unnecessary completely-blank stems. That's all. —[[User:Kevin Reid|Kevin Reid]] 17:05, 16 December 2009 (UTC)
:: Now that I'm back at work again, I'm again short on time for everything. See the data generator linked to in the class. Adding additional calls to genhump will add more humps. Tweaking the parameters will adjust the width, location, height and shape of the humps. Run it until a suitable dataset is found. Or provide several data sets, testing and highlighting different behaviors. --[[User:Short Circuit|Michael Mol]] 19:26, 16 December 2009 (UTC)
::: Here is an alternative data set matching those specs:
<pre>176 86 160 210 76 205 186 67 154 192 96 187
83 110 112 90 247 91 108 93 88 133 159 104
109 173 167 52 225 73 82 198 114 69 183 166
59 209 74 267 74 211 118 68 105 221 67 233
243 109 226 66 179 201 61 84 93 83 181 88</pre>
::: Generated using:
<syntaxhighlight lang="j"> require 'stats/distribs/normal'
randomize=: ] /: 0 ?@$~ #
showStemLeaf dat=: (84 20,:184 40) ([: randomize ,@:(<.@:rnorm"1 0)) 30 30
┌──┬─────────────┐
│ 5│2 9 │
│ 6│1 6 7 7 8 9 │
│ 7│3 4 4 6 │
│ 8│2 3 3 4 6 8 8│
│ 9│0 1 3 3 6 │
│10│4 5 8 9 9 │
│11│0 2 4 8 │
│12│ │
│13│3 │
│14│ │
│15│4 9 │
│16│0 6 7 │
│17│3 6 9 │
│18│1 3 6 7 │
│19│2 8 │
│20│1 5 9 │
│21│0 1 │
│22│1 5 6 │
│23│3 │
│24│3 7 │
│25│ │
│26│7 │
└──┴─────────────┘</syntaxhighlight>
--[[User:Tikkanz|Tikkanz]] 01:22, 18 December 2009 (UTC)
 
== "do better if you can"??? ==
 
What on earth does that mean? Can the originator of that part please explain what they had in mind so that we can determine how best to provide output to satisfy the task? –[[User:Dkf|Donal Fellows]] 00:08, 17 December 2009 (UTC)
 
:The task is an exercise in producing a visual layout of information. Think about what wouldn't look out of place in a book or article. If you choose monospaced text, it might work, but you lose a lot of options about particular spacing and vertical rule style (and you may not even be able to make an unbroken line, depending on the text renderer). —[[User:Kevin Reid|Kevin Reid]] 00:45, 17 December 2009 (UTC)
 
:: But if you've read the WP article on these things, you'll know that they were only ever popular when created using monospaced fonts. Going for anything else... it's not really in the spirit of the things. –[[User:Dkf|Donal Fellows]] 10:10, 18 December 2009 (UTC)
 
I too have problems with this. You need mono-spaced text to get the height (width) of each line right. If rendered in, say, HTML then I guess you could use a highlight colour to create solid bars of colour. --[[User:Paddy3118|Paddy3118]] 11:33, 25 December 2009 (UTC)
3,021

edits