Remove xticks but keep xticklabels in MATLAB
Try modifying the TickLength property: set(gca, ‘Ticklength’, [0 0])
Try modifying the TickLength property: set(gca, ‘Ticklength’, [0 0])
You can create the legend handles using an empty plot with the color based on the colormap and normalization of the scatter plot. import pandas as pd import numpy as np; np.random.seed(1) import matplotlib.pyplot as plt x = [np.random.normal(5,2, size=20), np.random.normal(10,1, size=20), np.random.normal(5,1, size=20), np.random.normal(10,1, size=20)] y = [np.random.normal(5,1, size=20), np.random.normal(5,1, size=20), np.random.normal(10,2, size=20), np.random.normal(10,2, … Read more
To get the correct colors, use the Z values to pick values from the color map: my_col = cm.jet(Z/np.amax(Z)) The result: using otherwise the same code as @Moritz. from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(111, … Read more
In order to synchronize the rotation between two subplots in mplot3d you can connect the motion_notify_event to a function that reads the angles from rotated plot and applies it to the respective other plot. Here is an example from the gallery with the described functionality added. from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import … Read more
This should work. It re-centers the graph on the location of the pointer when you scroll. import matplotlib.pyplot as plt def zoom_factory(ax,base_scale = 2.): def zoom_fun(event): # get the current x and y limits cur_xlim = ax.get_xlim() cur_ylim = ax.get_ylim() cur_xrange = (cur_xlim[1] – cur_xlim[0])*.5 cur_yrange = (cur_ylim[1] – cur_ylim[0])*.5 xdata = event.xdata # get … Read more
I don’t know why zorder has that behavior and it’s likely that might be a bug or, at the very least, a badly documented feature. It might be because there are already automatic references to zorder when you build a plot (like grid, axis, and so on…) and when you try to specify the zorder … Read more