Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.math.mathematica > #16897

Re: Plotting Data By State

From Joe Gwinn <joegwinn@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Plotting Data By State
Date 2014-05-03 07:41 +0000
Message-ID <lk26iq$12i$1@smc.vnet.net> (permalink)
References <ljvdb7$ba0$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


In article <ljvdb7$ba0$1@smc.vnet.net>, Alexandra Lipson
<lipson.alexandra@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

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar


Thread

Plotting Data By State Alexandra Lipson <lipson.alexandra@gmail.com> - 2014-05-02 06:18 +0000
  Re: Plotting Data By State Joe Gwinn <joegwinn@comcast.net> - 2014-05-03 07:41 +0000

csiph-web