Plotting a segmentation plot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a data frame
Rfm Count %
0 111 88824 57.13
1 112 5462 3.51
2 121 32209 20.72
3 122 15155 9.75
4 211 5002 3.22
5 212 1002 0.64
6 221 3054 1.96
7 222 4778 3.07
How can I plot a graph like this?
Background - The numbers are the RFM scores.
R is Repeat (number of days since customer ordered)
F is frequency (number of jobs from customers)
M is monetary (how much customer is paying)
The R,F
and M
scores are either 1 (bad)
or 2 (good)
.
I would like to segment them into 4 Quadrants
.
I would also like the size of the blob
to be proportional to the percentage.
I.e. blob 111 (57%)
will be much larger than blob 212 (0.64%)
.
I really want to get better at data visualization, please help a beginner out. I'm familiar with seaborn
and matplotlib
.
Ps: Is it possible to add a third dimension to the plot? 3rd Dim would be the frequency.
Edit: The second image is a simple static way of achieveing my goal. Any input for doing it with matplotlib or seaborn? For a more interesting illustration.
[Second Image]
(https://i.stack.imgur.com/AuzEM.jpg)
python matplotlib data-visualization visualization seaborn
add a comment |
I have a data frame
Rfm Count %
0 111 88824 57.13
1 112 5462 3.51
2 121 32209 20.72
3 122 15155 9.75
4 211 5002 3.22
5 212 1002 0.64
6 221 3054 1.96
7 222 4778 3.07
How can I plot a graph like this?
Background - The numbers are the RFM scores.
R is Repeat (number of days since customer ordered)
F is frequency (number of jobs from customers)
M is monetary (how much customer is paying)
The R,F
and M
scores are either 1 (bad)
or 2 (good)
.
I would like to segment them into 4 Quadrants
.
I would also like the size of the blob
to be proportional to the percentage.
I.e. blob 111 (57%)
will be much larger than blob 212 (0.64%)
.
I really want to get better at data visualization, please help a beginner out. I'm familiar with seaborn
and matplotlib
.
Ps: Is it possible to add a third dimension to the plot? 3rd Dim would be the frequency.
Edit: The second image is a simple static way of achieveing my goal. Any input for doing it with matplotlib or seaborn? For a more interesting illustration.
[Second Image]
(https://i.stack.imgur.com/AuzEM.jpg)
python matplotlib data-visualization visualization seaborn
1
Love the hand-drawn graph, but I'm really not clear on what you are trying to accomplish. How are x & y values determined? Where are these quadrants coming from? IsCount
used for anything?
– busybear
Nov 15 '18 at 22:40
Hi busybear, the RFM values are discrete categories. So in a sense it’s categorical data. The ‘x’ is an increase in the ‘R’ value- ‘1 or 2’. For example, ‘122’ is a ‘R’ score of ‘1’, ‘F’ score of ‘2’ and ‘M’ score of ‘2’. The quadrants are my idea of grouping them. ‘Count’ was used to find out how many rows of data fell into each RFM category. My original data frame had around 27k rows.
– Imran Iskandar
Nov 16 '18 at 0:07
add a comment |
I have a data frame
Rfm Count %
0 111 88824 57.13
1 112 5462 3.51
2 121 32209 20.72
3 122 15155 9.75
4 211 5002 3.22
5 212 1002 0.64
6 221 3054 1.96
7 222 4778 3.07
How can I plot a graph like this?
Background - The numbers are the RFM scores.
R is Repeat (number of days since customer ordered)
F is frequency (number of jobs from customers)
M is monetary (how much customer is paying)
The R,F
and M
scores are either 1 (bad)
or 2 (good)
.
I would like to segment them into 4 Quadrants
.
I would also like the size of the blob
to be proportional to the percentage.
I.e. blob 111 (57%)
will be much larger than blob 212 (0.64%)
.
I really want to get better at data visualization, please help a beginner out. I'm familiar with seaborn
and matplotlib
.
Ps: Is it possible to add a third dimension to the plot? 3rd Dim would be the frequency.
Edit: The second image is a simple static way of achieveing my goal. Any input for doing it with matplotlib or seaborn? For a more interesting illustration.
[Second Image]
(https://i.stack.imgur.com/AuzEM.jpg)
python matplotlib data-visualization visualization seaborn
I have a data frame
Rfm Count %
0 111 88824 57.13
1 112 5462 3.51
2 121 32209 20.72
3 122 15155 9.75
4 211 5002 3.22
5 212 1002 0.64
6 221 3054 1.96
7 222 4778 3.07
How can I plot a graph like this?
Background - The numbers are the RFM scores.
R is Repeat (number of days since customer ordered)
F is frequency (number of jobs from customers)
M is monetary (how much customer is paying)
The R,F
and M
scores are either 1 (bad)
or 2 (good)
.
I would like to segment them into 4 Quadrants
.
I would also like the size of the blob
to be proportional to the percentage.
I.e. blob 111 (57%)
will be much larger than blob 212 (0.64%)
.
I really want to get better at data visualization, please help a beginner out. I'm familiar with seaborn
and matplotlib
.
Ps: Is it possible to add a third dimension to the plot? 3rd Dim would be the frequency.
Edit: The second image is a simple static way of achieveing my goal. Any input for doing it with matplotlib or seaborn? For a more interesting illustration.
[Second Image]
(https://i.stack.imgur.com/AuzEM.jpg)
python matplotlib data-visualization visualization seaborn
python matplotlib data-visualization visualization seaborn
edited Nov 16 '18 at 0:01
Imran Iskandar
asked Nov 15 '18 at 15:35
Imran IskandarImran Iskandar
214
214
1
Love the hand-drawn graph, but I'm really not clear on what you are trying to accomplish. How are x & y values determined? Where are these quadrants coming from? IsCount
used for anything?
– busybear
Nov 15 '18 at 22:40
Hi busybear, the RFM values are discrete categories. So in a sense it’s categorical data. The ‘x’ is an increase in the ‘R’ value- ‘1 or 2’. For example, ‘122’ is a ‘R’ score of ‘1’, ‘F’ score of ‘2’ and ‘M’ score of ‘2’. The quadrants are my idea of grouping them. ‘Count’ was used to find out how many rows of data fell into each RFM category. My original data frame had around 27k rows.
– Imran Iskandar
Nov 16 '18 at 0:07
add a comment |
1
Love the hand-drawn graph, but I'm really not clear on what you are trying to accomplish. How are x & y values determined? Where are these quadrants coming from? IsCount
used for anything?
– busybear
Nov 15 '18 at 22:40
Hi busybear, the RFM values are discrete categories. So in a sense it’s categorical data. The ‘x’ is an increase in the ‘R’ value- ‘1 or 2’. For example, ‘122’ is a ‘R’ score of ‘1’, ‘F’ score of ‘2’ and ‘M’ score of ‘2’. The quadrants are my idea of grouping them. ‘Count’ was used to find out how many rows of data fell into each RFM category. My original data frame had around 27k rows.
– Imran Iskandar
Nov 16 '18 at 0:07
1
1
Love the hand-drawn graph, but I'm really not clear on what you are trying to accomplish. How are x & y values determined? Where are these quadrants coming from? Is
Count
used for anything?– busybear
Nov 15 '18 at 22:40
Love the hand-drawn graph, but I'm really not clear on what you are trying to accomplish. How are x & y values determined? Where are these quadrants coming from? Is
Count
used for anything?– busybear
Nov 15 '18 at 22:40
Hi busybear, the RFM values are discrete categories. So in a sense it’s categorical data. The ‘x’ is an increase in the ‘R’ value- ‘1 or 2’. For example, ‘122’ is a ‘R’ score of ‘1’, ‘F’ score of ‘2’ and ‘M’ score of ‘2’. The quadrants are my idea of grouping them. ‘Count’ was used to find out how many rows of data fell into each RFM category. My original data frame had around 27k rows.
– Imran Iskandar
Nov 16 '18 at 0:07
Hi busybear, the RFM values are discrete categories. So in a sense it’s categorical data. The ‘x’ is an increase in the ‘R’ value- ‘1 or 2’. For example, ‘122’ is a ‘R’ score of ‘1’, ‘F’ score of ‘2’ and ‘M’ score of ‘2’. The quadrants are my idea of grouping them. ‘Count’ was used to find out how many rows of data fell into each RFM category. My original data frame had around 27k rows.
– Imran Iskandar
Nov 16 '18 at 0:07
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53322843%2fplotting-a-segmentation-plot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53322843%2fplotting-a-segmentation-plot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Love the hand-drawn graph, but I'm really not clear on what you are trying to accomplish. How are x & y values determined? Where are these quadrants coming from? Is
Count
used for anything?– busybear
Nov 15 '18 at 22:40
Hi busybear, the RFM values are discrete categories. So in a sense it’s categorical data. The ‘x’ is an increase in the ‘R’ value- ‘1 or 2’. For example, ‘122’ is a ‘R’ score of ‘1’, ‘F’ score of ‘2’ and ‘M’ score of ‘2’. The quadrants are my idea of grouping them. ‘Count’ was used to find out how many rows of data fell into each RFM category. My original data frame had around 27k rows.
– Imran Iskandar
Nov 16 '18 at 0:07