mplot3d

Plot 3D Contour from an Image using extent with Matplotlib

断了今生、忘了曾经 提交于 2019-12-02 18:04:56
问题 As I present here (in 2D), I'm wondering if how I could "scale" an image input to be plotted to a range in the plot. To be more clear, this is what I need: I have a 400 * 400 image that is generated based on a function which interval is -1..1. So, I do a translate to save this data, like this: x = Utils.translate(pos_x, 0, self.width, -1, 1) y = Utils.translate(pos_y, 0, self.height, -1, 1) data = Utils.map_position_to_function(x, y) I.e, first I map its position to my range and then I

Changing the position of the grid walls in an mplot3d figure

断了今生、忘了曾经 提交于 2019-12-02 16:08:19
问题 When making a figure using the mplot3d package, three gray walls are automatically created and the axis ticks and grid lines are placed along these walls, as shown in this mplot3d example which I will be referring to later. These walls are positioned such that they are placed slightly outside the given axis limits. For instance, as you can see in the figure of the referred example, the vertical grid walls stretch from slightly below 0 to slightly above 1. A negative side effect of this is

Plot 3D Contour from an Image using extent with Matplotlib

冷暖自知 提交于 2019-12-02 11:29:18
As I present here (in 2D), I'm wondering if how I could "scale" an image input to be plotted to a range in the plot. To be more clear, this is what I need: I have a 400 * 400 image that is generated based on a function which interval is -1..1. So, I do a translate to save this data, like this: x = Utils.translate(pos_x, 0, self.width, -1, 1) y = Utils.translate(pos_y, 0, self.height, -1, 1) data = Utils.map_position_to_function(x, y) I.e, first I map its position to my range and then I calculate de f(x, y) based on this "new position" and save the data. Also, as I save this image, I do a

Changing the position of the grid walls in an mplot3d figure

只愿长相守 提交于 2019-12-02 08:14:47
When making a figure using the mplot3d package, three gray walls are automatically created and the axis ticks and grid lines are placed along these walls, as shown in this mplot3d example which I will be referring to later . These walls are positioned such that they are placed slightly outside the given axis limits. For instance, as you can see in the figure of the referred example, the vertical grid walls stretch from slightly below 0 to slightly above 1. A negative side effect of this is that the bottom wall (the floor of the plot, if you will), is placed at a z coordinate slightly below 0.

Matplotlib 3D workaround for plot order

天涯浪子 提交于 2019-12-02 02:26:16
问题 I know that matplotlib 3D is not reliable for plotting multiple 3D objects (planes, lines, points) in the right order: please see Matplotlib 3D plot zorder issue and How to draw intersecting planes?. However these questions seem quite old, so the proposed solutions. Thus, I would like to know if there are some new developments, tools, workarounds or hard-coded solutions for the following specific simple scenario: import mpl_toolkits.mplot3d as a3 import matplotlib.pylab as plt import numpy as

Matplotlib 3D workaround for plot order

情到浓时终转凉″ 提交于 2019-12-02 00:47:39
I know that matplotlib 3D is not reliable for plotting multiple 3D objects (planes, lines, points) in the right order: please see Matplotlib 3D plot zorder issue and How to draw intersecting planes? . However these questions seem quite old, so the proposed solutions. Thus, I would like to know if there are some new developments, tools, workarounds or hard-coded solutions for the following specific simple scenario: import mpl_toolkits.mplot3d as a3 import matplotlib.pylab as plt import numpy as np fig = plt.figure() ax = a3.Axes3D(fig) # create an orizontal plane corners = [[0,0,0],[0,5,0],[5,5

Setting tick colors of matplotlib 3D plot

ぐ巨炮叔叔 提交于 2019-12-01 19:41:43
If I have a 3D matplotlib plot ( Axes3D object), how do I change the color of the tick marks? I figured out how to change the color of the axis line, the tick labels, and the axis label. The obvious solution, use ax.tick_params(axis='x', colors='red') , only changes the tick labels not the tick marks themselves. Here is code that tries to change all the axes to red and gets everything but the tick marks: from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as plt fig = plt.figure() ax = Axes3D(fig) ax.scatter((0, 0, 1), (0, 1, 0), (1, 0, 0)) ax.w_xaxis.line.set_color('red') ax

Colorbar for matplotlib plot_surface using facecolors

雨燕双飞 提交于 2019-12-01 11:29:30
I'm trying to plot in 3D colouring the surface with predefined colours using facecolors . The problem here is that cm.ScalarMappable normalizes surface V of colours while plt.cm.jet don't normalizes, so there is a mismatch of colours and colorbar. I've manually tried to normalize V (i.e. V_normalized ) but the result is still not quite correct. In fact, the highest value of V should be in a corner of the surface, but this is not reflected in the image in practice. How to plot ensuring to have the corrects colours on the surface? import numpy as np import pandas as pd import matplotlib.pyplot

Matplotlib bar3d variable alpha

泪湿孤枕 提交于 2019-12-01 10:31:16
问题 I'm using matplotlib bar3d with RdBu colormap and wanted to have variable transparency between bars (so smaller bars can be more transparent than taller bars). Here is the code for making the 3d bar plot. The data is stored in a 4x4 matrix 'rho'. At the moment alpha is kept at 0.95, but it would be excellent to be able to control the value of alpha for each bar. Cheers xpos = np.arange(0,4,1) ypos = np.arange(0,4,1) xpos, ypos = np.meshgrid(xpos, ypos) xpos = xpos.flatten() ypos = ypos

mplot3D fill_between extends over axis limits

我只是一个虾纸丫 提交于 2019-12-01 06:45:54
问题 I have questions related to creating a simple lineplot in Python with mplot3D where the area under the plot is filled. I am using Python 2.7.5 on RedHatEnterprise 7.2, matplotlib 1.2.0 and numpy 1.7.2. Using the code below, I am able to generate a line plot. This is displayed as expected with the beginning / end of the plot set by the limits of the imported data set. I am then trying to fill the area between the line plot and -0.1 using the answer given by Bart from Plotting a series of 2D