Re: Combine these displays
- To: mathgroup at smc.vnet.net
- Subject: [mg111628] Re: Combine these displays
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 8 Aug 2010 07:20:33 -0400 (EDT)
On 8/7/10 at 6:21 AM, stevebg at ROADRUNNER.COM (S. B. Gray) wrote: >dots = {13.450, 8.1090, -5.398, -6.511, -9.7456, 7.903, -8.392, >-5.989, -4.612, 3.614, -8.564, -6.598, -6.794, -8.898, 7.082}; >histo = {0, 0, 0, 0, 5, 79, 372, 2016, 4354, 2350, 776, 47, 0, 0, >0}; >vertL=6; >Print[ColumnForm[Subsets[Range[vertL], {2}]], >PaddedForm[ColumnForm[dots], {5, 3}]]; >ListPlot[histo, Filling -> Axis, FillingStyle -> Blue, >ImageSize -> 200] >I would like to have both the Print and the ListPlot side-by-side. I >have tried various ways but the vertical middle of the ListPlot is >aligned vertically with the first line of the Print, not what I >want. >I'm pretty sure there's a way to do this,but ??? How about Grid[{{ListPlot[histo, Filling -> Axis, FillingStyle -> Blue, ImageSize -> 400], ColumnForm[Subsets[Range[vertL], {2}]], PaddedForm[ColumnForm[dots], {5, 3}]}}, Alignment -> {Center, Center}] I increased ImageSize from 200 to 400 so that the plot would be approximately the same height as the column of data. >Second question: how can I easily convert this: >dots = {13.450267077799438`, >8.109055556963629`, -5.398346580982599`, -6.511327150093379`, \ >-9.74563291525153`, >7.903094720434787`, -8.392664097832405`, -5.9892576996334`, \ >-4.612703478034474`, >3.6149284469532583`, -8.564611182475591`, -6.598329965767091`, \ >-6.794209914139243`, -8.89863831014673`, 7.082991529239999`} >to this? >dots = {13.450, 8.1090`, -5.398, -6.511, -9.7456, 7.903, -8.392, >-5.989, -4.612, 3.614, -8.564, -6.598, -6.794, -8.898, 7.082}; In[15]:= Round[dots, .001] Out[15]= {13.45,8.109,-5.398,-6.511,-9.746,7.903,-8.393,-5.989,-4.613,3.6= 15,-8.565,-6.598,-6.794,-8.899,7.083} Note, Round changes the values. If you desire is to change the display but not the values use NumberForm or set your preferences to display the number of digits you like. This last can be done by clicking on the Appearance tab then the Numbers tab in the preferences dialog and then setting things to suit your preferences.