linestyle

Linestyle in matplotlib step function

房东的猫 提交于 2019-11-29 17:12:14
问题 Is it possible to set the linestyle in a matplotlib step function to dashed, dotted, etc.? I've tried: step(x, linestyle='--'), step(x, '--') But it did not help. 回答1: As of mpl 1.3.0 this is fixed upstream You have to come at it a bit sideways as step seems to ignore linestyle . If you look at what step is doing underneath, it is just a thin wrapper for plot. You can do what you want by talking to plot directly: import matplotlib.pyplot as plt plt.plot(range(5), range(5), linestyle='--',

how to set label and line the same color in gnuplot

假如想象 提交于 2019-11-29 10:14:45
Very simple stuff. I want a function, say function f, to be plotted with a particular color. I also want a piece of label saying "function f color" which is also displayed in that color. I am trying this so far: set style line 1 lw 3 lc 1 set label "AC" at 0, 70 textcolor 1 but apparently the "lc" and "textcolor" follows different specs, and it complains: "trolo4.pl", line 8: colorspec option not recognized any help would be great! Try this instead: set label "AC" at 0, 70 textcolor linetype 1 or set label "AC" at 0, 70 textcolor linespec 1 Read the manual in gnuplot> help label to learn more.

Custom plot linestyle in matplotlib

纵然是瞬间 提交于 2019-11-29 07:34:52
I'm trying to achieve graph using matplotlib with lines with whitespaces near points like in this one: (source: simplystatistics.org ) I know about set_dashes function, but it sets periodic dashes from start-point without control over end-point dash. EDIT: I made a workaround, but the resulting plot is just a bunch of usual lines, it is not a single object. Also it uses another library pandas and, strangely, works not exactly as I expected - I want equal offsets, but somehow they are clearly relative to the length. import numpy as np import matplotlib import matplotlib.pyplot as plt import

python matplotlib dash-dot-dot - how to?

与世无争的帅哥 提交于 2019-11-28 17:48:24
I am using python and matplotlib to generate graphical output. Is there a simple way to generate a dash-dot-dot line-style? I am aware of the '--' , '-.' , and ':' options. Unfortunately, '-..' does not result in a dash-dot-dot line. I have looked at the set_dashes command, but that seems to control the length of the dashes and the space between two adjacent dashes. One option may be to plot two lines on top of each other; one dashed with ample space between the dashes - and one dotted, with the dots as large as the dashes are wide and spaced so that two dots are in between each of the dashes.

Is there a list of line styles in matplotlib?

血红的双手。 提交于 2019-11-28 16:57:01
I'm writing a script that will do some plotting. I want it to plot several data series, each with its unique line style (not color). I can easily iterate through a list, but is there such a list already available in python? According to the doc you could find them by doing this : from matplotlib import lines lines.lineStyles.keys() >>> ['', ' ', 'None', '--', '-.', '-', ':'] You can do the same with markers EDIT: In the latest versions , there are still the same styles, but you can vary the space between dots/lines. plot documentation http://matplotlib.org/1.5.3/api/pyplot_api.html#matplotlib

how to set label and line the same color in gnuplot

£可爱£侵袭症+ 提交于 2019-11-28 03:27:51
问题 Very simple stuff. I want a function, say function f, to be plotted with a particular color. I also want a piece of label saying "function f color" which is also displayed in that color. I am trying this so far: set style line 1 lw 3 lc 1 set label "AC" at 0, 70 textcolor 1 but apparently the "lc" and "textcolor" follows different specs, and it complains: "trolo4.pl", line 8: colorspec option not recognized any help would be great! 回答1: Try this instead: set label "AC" at 0, 70 textcolor

python matplotlib dash-dot-dot - how to?

白昼怎懂夜的黑 提交于 2019-11-27 10:46:41
问题 I am using python and matplotlib to generate graphical output. Is there a simple way to generate a dash-dot-dot line-style? I am aware of the '--' , '-.' , and ':' options. Unfortunately, '-..' does not result in a dash-dot-dot line. I have looked at the set_dashes command, but that seems to control the length of the dashes and the space between two adjacent dashes. One option may be to plot two lines on top of each other; one dashed with ample space between the dashes - and one dotted, with

Is there a list of line styles in matplotlib?

丶灬走出姿态 提交于 2019-11-27 10:05:23
问题 I'm writing a script that will do some plotting. I want it to plot several data series, each with its unique line style (not color). I can easily iterate through a list, but is there such a list already available in python? 回答1: According to the doc you could find them by doing this : from matplotlib import lines lines.lineStyles.keys() >>> ['', ' ', 'None', '--', '-.', '-', ':'] You can do the same with markers EDIT: In the latest versions, there are still the same styles, but you can vary