legend-properties

Get ggplot2 legend to display percentage sign in r

孤者浪人 提交于 2021-02-18 09:10:28
问题 Below is a reproducible example of the issue I am trying to solve. I have created a heatmap of sorts in ggplot2 and things have been going well. Since I have put percentage signs on the data to use with geom_text I would like to make the legend of geom_tile also to display percent signs (I can only multiply the actual values by 100 right now). Ideally I would like the legend bar on the right to show 8%, 4%, 0%, -4%, -8%. #load in libraries require(plyr) require(dplyr) require(reshape2)

Get ggplot2 legend to display percentage sign in r

青春壹個敷衍的年華 提交于 2021-02-18 09:09:13
问题 Below is a reproducible example of the issue I am trying to solve. I have created a heatmap of sorts in ggplot2 and things have been going well. Since I have put percentage signs on the data to use with geom_text I would like to make the legend of geom_tile also to display percent signs (I can only multiply the actual values by 100 right now). Ideally I would like the legend bar on the right to show 8%, 4%, 0%, -4%, -8%. #load in libraries require(plyr) require(dplyr) require(reshape2)

R - highcharter - selective legends at display

女生的网名这么多〃 提交于 2021-01-28 07:02:30
问题 I am not sure whether this could be done in highcharter, however, I have a scenario where I have 7 series plotted of which by default I need to display only 3, however remaining 4 should be greyed out but be present, user can click and select if needed. So, how can we do that? All suggestions are welcome. I did some research, however i was not able to get any leads. Thanks! hc <- highchart(type = "stock") %>% hc_title(text = paste0("<span style=\"color:#000000\">", prod_line, ", ", sku , " at

Plotly: How to customize legend order?

一世执手 提交于 2020-08-06 04:45:33
问题 I made scatter_geo plot in Python within plotly. import plotly.express as px import pandas as pd rows=[['501-600','65','122.58333','45.36667'], ['till 500','54','12.5','27.5'], ['more 1001','51','-115.53333','38.08'], ['601-1000','54','120.54167','21.98'], ] colmns=['bins','data','longitude','latitude'] df=pd.DataFrame(data=rows, columns=colmns) fig=px.scatter_geo(df,lon='longitude', lat='latitude',color='bins', opacity=0.5, projection="natural earth") fig.show() Are there any possibility to

Google Bar Chart - custom Legend text with total values & column wise total for Table chart

橙三吉。 提交于 2020-07-22 05:35:09
问题 i would like get the total value of Grades in Stacked Bar Graph Legend. picture attached how i wud like to have... for the following working snippet. and also the Column wise Total for the Table Chart... i think this can be done with following but how to get it done.. data.setFormattedValue(i, 0, key + ' (' + val + ')'); can have something like this.. when mouseover one location on Bar... need to show all the grades values in single annotation..?? is it possible to have the different values

generateLegend() Chart.JS V2

↘锁芯ラ 提交于 2020-05-15 08:09:13
问题 I´m trying to customize my legend I´m using the .generateLegend() to get the legend in a html way this is what the function gave me console.log(myBarChart.generateLegend()); <ul class="1-legend"><li><span style="background-color:#006666"></span>SECRETARIA MUNICIPAL DE DESENVOLVIMENTO URBANO </li> <li><span style="background-color:#339966"></span>SECRETARIA MUNICIPAL DE SAUDE</li> <li><span style="background-color:#3366ff"></span>SETOR DE RH</li> <li><span style="background-color:#66ccff"><

generateLegend() Chart.JS V2

梦想的初衷 提交于 2020-05-15 08:09:13
问题 I´m trying to customize my legend I´m using the .generateLegend() to get the legend in a html way this is what the function gave me console.log(myBarChart.generateLegend()); <ul class="1-legend"><li><span style="background-color:#006666"></span>SECRETARIA MUNICIPAL DE DESENVOLVIMENTO URBANO </li> <li><span style="background-color:#339966"></span>SECRETARIA MUNICIPAL DE SAUDE</li> <li><span style="background-color:#3366ff"></span>SETOR DE RH</li> <li><span style="background-color:#66ccff"><

Matplotlib scatter plot different colors in legend and plot

ε祈祈猫儿з 提交于 2020-01-30 02:48:29
问题 I have a scatter plot of multiple y-values for the same x-value, in matplotlib (python 2.7). There are different colors for all the plotted y-values. See the plot below. Now, here is the code: import numpy as np import pandas as pd import matplotlib.pyplot as plt import pylab as pl import matplotlib.cm as cm # Generate test x, y and y_error values: df2a = pd.DataFrame(np.random.rand(10,5), columns = list('ABCDE')) df2a.insert(0,'x_var_plot',range(1,df2a.shape[0]+1)) df2a_err = pd.DataFrame(np