linestyle

How do I pass an array of line specifications or styles to plot?

时光怂恿深爱的人放手 提交于 2020-01-07 02:49:06
问题 I want to plot multiple lines with one call to plot() , with different line styles for each line. Here's an example: Both plot([1,2,3]', [4,5;6,7;8,9], {'-o', '-x'}) and hs = plot([1,2,3]', [4,5;6,7;8,9]) set(hs, 'LineStyle', {'--'; '-'}) don't work. I've tried a whole bunch of arcane combinations with square and curly braces, but nothing seems to do the trick. I know it's possible to loop through the columns in Y and call plot() for each one (like in this question), but that isn't what I'm

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

爷,独闯天下 提交于 2019-12-31 10:00:47
问题 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 one cycle? For this example I would like the 8-10th lines to have a different line style. I can do it manually but I'd like Matlab to do it for me if I can set a default option somewhere. 回答1: Your first inclination might be to just change the

How to plot individual points without curve in python?

蹲街弑〆低调 提交于 2019-12-30 06:27:10
问题 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 the graph I have right now: plt.errorbar(x5,y5,yerr=error5, fmt='o') plt.errorbar(x3,y3,yerr=error3, fmt='o') plt.plot(x3_true,y3_true, 'r--', label=(r'$\lambda = 0.3$')) plot(x5_true, y5_true, 'b--', label=(r'$\lambda = 0.5$')) plt.plot(x5,y5,

How to plot individual points without curve in python?

血红的双手。 提交于 2019-12-30 06:27:08
问题 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 the graph I have right now: plt.errorbar(x5,y5,yerr=error5, fmt='o') plt.errorbar(x3,y3,yerr=error3, fmt='o') plt.plot(x3_true,y3_true, 'r--', label=(r'$\lambda = 0.3$')) plot(x5_true, y5_true, 'b--', label=(r'$\lambda = 0.5$')) plt.plot(x5,y5,

Custom plot linestyle in matplotlib

醉酒当歌 提交于 2019-12-29 07:04:12
问题 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

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

不羁岁月 提交于 2019-12-18 16:47:39
问题 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 would like to do is to set color order and style order to be applied independently. For example, if I set DefaultAxesColorOrder to [1 0 0; 0 1 0; 0 0 1] and DefaultAxesLineStyleOrder to '-|--|:' , the lines will be 'r-' , 'g-' , 'b-' , 'r--' , 'g--' ,

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

戏子无情 提交于 2019-12-18 10:19:42
问题 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 simultaneously. So, if one has the great idea to set border = "white" then the whiskers are also going to “disappear” and you have a white line representing your median. As I could not find a solution on the internet dealing with exactly my problem, I

Cannot set spine line style with matplotlib

主宰稳场 提交于 2019-12-11 18:45:16
问题 I try to set the line style of matplotlib plot spines, but for some reason, it does not work. I can set them invisible or make them thinner, but I cannot change the line style. My aim is to present one plot cut up into two to show outliers at the top. I would like to set the respective bottom/top spines to dotted so they clearly show that there is a break. import numpy as np import matplotlib.pyplot as plt # Break ratio of the bottom/top plots respectively ybreaks = [.25, .9] figure, (ax1,

How to plot dotted lines from a shapefile in python?

狂风中的少年 提交于 2019-12-11 00:30:15
问题 I am not sure on how to plot a dotted line from a shapefile in Python. It appears that readshapefile() does not have any linestyle for me to set. Below I have a working code where I take a shapefile and plot it, but it only plots a solid line. Any ideas to set me in the right direction? Thanks! The shapefile can be found here: http://www.natice.noaa.gov/products/daily_products.html, where the Start Date is Feb 15th, end date is Feb 17th, and the Date Types is Ice Edge. It should be the first

Linestyle in matplotlib step function

天涯浪子 提交于 2019-11-30 11:11:28
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. 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='--', drawstyle='steps') plt.plot(range(5), range(5)[::-1], linestyle=':', drawstyle='steps') plt.xlim([-1, 5]) plt