plot

Python – Two different bar charts next to each other

Python – Two different bar charts next to each other Question: I am using matplotlib to analyze my data. For this I created a dataframe with following structure: merge.set_index(‘index’, inplace=True) print(merge) username mentioned_user index matthiashauer 73 10 derya_tn 67 5 renatekuenast 36 9 ralf_stegner 35 73 mgrossebroemer 33 12 … … … katrinhelling 1 1 …

Total answers: 1

String Literals and Plotting with Matplotlib

String Literals and Plotting with Matplotlib Question: I’d like to plot an amplitude spectral density for a device with matplotlib. Typical units for these kinds of plots are sensor_units/Hz^(1/2). Because I have a few different kinds of sensors, I’d like to pass the correct sensor_units as each time I plot, so I’ve written the axis …

Total answers: 1

Cannot grid the second subfigure

Cannot grid the second subfigure Question: Im using the matplotlib and following code grids only the second subfigure, not the first one. I cannot figure out the problem. What do you think the problem is and how to grid both figures? Thanks ep = np.linspace(1, 500, 500) fig, axs = plt.subplots(2) plt.grid() axs[0].set_title(‘me’) axs[0].set(xlabel=’you’, ylabel=’me’) …

Total answers: 1

Plotting an equation with constraints using sympy

Plotting an equation with constraints using sympy Question: I’m currently working on a project that requires plotting and equation with constraints like: sin(x) for x > 1. but can get more complicated than this like: 3z * cos(x) for x >= 0 and x + z = 1 I managed to take the input as …

Total answers: 1

How to have a figure legend and a subplot legend

How to have a figure legend and a subplot legend Question: I would like to plot some data in subplots and I would like to have a legend for the overall figure but also a legend for one of the subplots, where the labels of the subplot should not appear in the figure label. Here …

Total answers: 1

major gridlines with LogLocator behave incorrectly?

major gridlines with LogLocator behave incorrectly? Question: I am trying to mark the major gridlines of a semilogx plot with thicker lines. However, the code below (SSCCE) only highlights every second gridline. import matplotlib.pyplot as plt from matplotlib.ticker import (MultipleLocator, LogLocator) # configuration xValues = [0.1, 1, 10, 100, 1e3, 10e3, 100e3, 1e6, 10e6, 100e6] …

Total answers: 1

How to rearrange and set color in a nested pie plot

How to rearrange and set color in a nested pie plot Question: I am trying to draw a graph like this: The dataset is: Console Type Company Release Units_sold 0 PlayStation 2 Home Sony 2000 155000000 1 Nintendo DS Handheld Nintendo 2004 154002000 2 Nintendo Switch Hybrid Nintendo 2017 122550000 3 Game Boy Handheld Nintendo …

Total answers: 3