我在这个主题上发现了几个类似的帖子。但它们对我没有帮助。
我对Python和Seaborn来说相对较新。
这是我的代码:
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
x_axis = ["A", "B","C","D","E","F"]
y_axis = [78.5, 79.6, 81.6, 75.4, 78.3, 79.6]
plt.ylabel('Accuracy')
plt.title('Accuracy of Classifier')
g=sns.barplot(x_axis, y_axis, color="red")
我只是想在每个条形图的顶部显示y_axis的值。
答案 0 :(得分:6)
循环修补补丁并注释条形图。
try {
HttpPost httpost = new HttpPost(googleTokenUrl);
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("code", code));
nvps.add(new BasicNameValuePair("grant_type", "authorization_code"));
nvps.add(new BasicNameValuePair("client_id", googleClientId));
nvps.add(new BasicNameValuePair("client_secret", googleClientSecret));
nvps.add(new BasicNameValuePair("redirect_uri", webUrl + googleRedirectUri));
httpost.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));
CloseableHttpResponse closeableresponse = httpclient.execute(httpost);
logger.debug("Response Status line :" + closeableresponse.getStatusLine());
try {
HttpEntity entity = closeableresponse.getEntity();
InputStream rstream = entity.getContent();
JSONObject authResponse = new JSONObject(new JSONTokener(rstream));
String access_token = authResponse.getString("access_token");
} catch (JSONException e) {
logger.error(" Exception occured : " + e.getMessage());
throw e;
} finally {
closeableresponse.close();
}
} catch (IOException ex) {
logger.error(" Exception occured : " + ex.getMessage());
return null;
} finally {
try {
httpclient.close();
} catch (IOException e) {
logger.error(" Exception occured : " + e.getMessage());
}
}
}
输出: