Skip to main content

Bubble chart

Download original notebook
BubbleChart[RandomReal[1, {5, 7, 3}]]
(*VB[*)(FrontEndRef["44f319c3-084b-4355-bf29-f7afde4f7de0"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKm5ikGRtaJhvrGliYJOmaGJua6ialGVnqppknpqWkmqSZp6QaAAB86xXd"*)(*]VB*)
BubbleChart[RandomReal[1, {10, 3}], 
 ChartElementFunction -> "NoiseBubble"]
(*VB[*)(FrontEndRef["f79760d0-3fd5-41d4-8bef-5cd40ce1f85e"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKp5lbmpsZpBjoGqelmOqaGKaY6FokpabpmianmBgkpxqmWZimAgCF8xYP"*)(*]VB*)

Bar Charts

Generate a bar chart for a list of heights

BarChart[{1, 2, 3}]
(*VB[*)(FrontEndRef["bc6440fb-800a-4b9a-885c-967b69a33838"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKJyWbmZgYpCXpWhgYJOqaJFkm6lpYmCbrWpqZJ5lZJhobWxhbAACE3RVQ"*)(*]VB*)

Multiple datasets

BarChart[{{1, 2, 3}, {1, 3, 2}, {5, 2}}, 
 ChartLabels -> {"a", "b", "c"}, LabelingFunction -> Above]
(*VB[*)(FrontEndRef["37f38a18-eaa6-44bf-aa2f-bcd29fc1b204"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKG5unGVskGlropiYmmumamCSl6SYmGqXpJiWnGFmmJRsmGRmYAACPYhZV"*)(*]VB*)

Categorical legends

BarChart[{{1, 2, 3}, {1, 3, 2}, {5, 2}}, 
 ChartLegends -> {"a", "b", "c"}]
(*VB[*)(FrontEndRef["04343707-6532-46f9-ad2d-ca2228fb2f46"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKG5gYmxibG5jrmpkaG+mamKVZ6iamGKXoJicaGRlZpCUZpZmYAQBuWBUP"*)(*]VB*)

Sector charts

A sector chart with the second component representing the radial size

SectorChart[{{1, 1}, {1, 2}, {1, 3}}]
(*VB[*)(FrontEndRef["199a2580-954b-4151-8652-904912b8ba92"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKG1paJhqZWhjoWpqaJOmaGJoa6lqYmRrpWhqYWBoaJVkkJVoaAQBpUxRb"*)(*]VB*)

An anuual sector chart

SectorChart[{{1, 1}, {1, 2}, {1, 3}}, SectorOrigin -> {Automatic, 1}]
(*VB[*)(FrontEndRef["e3409c35-8582-4b3f-a317-13e8585a18d7"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKpxqbGFgmG5vqWphaGOmaJBmn6SYaG5rrGhqnAkVMEw0tUswBdjIU7Q=="*)(*]VB*)

Pie chart

Generate a pie chart for a list of values

PieChart[{1, 2, 3, 4}]
(*VB[*)(FrontEndRef["2a87b6f8-cea7-4c17-863d-070124d53f1e"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKGyVamCeZpVnoJqcmmuuaJBua61qYGafoGpgbGBqZpJgapxmmAgCFTRV1"*)(*]VB*)

Multiple datasets and categorical labels

PieChart[{{1, 2, 3}, {2, 2, 1}}, ChartLabels -> {"a", "b", "c"}]
(*VB[*)(FrontEndRef["7f26095d-4a5a-4740-98ba-53418641c212"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKm6cZmRlYmqbomiSaJuqamJsY6FpaJCXqmhqbGFqYmRgmGxkaAQB3exSw"*)(*]VB*)

Or as legends

PieChart[{{1, 2, 3}, {2, 2, 1}}, ChartLegends -> {"a", "b", "c"}]
(*VB[*)(FrontEndRef["f397805e-de62-4a70-ae83-3de12aa36421"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKpxlbmlsYmKbqpqSaGemaJJob6CamWhjrGqekGholJhqbmRgZAgCC3RVt"*)(*]VB*)

Histogram

Generate a histogram for a list of values

Histogram[RandomVariate[NormalDistribution[0, 1], 200]]
(*VB[*)(FrontEndRef["895e4d03-4888-4fa1-89c5-db965f80a20e"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKW1iappqkGBjrmlhYWOiapCUa6lpYJpvqpiRZmpmmWRgkGhmkAgB67BVa"*)(*]VB*)

Multiple datasets

data1 = RandomVariate[NormalDistribution[0, 1], 500];
data2 = RandomVariate[NormalDistribution[3, 1/2], 500];

Histogram[{data1, data2}]
(*VB[*)(FrontEndRef["638c18ec-495a-4a48-93ea-ae6025807404"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKmxlbJBtapCbrmliaJuqaJJpY6FoapybqJqaaGRiZWhiYmxiYAAB/xRUY"*)(*]VB*)

Stylize the data

Histogram[{data1, data2}, ChartStyle -> "Pastel"]
(*VB[*)(FrontEndRef["b2add816-91a1-49fa-abf7-b8f36e7c0d2b"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKJxklpqRYGJrpWhomGuqaWKYl6iYmpZnrJlmkGZulmicbpBglAQCQRBZf"*)(*]VB*)

Use color function

Histogram[RandomVariate[NormalDistribution[0, 1], 500], 
 ColorFunction -> Function[{height}, Opacity[height]], 
 ChartStyle -> Purple]
(*VB[*)(FrontEndRef["01fe870c-d01c-4623-8d3e-aa0bea69f17d"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKGximpVqYGyTrphgYJuuamBkZ61qkGKfqJiYaJKUmmlmmGZqnAACE9RX3"*)(*]VB*)

Get the wind data directions

data = WeatherData["KCMI", 
   "WindDirection", {{2007, 11, 1}, {2008, 11, 1}}]
(*VB[*)temporalStorage$434371(*,*)(*"1:eJwlk8uyqkYARa0kg1S+IrmjcyRVvEQkM16CCAgCjXjrDhAbEHnZPLrl63NuMlm1a4/X+uvWnfNfVqvV8McX9Ptj7BB4QBxov65W4aOBAUQPOHz/WAPl+/rzz4/13+vPj/U39h9oLS64szNXyf6VGrj07IW9zoe9xpFUpuRDD3zG7o/wrexGFeyA6hdMigJNM5WDmFTk/SyISW08DrWlyXVGA6L8Xmp2JeYUFPhZwoLJpDuXb7LgdVHBW54Ue1fabSoWQZCVV0e7XgoPT4GtlDmTMtGBaMvAlUYdqKSEtN0JlGFs9CVuwqHwn7dDiInnW4TwmM9xd3ROFwdrENfmxaSTbb0BKr48qeWIGKDCaLKTdxF5oUg31En0RGV0LNYO5UxfKLZNTOdAAnglXrZ/2L1tKZBQ4dRx+SLPDmqHKnpml5zRErpm0z45mkugRQ7Poj72mdFlmc1eQkXxMOptuZyGlGdNhs1uCU6hW/qUGKhHMXheMuQIRC+7LTVm7kvSSkSa9qQ1uDVT2jk27b3Fo3OY51sv3SsHxSLzQlXuTjEzNz0tlkIiHZkQeNPEkF4QFmusb9KbCbUtY1WQumzi8Nqee3DvzVG5CpfFBxTfF0J7orew3nsozV8YGCKybdqId2JSHETu6sI4efLCtGxoKhu41jFSaT/wjKBKJzzInt45+15lpEmiylNQU6p2L9UmkUNrcEY6LyLgOF3dsWJRvTbJhnD+8x1Ay/CIwmNjKLyd77FcPOF74FzPX1bgXn3r6jaz0xZYuTKjE7mNTxSR8ijszJiz9rkC5IyO3HoG+k1VD2xXIpXgvbrlLStV+BgsYf7IsiF9Az+zkFvW+mvfGqhS0Jk4bYggqzzxMrEGH221MnoY80OHYC5eoxVzVRPGcpidqc7rBsMdVPji1EZqrsU0iErBeXQtYU+VnGP47WcjP4Cy/vzxf1y/feE81TD4/eeA6f3U1u//3hBN8F91ziMf"*)(*]VB*)

Define a chart element function that stores bin width and count data using Sow

sowingBar[{{x0_, x1_}, {y0_, y1_}}, __] := (Sow[{x1 - x0, 
    100*(y1 - y0)}]; Rectangle[{x0, y0}, {x1, y1}])
{histogram, newdata} = 
  Reap[Histogram[data, Automatic, "Probability", 
    ChartElementFunction -> sowingBar]];

histogram 
(*VB[*)(FrontEndRef["dc7525c1-be14-45e7-af40-d90ae8897092"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKpySbmxqZJhvqJqUamuiamKaa6yammRjoplgaJKZaWFiaG1gaAQCHWxV7"*)(*]VB*)

Create a polar histogram of the wind-direction frequencies:

SectorChart[newdata, SectorOrigin -> {Pi/2, "Clockwise"}, 
 PolarAxes -> True, PolarGridLines -> Automatic, 
 PlotRange->{2 Pi {-1,1}, 2 Pi {-1,1}},
 ChartBaseStyle -> Directive[Opacity[1], EdgeForm[Thin]]]
(*VB[*)(FrontEndRef["50e54f29-0e9c-4444-8d80-685158f6c2fa"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKmxqkmpqkGVnqGqRaJuuaAIGuRYqFga6ZhamhqUWaWbJRWiIAd3kVJQ=="*)(*]VB*)

Warning: ticks styling in polar plots are not supported for now.