axis-labels

JFreeChart x axis Format

六眼飞鱼酱① 提交于 2019-12-13 05:02:32
问题 How to format x axis labels? I have a chart(look at attach1) I need to change x axis labels to the labels in the next attach (but with the same chart) 回答1: To set the label of the axis (in your example "counts") call XYPlot plot = (XYPlot) chart.getPlot(); plot.getDomainAxis().setLabel("counts"); To change the number format of the axis call XYPlot plot = (XYPlot) chart.getPlot(); ((NumberAxis)plot.getDomainAxis()).setNumberFormatOverride(new DecimalFormat("0")); To change the visible range of

Matplotlib/Pyplot shared axis for odd number of subplots

对着背影说爱祢 提交于 2019-12-13 04:31:46
问题 I am using the following code to produce an odd number of plots that I want 'butted' together and sharing axes. import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(4,2,1) ax1.set_yscale('log') ax1.set_xscale('log') plt.subplot(4,2,2, sharex=ax1, sharey=ax1) plt.subplot(4,2,3, sharex=ax1, sharey=ax1) plt.subplot(4,2,4, sharex=ax1, sharey=ax1) plt.subplot(4,2,5, sharex=ax1, sharey=ax1) plt.subplot(4,2,6, sharex=ax1, sharey=ax1) plt.subplot(4,2,7, sharex=ax1, sharey=ax1) plt

Manipulating x axis in panel plot when a factor is used

我们两清 提交于 2019-12-13 00:23:39
问题 The code I've used is: mcgc <- ggplot(sam, aes(x = person,y = m, colour = X)) + geom_point(size = 0.75) + scale_colour_gradient2(high="red", mid="green", limits=c(0,1), guide = "colourbar") + geom_hline(aes(yintercept = mad, linetype = "mad"), colour = "blue", size=0.75, show_guide = TRUE) + geom_hline(aes(yintercept = mmad, linetype = "mmad"), colour = "black", size=0.75, show_guide = TRUE) + facet_wrap(~ Plan, scales = "free", ncol = 4) + scale_linetype_manual(name = "Plan of Health Care",

Modify bin labels histogram

╄→гoц情女王★ 提交于 2019-12-12 19:18:22
问题 I made the following histogram: one <- c(2,2,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,7,8) hist(one, breaks = 3) Instead of a range from 2-8 on the x-axis, I need three labels on the x-axis that summarize the range of values like this: 2-3; 4-5; 6-8 How can I modify the code for the x-axis to get just three labels, and in the correct location? 回答1: It's easy to label midpoints for the ranges using: h <- hist(one, breaks = 3, xaxt = 'n') axis(1, h$mids, h$mids) But if you want to have the labels be

R { ggplot2 } Is it possible to query what the tick marks are for a plot?

喜欢而已 提交于 2019-12-12 12:17:11
问题 Using the example from Hadley's website: > (m <- qplot(rating, votes, data=subset(movies, votes > 1000), na.rm = T)) Which creates: My Question: Is it possible to determine what the ticks marks after creating the plot object? (I want to remove the first auto-generated breakpoint) Background: In the above plot, one can clearly see that the x-axis breaks are at 2 through 9. To obtain this manually, use: m + scale_x_continuous( breaks = c(2:9) ) But I would like to determine, from the figure,

Dygraph with R - How to use axisLabelFormatter for label's character size?

别来无恙 提交于 2019-12-12 12:05:39
问题 I am new to Dygraph in R, that I use to plot my data (with xts). Everything is OK, it works well. But the problem is: I'm not able to use axisLabelFormatter for making labels bold and bigger. How is that possible? Further, can I add a frame around the chart (like the black line of x and y axis)? The image here explain my 2 questions: click here for example image Below is the code I am trying: library(shiny) library(dygraphs) library(xts) #------Importation des données contenues dans un .csv--

Changing the xlim by date in Matplotlib

瘦欲@ 提交于 2019-12-12 10:37:27
问题 I am trying to make a visually appealing graph in Python. I was using Randal Olson's example http://www.randalolson.com/2014/06/28/how-to-make-beautiful-data-visualizations-in-python-with-matplotlib/ here and trying to make some adjustments. My data is simple, dispute_percentage Out[34]: 2015-08-11 0.017647 2015-08-12 0.004525 2015-08-13 0.006024 2015-08-14 0.000000 2015-08-15 0.000000 2015-08-17 0.000000 The problem is that the data starts loading at Feb 2015, and I want to start displaying

Pyplot move origin with axis

戏子无情 提交于 2019-12-12 05:17:08
问题 I have some code for a plot I want to create: import numpy as np import matplotlib.pyplot as plt # data X = np.linspace(-1, 3, num=50, endpoint=True) b = 2.0 Y = X + b # plot stuff fig = plt.figure(figsize=(8,6)) ax = fig.add_subplot(1, 1, 1) ax.set_title('linear neuron') # move axes ax.spines['left'].set_position(('axes', 0.30)) # ax.spines['left'].set_smart_bounds(True) ax.yaxis.set_ticks_position('left') ax.spines['bottom'].set_position(('axes', 0.30)) # ax.spines['bottom'].set_smart

python matplotlib 2.x axis autolimit

放肆的年华 提交于 2019-12-12 04:47:37
问题 I've got a problem with matplotlib 2.x code not reproducing 1.x behaviour, when it comes to choosing the auto-limits on the axes. According to https://matplotlib.org/users/dflt_style_changes.html , version 1.x axis rounding should be reproduced by the using the commands: mpl.rcParams['axes.autolimit_mode'] = 'round_numbers' mpl.rcParams['axes.xmargin'] = 0 mpl.rcParams['axes.ymargin'] = 0 But it doesn't. See the code below. My y values range from just above 5 to just below 50. When I run the

How to point each plot to correct y axis (many plots, two y axes, in R with ggplot2)

杀马特。学长 韩版系。学妹 提交于 2019-12-11 17:28:17
问题 So I have compared two groups with a third using a range of inputs. For each of the three groups I have a value and a confidence interval for a range of inputs. For the two comparisons I also have a p-value for that range of inputs. Now I would like to plot all five data series, but use a second axis for the p values. I am able to do that except for one thing: how do I make sure that R knows which of the plots to assign to the second axis? This is what it looks like now. The bottom two data