Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2014

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

Search the Archive

Re: Plotting Data By State

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132676] Re: Plotting Data By State
  • From: Joe Gwinn <joegwinn at comcast.net>
  • Date: Sat, 3 May 2014 03:40:55 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <ljvdb7$ba0$1@smc.vnet.net>

In article <ljvdb7$ba0$1 at smc.vnet.net>, Alexandra Lipson
<lipson.alexandra at gmail.com> wrote:

> Hello All,
> 
> I am trying to plot manipulated crime data from 1973 on a United States map
> to show the comparisons of the number of arrests of certain crimes to the
> number of actual crimes committed in a specific year. I want to show
> whether there are more arrests than crimes or more crimes than arrests in
> each state.
> 
> I am new to Mathematica and would love some help. Here is what I have so
> far...(data manipulation still in progress):
> 
> data = Import["/Users/allielipson/Desktop/USArrests.csv"];
> alPop = 4000000;
> akPop = 300000;
[snip]
> 
> crimeData =
>  Import["http://hci.stanford.edu/jheer/workshop/data/crime/CrimeStatebyState.csv";]
[snip]
> 

The general pattern is as follows:

ListPlot[ Transpose[{listA, listB}] ]

The lists must have the same length, or Transpose will bark at you.

ListPlot[ Transpose[{listA, listB}], Joined->True] will draw lines
between the points.

ListPlot[ {Transpose[{listA, listB}], Transpose[{listC, listD}]} ] will
co-plot the two curves.

And so on.

One can also do the Transposes in advance:

listAB = Transpose[{listA, listB}];

listCD = Transpose[{listC, listD}];

The trailing semicolons prevent the whole matrix from being printed out
at length.

ListPlot[{listAB, listCD}, Joined->True]


Joe Gwinn



  • Prev by Date: Re: How to avoid repeated recalculation of the same function
  • Next by Date: Re: How to avoid repeated recalculation of the same function
  • Previous by thread: Re: Plotting Data By State
  • Next by thread: Re: Copying Text From CDFs