Questions about building charts in Mathematica. This includes generating the graphics, prettifying them, and using methods to extract their data.
Questions tagged [charts]
442 questions
9
votes
2 answers
How to create a stacked BarChart with custom bar origins as function?
I want to create a simple stacked bar chart where the bars start a custom y-axis point and end at another y-axis point.
So far I have:
BarChart[{{2, 4}, {-2, 6}}, ChartLayout -> "Stacked"]
which gives:
However, I want a single bar on the left that…
Thomas Fankhauser
- 561
- 3
- 9
9
votes
3 answers
Decrease padding around Bar Chart
I don't like the default amount of padding / white space around BarChart. How can I specify it?
BarChart[{1, 2, 3}]
Tom
- 3,416
- 1
- 18
- 33
9
votes
3 answers
Plot PieChart as a line (or as a stacked BarChart)
How to plot relative proportions on a line? IE PieChart as stacked BarChart that is normalised.
For example,
diversityCoearse = {"Firmicutes" -> 1000,
"Bacteroidetes" -> 200, "Verrucomicrobia" -> 20,
"Proteobacteria" -> 40, "Actinobacteria" ->…
Karolis
- 1,639
- 1
- 12
- 25
8
votes
3 answers
Waterfall Stacked BarChart
Trying to make a waterfall bar chart. I got this far:
yData = {10, 7, 4, 2}
upFromX = Accumulate[yData] - yData
xyDataWithUplift =
Table[{Style[upFromX[[i]], White], yData[[i]]}, {i, 1, Length[yData]}]
BarChart[xyDataWithUplift, ChartLayout ->…
Joe
- 1,467
- 7
- 13
7
votes
2 answers
To Work with Barchart or DiscretePlot?
I would like to create a graph similar to this below using some slightly dotted bar style like the one shown in the figure ...
And I'm trying to open a space between bars 6 and 8, but I'm failing.
Any idea?
g = Plot[3 - 1/2 x, {x, 0, 14}, PlotRange…
LCarvalho
- 9,233
- 4
- 40
- 96
6
votes
2 answers
stacked BarChart shows no edges for big list of data
For big numbers of columns, a stacked BarChart does not display edges anymore. For low numbers of columns they appear again. Is there a way to force Mathematica displaying the edges, even for big lists?
Here is an example:
no…
Kilian
- 145
- 4
6
votes
2 answers
Tuning BoxWhiskerChart
I have a large set of experimental data points (n) and I want perform some statistics on them. Particularly instead of showing all data points using ListPlot I want to narrow this set into several smaller intervals with defined width (m) and show…
Bulat
- 323
- 2
- 9
6
votes
2 answers
Change Edgeform for specific boxes in BoxWhiskerChart
I would like to change every second member of a pair in a BoxWhiskerChart to have a dashed EdgeForm.
I can create a chart where all the boxes have the dashed EdgeForm. For example, the following creates four pairs of data blocks, and colors each…
ben18785
- 3,167
- 15
- 28
6
votes
2 answers
Floating Bar Chart
Does anyone know how to make floating bar charts in Mathematica v11.0? I can't seem to find any similar thread or related documentation. I'd like to make a simple one like the one above.
drc7af
- 63
- 2
5
votes
3 answers
Retrieving PlotRange from BarChart
Consider the following data:
data1={73.9377, 54.4122, 53.0826, 24.1936};
data2={76.828, 49.1673, 45.7883, 18.9015};
I defined my own BarChart as follows:
MyBarCharts[list_]:=
BarChart[
list,
Frame -> {{True, None}, {True, None}}
]
When…
John
- 4,361
- 1
- 26
- 41
5
votes
3 answers
Striped bar in a bar chart
This is my code:
BarChart[{{0.25, 0.4, 0.15}, {0.172, 0.25, 0.18}, {0.101, 0.26,
0.17}},
BarSpacing -> {0.15, 1}, PlotTheme -> "Business",
ChartLegends -> {Text[Style["BXE", 12]],
Text[Style["CXE", 12]],
Text[Style["TQ", 12]]},
…
Andrea
- 53
- 4
4
votes
2 answers
How can I create a chart like CandlestickChart, but for non-financial data with something other than dates as the abscissæ?
I'd like to create charts reporting on Monte-Carlo experiments using something like a candlestick chart: four figures for each run with a varying parameter, eg min, mean - σ, mean + σ, max of the simulation output. A CandlestickChart would do,…
Keith Braithwaite
- 41
- 3
4
votes
1 answer
Can I Center Chart Elements in BarChart
I am generating a bar chart in which each count is to be represented by a disk (or something similar). This alone seems straightforward: simply set the option ChartElements -> Graphics@Disk[]. But alas, it's not perfect, as shown by the following…
Aaron Eiben
- 541
- 2
- 11
4
votes
2 answers
Stacked Bar Chart with individual spacings to compare pairs of bars
I would like to plot a stacked BarChart
BarChart[RandomReal[1, {6, 4}], ChartLayout -> "Percentile"]
with modified BarSpacing, so I get 3 pairs of stacked bars being more closely together, so it is implied they belong together and can be compared…
Kilian
- 145
- 4
4
votes
4 answers
"Striped bar in a bar chart" problems with available approach
while searching for solutions making textures in bar charts possible, I found this code posted by the user halmir here:
Hatched bars and bar-specific background in BarChart
Unfortunately this doesn't work for low chart heights, which are smaller…
Kilian
- 145
- 4