axes

Why is my Spark streaming app so slow?

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a cluster with 4 nodes: 3 Spark nodes and 1 Solr node. My CPU is 8 core, my memory is 32 GB, disc space is SSD. I use cassandra as my database. My data amount is 22GB after 6 hours and I now have around 3,4 Million rows, which should be read in under 5 minutes. But already it can't complete the task in this amount of time. My future plan is to read 100 Million rows in under 5 minutes . I am not sure what I can increase or do better to achieve this result now as well as to achieve my future goal. Is that even possible or would it be

Matlab: How to align the axes of subplots when one of them contains a colorbar?

假装没事ソ 提交于 2019-12-03 08:20:00
问题 Minimal example: [x,y,z] = peaks(50); figure; subplot(5,1,1:4); pcolor(x,y,z); shading flat; colorbar; subplot(5,1,5); plot(x(end/2,:), z(end/2,:)); In this example I'd like to have the lower subplot show the cross-section of peaks along y=0 and the plot ending at the same position as the pcolor subplot, so that the x ticks are on identical positions. In fact, I don't need the duplicate x axis then. So, How to rescale the lower subplot such that the right limit matches the right limit of the

How do I make the width of the title box span the entire plot?

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: consider the following pandas series s and plot import pandas as pd import numpy as np s = pd.Series(np.random.lognormal(.001, .01, 100)) ax = s.cumprod().plot() ax.set_title('My Log Normal Example', position=(.5, 1.02), backgroundcolor='black', color='white') How do I get the box that contains the title to span the entire plot? 回答1: It is of course possible to get the bounding box of the title, which is a Text element. This can be done with title = ax.set_title(...) bb = title.get_bbox_patch() In principle, one can then manipulate the

How can I programmatically select a specific subplot in Matplotlib?

偶尔善良 提交于 2019-12-03 05:59:54
So in a figure where three vertical subplots have been added with add_subplot , how can I select let's say the middle one? Right now I do this list comprehension: [r[0] for r in sorted([[ax, ax.get_geometry()[2]] for ax in self.figure.get_axes()], key=itemgetter(1))] where I can simply select the index I want, with the corresponding axes . Is there a more straightforward way of doing this? Yann From the matplotlib documentation : If the figure already has a subplot with key (args, kwargs) then it will simply make that subplot current and return it. Here's an example: import matplotlib.pyplot

Python matplotlib -> 3D bar plot -> adjusting tick label position, transparent bars

你。 提交于 2019-12-03 03:37:40
I am trying to create a 3D bar histogram in Python using bar3d() in Matplotlib. I have got to the point where I can display my histogram on the screen after passing it some data, but I am stuck on the following: Displaying axes labels correctly (currently misses out final (or initial?) tick labels) Either making the ticks on each axis (e.g. that for 'Mon') either point to it's corresponding blue bar, or position the tick label for between the major tick marks. Making the bars semi-transparent. image of plot uploaded here I have tried passing several different arguments to the 'ax' instance,

python pandas plot with uneven timeseries index (with count evenly distributed)

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My dataframe has uneven time index. how could I find a way to plot the data, and local the index automatically? I searched here, and I know I can plot something like e.plot() but the time index (x axis) will be even interval, for example per 5 minutes. if I have to 100 data in first 5 minutes and 6 data for the second 5 minutes, how do I plot with number of data evenly. and locate the right timestamp on x axis. here's even count, but I don't know how to add time index. plot(e['Bid'].values) example of data format as requested Time,Bid 2014

Axes from plt.subplots() is a “numpy.ndarray” object and has no attribute “plot”

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The information below may be superfluous if you are trying to understand the error message. Please start off by reading the answer by @user707650 Using MatPlotLib, I wanted a generalizable script that creates the following from my data. A window containing a subplots arranged so that there are b subplots per column. I want to be able to change the values of a and b . If I have data for 2a subplots, I want 2 windows, each with the previously described " a subplots arranged according to b subplots per column". The x and y data I am plotting

Different right and left axes in a MATLAB plot?

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I plot a single trace in MATLAB with plot() . I'd like to add a right-y axis with a different set of tick marks (scaled linearly). Is this possible? 回答1: There are a number of good suggestions on this closely related question , although they deal with a more complicated situation than yours. If you want a super-simple DIY solution, you can try this: plot ( rand ( 1 , 10 )); % Plot some random data ylabel ( gca , 'scale 1' ); % Add a label to the left y axis set ( gca , 'Box' , 'off' ); % Turn off the box surrounding the whole axes

How to use `GridSpec()` with `subplots()`

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There are several ( example ) SO posts dealing with how to use GridSpec with subplotting in general. What i am trying to achieve to no avail, is to allow the use of GridSpec with subplots , something like this, Where i can replace the actual Array and list indexes with some loop controlled index : gs = gridspec.GridSpec(4, 1, height_ratios=[2, 2, 1, 1]) tPlot, axes = plt.subplots(4, sharex=True, sharey=False) tPlot.suptitle(node, fontsize=20) axes[0].plot(targetDay[0], gs[0]) axes[1].plot(targetDay[1], gs[1]) axes[2].scatter(targetDay[2], gs

Python/Matplotlib - How to put text in the corner of equal aspect figure

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to put text in the right bottom corner of equal aspect figure. I set the position relative to the figure by ax.transAxes, but I have to define the relative coordinate value manually depending on height scales of each figures. What would be a good way to know axes height scale and the correct text position within the script? ax = plt.subplot(2,1,1) ax.plot([1,2,3],[1,2,3]) ax.set_aspect('equal') ax.text(1,-0.15, 'text', transform=ax.transAxes, ha='right', fontsize=16) print ax.get_position().height ax = plt.subplot(2,1,2) ax.plot