Questions tagged [linestyle]

Use for questions regarding the styling of lines (color, width, markers etc.) in plots. Commonly appearing in the context of MATLAB/Octave, gnuplot, matplotlib.

References for various languages:

  • MATLAB: 1, 2, 3.
  • Octave: 1.
  • gnuplot: 1, 2.
  • matplotlib: 1.
81 questions
84
votes
6 answers

Is there a list of line styles in matplotlib?

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?
Yotam
  • 10,295
  • 30
  • 88
  • 128
38
votes
1 answer

python matplotlib dash-dot-dot - how to?

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…
Schorsch
  • 7,761
  • 6
  • 39
  • 65
24
votes
1 answer

Linestyle in matplotlib step function

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.
user2061207
  • 255
  • 1
  • 3
  • 7
18
votes
1 answer

How to plot individual points without curve in python?

I want to plot individual data points with error bars on a plot, but I don't want to have the curve. How can I do this? Are there some 'invisible' line style or can I set the line style colourless (but the marker still has to be visible)? So this is…
Physicist
  • 2,848
  • 8
  • 33
  • 62
15
votes
2 answers

R boxplot: How to customize the appearance of the box-and-whisker plots (e.g., remove lines or borders, change symbol of outliers)

Today, I was wondering how to customize the appearance of the box-and-whisker plots. E.g., I wanted to remove the line around the box. However, the problem is, that the border argument changes the color of all lines of the box-and-whisker plots…
ToJo
  • 1,339
  • 1
  • 15
  • 26
10
votes
1 answer

How do I set the default linestyle for plots in MATLAB?

I have an array of data that I would like to plot temp=0.5*rand(500,10); [~,offset]=meshgrid(1:500,1:10); figure(101) plot(temp+offset') How can I set the line style to automatically change to the next style once the line colours have been through…
mor22
  • 1,372
  • 1
  • 15
  • 32
10
votes
2 answers

how to set label and line the same color in gnuplot

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…
Evan Pu
  • 2,099
  • 5
  • 21
  • 36
9
votes
3 answers

How to change the linestyle of whiskers in pandas boxplots?

Is there a way to change the linestyle of the whiskers in pandas boxplots to '-'? Default seems to be '--'. I have tried: color = dict(boxes='black', whiskers='black', medians='red', caps='black') styles=dict(whiskers='-') bp =…
knut_h
  • 303
  • 2
  • 3
  • 11
6
votes
2 answers

MATLAB: set line's color and style order to be applied in parallel

When you set DefaultAxesColorOrder and DefaultAxesLineStyleOrder MATLAB will first cycle through all colors with the first style, then again through all colors with the second style and so on. See this documentation or related question. What I…
yuk
  • 19,098
  • 13
  • 68
  • 99
6
votes
1 answer

Plotly: How to change line style using px.line?

I have dataframe tha tlooks similar to this: >>>Hour Level value 0 7 H 1.435 1 7 M 3.124 2 7 L 5.578 3 8 H 0.435 4 8 M 2.124 5 8 L 4.578 I want to create line…
Reut
  • 1,555
  • 4
  • 23
  • 55
5
votes
1 answer

Conflict between 'ShowText' and 'LineStyle' in the contourf function in MATLAB R2019a?

I'm using the code as follows. But the figures are different when I run my code in MATLAB R2014a and R2019a (in the same computer, Win7 64bit). It seems there is a conflict between 'ShowText' and 'LineStyle' in function contourf in MATLAB R2019a ?…
JQY
  • 91
  • 3
5
votes
2 answers

Custom plot linestyle in matplotlib

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…
MnZrK
  • 1,330
  • 11
  • 23
5
votes
1 answer

MSChart line graph with dashed style and large amount of data points

I'm trying to render a line graph using MSChart from C# with a dashed style to the line. I have no problems setting the style but I have a large amount of data. This causes the dashed rendering to go wrong as it seems to re-start the "dash"…
Goz
  • 61,365
  • 24
  • 124
  • 204
3
votes
2 answers

gnuplot : setting line style in a for loop

I have to plot several curve on a same graph. I necessarly need to use a for loop to do this. I would like to plot the 2 first curves with lines and the others with points. I am able to plot all the curves with lines or all the curves with points…
Martin7
  • 93
  • 8
3
votes
3 answers

Plotting missing values in ggplot2 with a separate line type

I am creating a line plot using ggplot2, but I have missing data that is denoted by NaN. My line plot is currently not adding any line between the missing values. However, I want to connect the missing data with a dotted line, while all known data…
Isoplexic
  • 43
  • 1
  • 6
1
2 3 4 5 6