axis

How to remove frame from matplotlib (pyplot.figure vs matplotlib.figure ) (frameon=False Problematic in matplotlib)

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: To remove frame in figure, I write frameon = False works perfect with pyplot.figure , but with matplotlib.Figure it only removes the gray background, the frame stays . Also, I only want the lines to show, and all the rest of figure be transparent. with pyplot I can do what I want, I want to do it with matplotlib for some long reason I 'd rather not mention to extend my question. 回答1: First off, if you're using savefig , be aware that it will override the figure's background color when saving unless you specify otherwise (e.g. fig

Changing axis type in ZedGraph

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a data of time of consecutive heart beats (in milliseconds) and I'm trying to make a dynamic chart of them. So on XAxis I have XDate variable increased by .AddMilliseconds(heart_beat_time) and on YAxis heart_beat_time . When I use AxisType.Date it's pretty good. I can change Min , Max and other related values, but when I change to AxisType.DateAsOrdinal I can not see points nor labels. During some debugging it has showed up that Zedgraph does paint the points and labels, but there are very large gaps between consecutive ones

matplotlib axis label format

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am having an issue with the format of the tick labels of an axis. I disabled the offset from the y_axis: ax1 . ticklabel_format ( style = 'sci' , useOffset = False ) and tried to put it a scientific format but all I get is: 0.00355872 but I expected something like: 3.55872 ... E - 2 or similar. what I really want is something like: 3.55872 ... ( on the tick label ) x 10 ^ 2 ( or something similar - on the axis label ) I could try to set the labels as static,, but in the end I will have a few tens or hundreds of plots with

Adding minor tick marks to the x axis in ggplot2 (with no labels)

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Below is example code of a plot that does almost exactly what I want. The only thing I want to add is tick marks on the x axis (same size as the major ticks) according to the minor_breaks defined below. df Thanks in advance, --JT 回答1: This would do it in the precise instance: scale_x_continuous(breaks= seq(1900,2000,by=10), labels = c(1900, rep("",4), 1950, rep("",4), 2000), limits = c(1900,2000), expand = c(0,0)) + Here's a function that is not bullet-proof but works to insert blank labels when the beginning and ending major labels are

uneven spacing on axis with R

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem in plotting uneven scale plot on x axis with R Here is an example: plot(1:100,1:100) will give the equal tick space on x axis. However, I want to show the graph with first half of space showing 1 to 10, and the left half space showing 10 to 100, so the points in the 10 to 100 more dense, and points in 1:10 are easier to see. How to do it with R? Like this: 回答1: This is not an easy one-off task to complete. You'll actually need to transform to the scaled data and supply custom tick marked axes. Any reason you haven't

Data column(s) for axis #0 cannot be of type string error in google chart

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to populate google chart datatable in server side using PHP.I got JSON file properply, but the Chart not display in client Application. I got error- Data column(s) for axis #0 cannot be of type string . My coding is below here. After fetching data from database, $colarray=array(array("id"=>"","label"=>"userid","pattern"=>"","type"=>"number"),array("id"=>"","label"=>"name","pattern"=>"","type"=>"string")); $final=array(); for($i=0;$i<$rows;$i++) { $id[$i]=pg_fetch_result($res1,$i,'id'); $name[$i]=pg_fetch_result($res1,$i,'name');

Aplpy multiplot dynamic axis sharing

匿名 (未验证) 提交于 2019-12-03 02:22:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any way to make multiplot aplpy plots dynamically share axes so that when one is moved or zoomed, it moves and zooms the others? I can achieve the affect using matplotlib pyplot's imshow and subplot routines, but using those limits some other important aspects of my plotting, while aplpy provides all the tools I need for my images. I have tried using the matplotlib cid commands and a function to recenter all the images based on click locations, but I can only zoom in, or out, not both, and I cant click and drag yet. My MWE of my

Duplicating (and modifying) discrete axis in ggplot2

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to duplicate the left-side Y-axis on a ggplot2 plot onto the right side, and then change the tick labels for a discrete (categorical) axis. I've read the answer to this question , however as can be seen on the package's repo page , the switch_axis_position() function has been removed from the cowplot package (the author cited (forthcoming?) native functionality in ggplot2). I've seen the reference page on secondary axes in ggplot2, however all the examples in that document use scale_y_continuous rather than scale_y_discrete . And,

pandas day of week axis labels

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am plotting a pandas series that spans one week. My code: rng = pd.date_range('1/6/2014',periods=169,freq='H') graph = pd.Series(shared_index, index=rng[:168]) graph.plot(shared_index) Which displays 7 x-axis labels: [06 Jan 2014, 07, 08, 09, 10, 11, 12] But I want: [Mon, Tue, Wed, Thu, Fri, Sat, Sun] What do I specify in code to change axis labels? Thanks! 回答1: perhaps you can manually fix the tick labels: rng = pd.date_range('1/6/2014',periods=169,freq='H') graph = pd.Series(np.random.randn(168), index=rng[:168]) ax = graph.plot()

Matplotlib table only

匿名 (未验证) 提交于 2019-12-03 02:15:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to draw only a table with matplotlib? If I uncomment the line plt.bar(index, data[row], bar_width, bottom=y_offset, color=colors[row]) of this example code , the plot is still visible. I want to have a table on top of my (PyQt) window and underneath a plot (with some space in between). Any help is very appreciated! 回答1: If you just wanted to change the example and put the table at the top, then loc='top' in the table declaration is what you need, the_table = ax.table(cellText=cell_text, rowLabels=rows, rowColours=colors,