MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Histogram: Show all y-axis labels

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84584] Re: Histogram: Show all y-axis labels
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sat, 5 Jan 2008 04:39:45 -0500 (EST)
  • References: <flk2ld$c37$1@smc.vnet.net>

Even when one puts in an explicit PlotRange that includes 25 it still 
doesn't work! That seems to say that with the Histogram plots one loses 
control of PlotRange. I did it with the Presentations package by extracting 
the rectangles and specifying the overall plot options outside of the 
Histogram plot.

Needs["Presentations`Master`"]
Needs["Histograms`"]

dataMEL = {-4.83862134428094, -4.83351849578614, -4.83123661371209, \
-4.81857651435823, -4.81697757870106, -3.63077685340039, \
-3.61990031264591, -3.620454208474, -3.75255271241551, \
-3.7486505523438, -3.74916778278202, -3.58883703915387, \
-3.58852150625745, -3.58668274158127, -3.58621380313637, \
-3.58379329218558, -3.58532018279469, -3.58168270891649, \
-2.83638122975842, -2.83638122975842, -2.83638122975842, \
-2.83638122975842, -2.83638122975841, -2.83638122975842, \
-2.83638122975842, -2.83638122975842, -2.83244782284006, \
-2.83244782284006, -2.83244782284005, -2.83244782284007, \
-2.83244782284007, -2.83244782284006, -2.83244782284007, \
-3.10024726246057, -3.10024726246058, -3.10024726246057, \
-3.10024726246058, -3.10024726246057, -3.10024726246058, \
-3.10024726246058, -3.03349306726057, -3.03349306726058, \
-3.01775973392724, -12.0334297635584, -12.0021027632925, \
-12.0126901267091, -12.0413883877193, -12.0899536741477, \
-12.1140833164439, -12.1140833164439, -12.1041896779377, \
-12.1074037093026, -12.009648655543, -11.9652667636422, \
-12.0079380870759, -11.5326068667369, -11.5223548336914, \
-11.0075839226891, -10.9744702929917, -10.9204761885454, \
-10.9237709504502, -10.7225164034228, -10.7334579272323};

Draw2D[
 {Histogram[dataMEL,
    HistogramCategories -> Range[-15, 0, 1],
    HistogramRange -> {-15, 0}] // DrawGraphics},
 AspectRatio -> 1/GoldenRatio,
 PlotRange -> {{-15, 0}, {0, 25}},
 Frame -> True,
 FrameTicks -> {{Range[0, 25, 5], None}, {Range[-15, 0], None}},
 GridLines -> {None, Range[0, 25, 5]},
 ImageSize -> {600, 400}]


-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/


<tomfabtastic at hotmail.com> wrote in message 
news:flk2ld$c37$1 at smc.vnet.net...
> Hi,
>
> I am using version 6.0.1. The below histogram works well, except that
> I want the y-axis labels to extend to 25 (and not stop at 20). I can
> achieve this with other graphs, but the options are slightly different
> with Histogram, so perhaps the order that the options are specified
> isimportant ? Can someone please suggest a solution.
>
> dataMEL = {-4.83862134428094, -4.83351849578614, -4.83123661371209, \
> -4.81857651435823, -4.81697757870106, -3.63077685340039, \
> -3.61990031264591, -3.620454208474, -3.75255271241551, \
> -3.7486505523438, -3.74916778278202, -3.58883703915387, \
> -3.58852150625745, -3.58668274158127, -3.58621380313637, \
> -3.58379329218558, -3.58532018279469, -3.58168270891649, \
> -2.83638122975842, -2.83638122975842, -2.83638122975842, \
> -2.83638122975842, -2.83638122975841, -2.83638122975842, \
> -2.83638122975842, -2.83638122975842, -2.83244782284006, \
> -2.83244782284006, -2.83244782284005, -2.83244782284007, \
> -2.83244782284007, -2.83244782284006, -2.83244782284007, \
> -3.10024726246057, -3.10024726246058, -3.10024726246057, \
> -3.10024726246058, -3.10024726246057, -3.10024726246058, \
> -3.10024726246058, -3.03349306726057, -3.03349306726058, \
> -3.01775973392724, -12.0334297635584, -12.0021027632925, \
> -12.0126901267091, -12.0413883877193, -12.0899536741477, \
> -12.1140833164439, -12.1140833164439, -12.1041896779377, \
> -12.1074037093026, -12.009648655543, -11.9652667636422, \
> -12.0079380870759, -11.5326068667369, -11.5223548336914, \
> -11.0075839226891, -10.9744702929917, -10.9204761885454, \
> -10.9237709504502, -10.7225164034228, -10.7334579272323};
> Needs["Histograms`"]
> Histogram[dataMEL, Frame -> True,
> HistogramCategories -> Range[-15, 0, 1], HistogramRange -> {-15, 0},
> FrameTicks -> {{Range[0, 25, 5], None}, {Range[-15, 0], None}},
> GridLines -> { None, Range[0, 25, 5]}, ImageSize -> {600, 400}]
>
> 



  • Prev by Date: Re: Histogram: Show all y-axis labels
  • Next by Date: Code or algorithm that selects tickets in turn in Mathematica software.
  • Previous by thread: Re: Histogram: Show all y-axis labels
  • Next by thread: Re: Histogram: Show all y-axis labels