Skip to main content

All Questions

Tagged with
0 votes
0 answers
68 views

Using viridis Colormap For Matplotlib Plot Lines [duplicate]

I want to use the viridis colormap, yet it keeps reporting "AttributeError: Line2D.set() got an unexpected keyword argument 'cmap'". Here is what I attempted to do: import pandas as pd ...
Do Nguyen Hung's user avatar
0 votes
0 answers
29 views

How to plot a line graph with highlighted time periods on time series graph [duplicate]

I have two datasets, rainfall and datetimes (durations) for when an event had occurred, both measurements were taken in 2020. I want to plot them both on the same graph, with rainfall as a line with a ...
Zamir's user avatar
  • 3
0 votes
2 answers
277 views

How to plot a line graph filtering by two columns?

this is my first time asking a question here so I'll try my best. CONTEXT/DATA: I've a data set (example of it below) with daily data of different stores as well as their sales, forecast, region and ...
gosvn's user avatar
  • 1
0 votes
1 answer
308 views

Creating a 1D heat map using the data which is unequally spaced

I have a set of X,Y data points that are easy to plot as a line graph but that I would like to represent as a heatmap. I looked through the examples in Matplotlib and they all seem to already start ...
lynn233's user avatar
0 votes
1 answer
54 views

matplotlib pyplot display ticks and values which are in scientific form

I have a plot which looks like this: The values displayed on the blue line are the cost ratio. The corresponding code looks like this: fpr=[some values] tpr=[some values] CR = plt....
Kathan Vyas's user avatar
0 votes
1 answer
322 views

Create line graph from database that assigns lines to each name

I have an SQLite table I want to make a line graph from: import sqlite3 conn = sqlite3.connect('sales_sheet.db') cur = conn.cursor() cur.execute("""CREATE TABLE IF NOT EXISTS sales(id ...
new_guy91's user avatar
0 votes
0 answers
66 views

One line graph array is truncating the x-axis for the rest of the data in matplotlib

I am plotting lactate curves for a subject for multiple visits (eight in total). The data is formatted the same for each visit in a csv file and I've repeated the code for each line graph. When I go ...
TomG18's user avatar
  • 11
0 votes
1 answer
158 views

Strange Line Graph Output - Python

I'm fairly new to Python and I've come up with an issue on a plot. Can someone explain why this line graph would connect this way? It seems like I am missing a key step in sorting the variables. To ...
Matthew Pardo's user avatar
2 votes
1 answer
2k views

Plotting Multiple Lines using GroupBy Function in Pandas / Matplotlib

I'm trying to plot a pandas dataframe using matplotlib however having issues with the grouping. The dataframe contains statistics for a player in each round of the season. My dataframe is much larger ...
RickPeck's user avatar
  • 185
1 vote
0 answers
31 views

Multiple line pyplot, way to display without the lines being too bunched together [duplicate]

So i have the current result of a graph i built As you can see the multiple plots, are a little to bunched up together and i would like to separate them, would appreciate some help on the how? I ...
INGl0R1AM0R1's user avatar
  • 1,628
0 votes
0 answers
499 views

How can I plot a single line that changes its color per y-value interval or label?

I would like to plot one line graph. And the line has to change color based on the y-value. so for example: red = 0 - 0.5 blue = 0.5 - 1 green = 1 - 1.5 black = 1.5 - 2 But I have also tried to make ...
SimonDL's user avatar
  • 186
0 votes
0 answers
433 views

Shaded area either side of mean on line graph - matplotlib, seaborn - Python [duplicate]

`def comparison_visuals(df_new): matplotlib.rc_file_defaults() ax1 = sns.set_style(style=None, rc=None ) fig, ax1 = plt.subplots(figsize=(12,6)) sns.lineplot(data = df_new, x='Date', y= (df_new['...
Tadhgo's user avatar
  • 57
0 votes
0 answers
116 views

How to I add line annotations to an animated line graph with multiple lines?

I would like to add annotations to each line on my animated matplotlib line graph. I would like to annotation to display the bird species (e.g. Wetland, Seabird etc.). Can anyone help? I've tried ...
Erica Belcher's user avatar
1 vote
1 answer
791 views

Error when plotting line graph using seaborn: If using all scalar values, you must pass an index

I am trying to make a more aesthetically pleasing graph for a project and was told that seaborn would make beautiful plots but I am having trouble with it as it returns the error: If using all scalar ...
clueless's user avatar
3 votes
2 answers
17k views

How do I plot a line graph with dots for each data point using MatPlotLib in Python?

My desired outcome is a graph that looks like this ax.plot(df.x, df.y, 'b.-') where a line is generated with a dot at every location there is a data point. But I also want specific colors like "...
Bojan Milinic's user avatar

15 30 50 per page