If you are stuck on an older version of matplotlib, you can still achieve the result by overlaying a scatterplot on the line plot. labelpadfloat, default: rcParams 'axes. This last example using the markevery kwarg is possible in since 1.4+, due to the merge of this feature branch. (xlabel, fontdictNone, labelpadNone,, locNone, kwargs) source. Plt.plot(xs, ys, '-gD', markevery=markers_on, label='line with select markers') where the y-label is set under the covers of the module and you want to rotate it. of the y-label, the following can be used: ax. (rotation'horizontal', ha'right') This is especially useful if the graph is plotted using an external module such as librosa, perfplot etc. Here is a list of the possible line and marker styles: =Įdit: with an example of marking an arbitrary subset of points, as requested in the comments: import numpy as np So for example, to change rotation, horizontal alignment etc. The first way is to use the ax.set () function, which uses the following syntax: ax.set(xlabel'x-axis label', ylabel'y-axis label') The second way is to use matplotlib functions, which use the following syntax: plt.xlabel('x-axis label') plt. Specify the keyword args linestyle and/or marker in your call to plot.įor example, using a dashed line and blue circle markers: plt.plot(range(10), linestyle='-', marker='o', color='b', label='line with marker')Ī shortcut call for the same thing: plt.plot(range(10), '-bo', label='line with marker') There are two ways to change the axis labels on a seaborn plot.
0 Comments
Leave a Reply. |