How to change axis linewidth and fontsize in Octave
With octave 3.8.2 it is working fine. x=1:10; plot(x, x, “linewidth”, 5) set(gca, “linewidth”, 4, “fontsize”, 12) yields as it should
With octave 3.8.2 it is working fine. x=1:10; plot(x, x, “linewidth”, 5) set(gca, “linewidth”, 4, “fontsize”, 12) yields as it should
To get the marker to show beyond the axes you can turn the clipping off. This can be done using the keyword argument in the plot command clip_on=False. For example: import matplotlib.pyplot as plt plt.plot(range(5), range(5), ‘ro’, markersize=20, clip_on=False, zorder=100) plt.show()
If you want to remove the axis spines, but not the other information (ticks, labels, etc.), you can do that like so: fig, ax = plt.subplots(7,1, sharex=True) t = np.arange(0, 1, 0.01) for i, a in enumerate(ax): a.plot(t, np.sin((i + 1) * 2 * np.pi * t)) a.spines[“top”].set_visible(False) a.spines[“right”].set_visible(False) a.spines[“bottom”].set_visible(False) or, more easily, using seaborn: … Read more
You now need to use set_prop_cycle i.e. ax.set_prop_cycle(color=[‘red’, ‘green’, ‘blue’]) Axes.set_color_cycle(clist) was depreciated since, version 1.5. https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.axes.Axes.set_prop_cycle.html
The axes size is determined by the figure size and the figure spacings, which can be set using figure.subplots_adjust(). In reverse this means that you can set the axes size by setting the figure size taking into acount the figure spacings: import matplotlib.pyplot as plt def set_size(w,h, ax=None): “”” w, h: width, height in inches … Read more
You can have the axes handled automatically without you having to scale them yourself and keep auto-scaling: set terminal jpeg set output ‘graph.jpg’ set xrange [-10:10] set ytics 10 nomirror tc lt 1 set ylabel ‘2*x’ tc lt 1 set y2tics 20 nomirror tc lt 2 set y2label ‘4*x’ tc lt 2 plot 2*x linetype … Read more
Use FINDALL: allAxesInFigure = findall(figureHandle,’type’,’axes’); If you want to get all axes handles anywhere in Matlab, you could do the following: allAxes = findall(0,’type’,’axes’); EDIT To answer the second part of your question: You can test for whether a list of handles are axes by getting the handles type property: isAxes = strcmp(‘axes’,get(listOfHandles,’type’)); isAxes will … Read more
tf.transpose provides the same functionality as np.swapaxes, although in a more generalized form. In your case, you can do tf.transpose(orig_tensor, [1, 0, 2]) which would be equivalent to np.swapaxes(orig_np_array, 0, 1).