axis-labels

Modifying ggplot2 Y axis to use integers without enforcing an upper limit [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-10 20:43:21
问题 This question already has answers here : How to display only integer values on an axis using ggplot2 (7 answers) Closed 5 years ago . I am trying to modify the axes in ggplot2 so that it is one decimal point and has a label for every integer. However, I want to do it without an upper limit so that it will automatically adjust to data of different counts. The difference between my question and the question posed here (that I was flagged as being a duplicate of) is that I need to make this work

Pandas to MatPlotLib with Dollar Signs

微笑、不失礼 提交于 2019-12-10 18:26:44
问题 Given the following data frame: import pandas as pd df=pd.DataFrame({'A':['$0-$20','$20+']}) df A 0 0−20 1 $20+ I'd like to create a bar chart in MatPlotLib but I can't seem to get the dollar signs to show up correctly. Here's what I have: import matplotlib.pyplot as plt import numpy as np y=df.B x=df.A ind=np.arange(len(x)) fig, ax = plt.subplots(1, 1, figsize = (2,2)) plt.bar(ind, y, align='center', width=.5, edgecolor='none', color='grey') ax.patch.set_facecolor('none') ax.patch.set_alpha

Create style to rotate axis label in code behind

烈酒焚心 提交于 2019-12-10 15:59:59
问题 I need to create a style that rotates the x axis labels. I've found this examples: Easily rotate the axis labels of a Silverlight/WPF Toolkit chart and Rotating Text and How to change AxisLabelStyle in code behind? I need to do this in the code behind. So I've tried this: var labelStyle = new Style(typeof(AxisLabel)); var rotate = new Setter(RotateTransform.AngleProperty, 270); var setter = new Setter(AxisLabel.RenderTransformProperty, rotate); labelStyle.Setters.Add(setter); (xSerie

ASP.NET Chart control set month names from int value on X Axis labels

落爺英雄遲暮 提交于 2019-12-10 10:12:24
问题 I want to replace numbers (1, 2, 3, ...) on the X Axis of the chart with the corresponding month name. This is my actual chart: On the DataView that populates the Series I have the "MONTH" column that contains values from 1 to 12. I also had to manually set the Minimum and Maximum value to 0 and 13, otherwise I lose the first and last column because of a lack of space between the beginning of the first X Axis column and the Y Axis and between the last X Axis column end of Chart area.

Change font-size of domain axis label and range axis label for jfreechart

不羁的心 提交于 2019-12-10 01:27:02
问题 My goal is to increase the size of "Revenue ($) " and "Years" . But I do not know how. I am able to increase the "Apples, Durians,Oranges" and "2012, 2013". Below are my codes. JFreeChart chart = ChartFactory.createBarChart3D("", // chart title "Years", // domain axis label "Revenue ($)", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend false, // tooltips false); CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis axis = plot

How to set scientific notation on axis in matplotlib

那年仲夏 提交于 2019-12-10 00:28:56
问题 I am trying to plot a graph with two separate x-axis. One being some valve openning and the other the corresponding leak rate. I managed to make it work pretty well, though the format of that secondary axis doesn't always show scientific notations as seen on the figure down bellow Awful overlapping labels, see the upper axis How to force scientific notation display so that the labels wont overlap? Here is the script I am using: #HEADERS import numpy as np import matplotlib.pyplot as plt

Custom ggplot2 axis and label formatting

你。 提交于 2019-12-09 14:59:56
问题 I'm trying to draw labels which look informative, clear and tidy. I was following example and raised one more question about label and axis formatting. For example, I have sales data which includes Brand, Categories and Expenditure in EUR. When sum of EUR is big (millions or more) labels look really hard to read and not informative. As a result, x-axis is in Scientific notation and also looks really uncleanly. I've manage to format labels in custom way: it shows Eur in thousands. geom_text

Legend in multiple plot in R

吃可爱长大的小学妹 提交于 2019-12-08 11:12:55
问题 According to the comments from others, this post has been separated into several smaller questions from the previous version of this OP. In the graph below, will you help me to (Newbie to R) Custom legends according to the data they represent like filled for variable 1, circle points for variable 2 and line for variable 3 and their colors. same letter size for the legend and axis-names. The graph below is produced with the data in pdf device with following layout. m <- matrix(c(1,2,3,3,4,5)

Share x axis between matplotlib and seaborn

不打扰是莪最后的温柔 提交于 2019-12-08 09:39:03
问题 I have data in pandas DataFrame : import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns np.random.seed(786) df = pd.DataFrame({'a':np.arange(0, 1, 0.05), 'b':np.random.rand(20) - .5}) print (df) a b 0 0.00 0.256682 1 0.05 -0.192555 2 0.10 0.393919 3 0.15 -0.113310 4 0.20 0.373855 5 0.25 -0.423764 6 0.30 -0.123428 7 0.35 -0.173446 8 0.40 0.440818 9 0.45 -0.016878 10 0.50 0.055467 11 0.55 -0.165294 12 0.60 -0.216684 13 0.65 0.011099 14 0.70 0.059425 15 0

biwavelet package: “axis” is not working

孤街醉人 提交于 2019-12-08 05:42:21
问题 I am using biwavelet package to conduct wavelet coherence analysis. When I want to set my own x ticklabel, I find axis is not working. The following gives a reproducible example. Thanks. require(biwavelet) t1 <- cbind(1:100, rnorm(100)) t2 <- cbind(1:100, rnorm(100)) wtc.t1t2 <- wtc(t1,t2,nrands = 10) plot(wtc.t1t2, plot.cb = TRUE, plot.phase = TRUE,xaxt='n') axis(1,at = seq(10,100,10),labels = seq(1,10,1)) 回答1: The thing that was breaking your plot was plot.cb = TRUE . In the source code for