How do I change the xticks on a set boxplot subplots such that it is in words and complete?How to know/change current directory in Python shell?How to set Python's default version to 3.x on OS X?Subplot for seaborn boxplotRotate xtick labels in seaborn boxplot?Python - How can I find difference between two rows of same column using loop in CSV file?changing xticks and yticksChanging xticks in a pandas plotHow to set title and ylims for subplots in seabornplot changes not affecting all subplotsHow to hide or set location for hvplot subplots title
TSA asking to see cell phone
Inadvertently nuked my disk permission structure - why?
3D Statue Park: U shapes
How do I address my Catering staff subordinate seen eating from a chafing dish before the customers?
Why are there not any MRI machines available in Interstellar?
How do campaign rallies gain candidates votes?
What is the lowest-speed bogey a jet fighter can intercept/escort?
Why is my read in of data taking so long?
How may I concisely assign different values to a variable, depending on another variable?
How do I run a game when my PCs have different approaches to combat?
How do I generate distribution of positive numbers only with min, max and mean?
How important is a good quality camera for good photography?
Can two figures have the same area, perimeter, and same number of segments have different shape?
Spoken encryption
Timing/Stack question about abilities triggered during combat
This message is flooding my syslog, how to find where it comes from?
The seven story archetypes. Are they truly all of them?
Automatic Habit of Meditation
How to copy a file transactionally?
How to judge a Ph.D. applicant that arrives "out of thin air"
What is the difference between 1/3, 1/2, and full casters?
Spin vs orbital angular momenta in QFT
Is it normal practice to screen share with a client?
Convert a string like 4h53m12s to a total number of seconds in JavaScript
How do I change the xticks on a set boxplot subplots such that it is in words and complete?
How to know/change current directory in Python shell?How to set Python's default version to 3.x on OS X?Subplot for seaborn boxplotRotate xtick labels in seaborn boxplot?Python - How can I find difference between two rows of same column using loop in CSV file?changing xticks and yticksChanging xticks in a pandas plotHow to set title and ylims for subplots in seabornplot changes not affecting all subplotsHow to hide or set location for hvplot subplots title
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
How do I change the xticks on a set boxplot subplots such that name appears i.e. 'March' instead of 3.0 and the full year is included even if there are months without data?
I would like to have months in words as the xticks for a whole year, however my data varies in how complete it is i.e. some years have 7/12 months etc.
%matplotlib inline
import matplotlib.pyplot as plt
df['month'] = df.index.month
fig, axes = plt.subplots(3,3, figsize=(15,15)) # create figure and axes
data = df.loc[:, ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']]
varlist = ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']
y_labels = ['Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','mbar','celsius','%']
#Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
df_12hourly = df[varlist].resample('12H').median()
for i,el in enumerate(list(df_12hourly.columns.values)[:-1]):
a = df_12hourly.boxplot(el, by="month", showfliers=False, ax=axes.flatten()[i])
#a.set_xticklabels(df.month, rotation=45 )
#a.xaxis.set_major_formatter(mdates.DateFormatter("%b"))
a.set_ylabel(y_labels[i])
a.set_xlim(0,13)
fig.suptitle(str(year), fontsize=16)
python-3.x
add a comment |
How do I change the xticks on a set boxplot subplots such that name appears i.e. 'March' instead of 3.0 and the full year is included even if there are months without data?
I would like to have months in words as the xticks for a whole year, however my data varies in how complete it is i.e. some years have 7/12 months etc.
%matplotlib inline
import matplotlib.pyplot as plt
df['month'] = df.index.month
fig, axes = plt.subplots(3,3, figsize=(15,15)) # create figure and axes
data = df.loc[:, ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']]
varlist = ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']
y_labels = ['Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','mbar','celsius','%']
#Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
df_12hourly = df[varlist].resample('12H').median()
for i,el in enumerate(list(df_12hourly.columns.values)[:-1]):
a = df_12hourly.boxplot(el, by="month", showfliers=False, ax=axes.flatten()[i])
#a.set_xticklabels(df.month, rotation=45 )
#a.xaxis.set_major_formatter(mdates.DateFormatter("%b"))
a.set_ylabel(y_labels[i])
a.set_xlim(0,13)
fig.suptitle(str(year), fontsize=16)
python-3.x
Rather than integers 1..12 for thedf['month']
column, use datetime.datetime values: docs.python.org/3/library/datetime.html#datetime-objects
– J_H
Mar 26 at 19:26
I added Import calendar df['month'] = df['month'].apply(lambda x: calendar.month_abbr[x]) However, I just get the error message KeyError: 'month'
– Dominic
Mar 27 at 9:40
add a comment |
How do I change the xticks on a set boxplot subplots such that name appears i.e. 'March' instead of 3.0 and the full year is included even if there are months without data?
I would like to have months in words as the xticks for a whole year, however my data varies in how complete it is i.e. some years have 7/12 months etc.
%matplotlib inline
import matplotlib.pyplot as plt
df['month'] = df.index.month
fig, axes = plt.subplots(3,3, figsize=(15,15)) # create figure and axes
data = df.loc[:, ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']]
varlist = ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']
y_labels = ['Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','mbar','celsius','%']
#Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
df_12hourly = df[varlist].resample('12H').median()
for i,el in enumerate(list(df_12hourly.columns.values)[:-1]):
a = df_12hourly.boxplot(el, by="month", showfliers=False, ax=axes.flatten()[i])
#a.set_xticklabels(df.month, rotation=45 )
#a.xaxis.set_major_formatter(mdates.DateFormatter("%b"))
a.set_ylabel(y_labels[i])
a.set_xlim(0,13)
fig.suptitle(str(year), fontsize=16)
python-3.x
How do I change the xticks on a set boxplot subplots such that name appears i.e. 'March' instead of 3.0 and the full year is included even if there are months without data?
I would like to have months in words as the xticks for a whole year, however my data varies in how complete it is i.e. some years have 7/12 months etc.
%matplotlib inline
import matplotlib.pyplot as plt
df['month'] = df.index.month
fig, axes = plt.subplots(3,3, figsize=(15,15)) # create figure and axes
data = df.loc[:, ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']]
varlist = ['scat450', 'scat550', 'scat700','bscat450','bscat550','bscat700', 'p_int', 'T_int', 'RH_int','month']
y_labels = ['Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','Mm-1','mbar','celsius','%']
#Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
df_12hourly = df[varlist].resample('12H').median()
for i,el in enumerate(list(df_12hourly.columns.values)[:-1]):
a = df_12hourly.boxplot(el, by="month", showfliers=False, ax=axes.flatten()[i])
#a.set_xticklabels(df.month, rotation=45 )
#a.xaxis.set_major_formatter(mdates.DateFormatter("%b"))
a.set_ylabel(y_labels[i])
a.set_xlim(0,13)
fig.suptitle(str(year), fontsize=16)
python-3.x
python-3.x
asked Mar 26 at 16:53
DominicDominic
136 bronze badges
136 bronze badges
Rather than integers 1..12 for thedf['month']
column, use datetime.datetime values: docs.python.org/3/library/datetime.html#datetime-objects
– J_H
Mar 26 at 19:26
I added Import calendar df['month'] = df['month'].apply(lambda x: calendar.month_abbr[x]) However, I just get the error message KeyError: 'month'
– Dominic
Mar 27 at 9:40
add a comment |
Rather than integers 1..12 for thedf['month']
column, use datetime.datetime values: docs.python.org/3/library/datetime.html#datetime-objects
– J_H
Mar 26 at 19:26
I added Import calendar df['month'] = df['month'].apply(lambda x: calendar.month_abbr[x]) However, I just get the error message KeyError: 'month'
– Dominic
Mar 27 at 9:40
Rather than integers 1..12 for the
df['month']
column, use datetime.datetime values: docs.python.org/3/library/datetime.html#datetime-objects– J_H
Mar 26 at 19:26
Rather than integers 1..12 for the
df['month']
column, use datetime.datetime values: docs.python.org/3/library/datetime.html#datetime-objects– J_H
Mar 26 at 19:26
I added Import calendar df['month'] = df['month'].apply(lambda x: calendar.month_abbr[x]) However, I just get the error message KeyError: 'month'
– Dominic
Mar 27 at 9:40
I added Import calendar df['month'] = df['month'].apply(lambda x: calendar.month_abbr[x]) However, I just get the error message KeyError: 'month'
– Dominic
Mar 27 at 9:40
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%2f55362430%2fhow-do-i-change-the-xticks-on-a-set-boxplot-subplots-such-that-it-is-in-words-an%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
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
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%2f55362430%2fhow-do-i-change-the-xticks-on-a-set-boxplot-subplots-such-that-it-is-in-words-an%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
Rather than integers 1..12 for the
df['month']
column, use datetime.datetime values: docs.python.org/3/library/datetime.html#datetime-objects– J_H
Mar 26 at 19:26
I added Import calendar df['month'] = df['month'].apply(lambda x: calendar.month_abbr[x]) However, I just get the error message KeyError: 'month'
– Dominic
Mar 27 at 9:40