scatter

matplotlib axis tick labels covered by scatterplot (using spines)

假装没事ソ 提交于 2019-12-23 15:48:30
问题 I want to have my axis through the origin (0,0) in a scatter plot, which is why I have set the spines positions in the below example. The problem is that my actual data points on the scatter plot are covering up the axis tick labels so they cannot be seen. How can I get matplotlib to 'overwrite' the data points with my axis tick labels so that they can be seen? import numpy as np from matplotlib import pyplot as plt plt.style.use('ggplot') x = np.random.randn(5000) y = np.random.randn(5000) f

Correct way to (un)zip arrays in Julia

只愿长相守 提交于 2019-12-23 10:39:32
问题 I was using the PyPlot library in Julia for plotting, and the scatter function seems to have a "little" inconvenience, namely, that only accepts the coordinates as two arguments: one array for all x values, and another for all y values, i.e. scatter(xxs,yys) with x=[x1,x2,...] , and y=[y1,y2,...] . If I have a set or a tuple with points of coordinates, like, A=([x1,y1],[x2,y2],...) using pyplot/matplotlib directly in Python solves the inconvenience in one liner, as atested here in

R plotly version 4.5.2 scatterplot legend bubble size settings

南楼画角 提交于 2019-12-22 06:49:58
问题 I am using plotly 4.5.2 in R. I have created a scatterplot which is sized on a variable, the issue is these sizes are also reflected in the legend which makes them hard to read. I want my graph to remain the same, with the only exception being the size of the bubbles in the legend. These bubbles can either be set to all be the same size or scaled to a smaller size. Importantly, the sizes in the graph must remain the same. Please find reproducible code here: library(plotly) data <- data.frame

axis range in scatter graphs

别来无恙 提交于 2019-12-21 09:29:29
问题 I have been using the code below to plot the time spent to run 4 functions. The x axis represents the number of executions whereas the y axis represents the time spent running a function. I was wondering if you could help me accomplish the following: 1) set the limits of the x axis so that only positive values are shown (x represents the number of times each function was executed and is, therefore, always positive) 2) create a legend for the 4 functions Thank you, Mark import matplotlib from

Combining scatter plot with surface plot

家住魔仙堡 提交于 2019-12-20 12:16:10
问题 How can I combine a 3D scatter plot with a 3D surface plot while keeping the surface plot transparent so that I can still see all the points? 回答1: To combine various types of plots in the same graph you should use the function plt.hold(True). The following code plots a 3D scatter plot with a 3D surface plot: from mpl_toolkits.mplot3d import * import matplotlib.pyplot as plt import numpy as np from random import random, seed from matplotlib import cm fig = plt.figure() ax = fig.gca(projection=

MPI Matrix Multiplication with scatter gather

梦想与她 提交于 2019-12-20 05:59:36
问题 I'm trying to do matrix multiplication using MPI in C and we have to do a version that sequential and one parallel version. My parallel version is not giving the correct answers and I'm not sure why. I think I'm not sending the right communications to the processes but I can't be sure. The professor just went over the different send/receive/gather etc messages, but didn't really get into much detail... I've seen a lot of different examples but none complete and none using scatter/gather. If

Changing the colors of the specific dots in scatterplot vba excel

北慕城南 提交于 2019-12-19 10:25:10
问题 I would like to change the color of dots in top left part of the scatterplot. I wrote a macro, no errors occurred but the color did not change :/ Sub Kolorowanie() ActiveSheet.ChartObjects("Chart 1").Activate a = ActiveChart.SeriesCollection(1).Values b = ActiveChart.SeriesCollection(1).XValues For i = LBound(a) To UBound(a) If a(i) < 0 And b(i) > 0 Then ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.SeriesCollection(1).Select ActiveChart.SeriesCollection(1).Points(i).Select With

graphing multiple types of plots (line, scatter, bar etc) in the same window

本小妞迷上赌 提交于 2019-12-18 12:39:56
问题 I'm trying to graph two types of plots in the same window (i.e. a line plot, and a scatter plot). The data being plotted in the line graph (first plot) are floating numerical values representing climate indices (Y) vs. decimal years (X). The second plot that I would like to be a 'scatter'ed is much the same, but with floating numerical values representing stream flows (Y) vs. decimal years (X). I've tried to accomplish this as follows by using a twin x axis and a second, parasite y axis for

scatter plot data does not appear on continents in 'hammer' basemap

依然范特西╮ 提交于 2019-12-17 20:48:06
问题 I am attempting to plot a dataset over the 'hammer' basemap using a scatter plot. However, the data points won't plot on top of the continents. I noticed in the matplotlib example, there is also not data on the continents (I assumed this was due to the nature of the example). I'm wondering if I'm doing something wrong, or if data cannot be plotted on top of the continents using 'hammer' by design. If this is the case, is there an ideal basemap to use to plot scatter plot data over the whole

Matplotlib scatterplot; colour as a function of a third variable

女生的网名这么多〃 提交于 2019-12-16 20:01:27
问题 I want to make a scatterplot (using matplotlib) where the points are shaded according to a third variable. I've got very close with this: plt.scatter(w, M, c=p, marker='s') where w and M are the datapoints and p is the variable I want to shade with respect to. However I want to do it in greyscale rather than colour. Can anyone help? 回答1: There's no need to manually set the colors. Instead, specify a grayscale colormap... import numpy as np import matplotlib.pyplot as plt # Generate data... x