Mosaic plots and image-plots use color and area in a 2-d discrete matrix to display "three way" categorical relationships.
Questions tagged [mosaic-plot]
76 questions
1
vote
0 answers
Is it possible to make a mosaic heatmap in matplotlib?
Is there a way in matplotlib to generate a heatmap with white space between blocks that I define. For example, I have a 100x100 matrix. I define 4 blocks as follows
block1 = mat[0:50,0:50]
block2 = mat[0:25,50:100]
block3 =…

David Wang
- 87
- 1
- 5
1
vote
0 answers
Create mosaic with stitching using aerial multiple images
i'm trying to create a mosaic using aerial street images.
I wrote with python language an stitching algorithm, but in this implementation stitch two images from right to left, how can i do this in all spatial directions?
I want to re create a…

Alessandro Minervini
- 113
- 2
- 9
1
vote
1 answer
Change the default colors of a mosaic plot
I want to change the color of this mosaic plot to make it printable in black in white but can't find a way to change this parameter
from statsmodels.graphics.mosaicplot import mosaic
import matplotlib.pyplot as plt
import pandas
x = ['yes', 'yes',…

Pilven Matthieu
- 77
- 8
1
vote
1 answer
Rotating y axis labels with mosaic plots WITHOUT overlap
This question is extremely similar to this one yet from another point of view which has not been responded.
Following the proposed code, I am able to generate mosaic plots and rotate the labels so that they are legible. The problem comes when (it…

boski
- 2,437
- 1
- 14
- 30
1
vote
2 answers
product() in geom_mosaic() not accepting reactive inputs on R Shiny?
I'm playing around with the geom_mosaic() function (part of the ggmosaic package) on R Shiny and came up with a problem I've been trying to solve for a few days.
First, some sample data:
a <- "a"
b <- "b"
c <- "c"
df <- tribble(
~id, ~var1,…

Felix T.
- 520
- 3
- 11
1
vote
1 answer
How To Rotate Labels when using Mosaic Plots within VCD
I am trying to rotate labels (not variable names) for a plot I have created, and I am struggling to find and adopt any workable solution. As you can see the labels are not readable I the current form.
Plot is looking into reasons for planning…

Data Bludgeonist
- 11
- 2
1
vote
1 answer
Error when using Unicode characters to display mathematical operators in a mosaic plot
For example, this works:
library("vcd")
library("vcdExtra")
ppp1 <- Arthritis[,-1]
ppp1 <- ppp1 [,-3]
colnames(ppp1)[1] <- "Dose"
colnames(ppp1)[3] <- "Symptoms"
ppp1$Symptoms <- ordered(ppp1$Symptoms,
levels = c("None", "Some", "Marked"),
labels =…

Krantz
- 1,424
- 1
- 12
- 31
1
vote
1 answer
How to color code a categorical variable in a mosaic
I am trying to display a relationship between my categorical variables. I finally got my data into what I believe is a contingency table
subs_count
## [,1] [,2] [,3] [,4]
## carbohydrate 2 0 11 2
## cellulose 18 …

d20chick
- 35
- 1
- 8
1
vote
1 answer
Flipping a mosaic plot in R
I have a mosaic plot that looks like
but I need to show the proportions of Countries relative to roles, i.e. flip the chart. Is it possible to do without transposing the table?
thanks.

Eloo
- 125
- 11
1
vote
2 answers
Relabel the bins in a mosaic plot
In a mosaicplot, how do I relabel the bins?
dat <- data.frame(letters = sample(LETTERS[1:3], 15, replace = TRUE),
numbers = sample(3, 15, replace = TRUE))
mosaicplot(table(dat))
That is, how can I change the "A", "B", and "C" in…
user8183921
1
vote
0 answers
Issues adding labels to mosaic3d plot in r
I am able to see labels if I use the simple 2d mosaic() function based on this example below.
labs <- round(prop.table(Titanic), 2)
mosaic(Titanic, pop = FALSE)
labeling_cells(text = labs, margin = 0)(Titanic)
However if i try to change this to…

Jill Sellum
- 319
- 2
- 4
- 14
1
vote
1 answer
How to get xlab and ylab to work in mosaic plots in vcd package
For some reason I cannot get xlab and ylab to work in mosaic plots in vcd package.
I tried:
mosaic(~Sex +Survived,
data=Titanic,
shade=T,
legend=T,
main="myplot",
labeling_args=list(abbreviate = c( Sex=2,…

Studiosa
- 21
- 3
1
vote
2 answers
dotplot dot not showing up and format of dot plot
How can I show the dots colored using the mosaic package to do a dotplot?
library(mosaic)
n=500
r =rnorm(n)
d = data.frame( x = sample(r ,n= 1,size = n, replace = TRUE), color = c(rep("red",n/2), rep("green",n/2)))
dotPlot(d$x,breaks =…

user3022875
- 8,598
- 26
- 103
- 167
0
votes
1 answer
mosaic plot with two variables
This time i am struggling with plotting a mosaic plot. I have 9 town districts and in every district individuals were scored health score 1 or health score 2+3. I want to visualise this in a plot but i can't seem to get it to work.
My dataset:
>…

Eonear Black
- 33
- 6
0
votes
0 answers
How to control font properties of the label of a mosaic plot python
I'm drawing a mosaic plot using statsmodel in python.
I manage to control x and y axis properties using ax.
But I don't know how to control the labels font properties, i.e, to change the style and the size.
Or even to write whatever i want in the…

Alon8200
- 151
- 1
- 2
- 8