Plotting a segmentation plot












2














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.



enter image description here



[Second Image]



(https://i.stack.imgur.com/AuzEM.jpg)










share|improve this question




















  • 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
















2














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.



enter image description here



[Second Image]



(https://i.stack.imgur.com/AuzEM.jpg)










share|improve this question




















  • 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














2












2








2


1





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.



enter image description here



[Second Image]



(https://i.stack.imgur.com/AuzEM.jpg)










share|improve this question















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.



enter image description here



[Second Image]



(https://i.stack.imgur.com/AuzEM.jpg)







python matplotlib data-visualization visualization seaborn






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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? 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














  • 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








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












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
});


}
});














draft saved

draft discarded


















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
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)