Category : matplotlib

I am trying to plot a countplot with seaborn using multiple datasets which were sliced from a single dataset( "heart.csv" ). I am getting a perfect countplot using this code below df = pd.read_csv("heart.csv") df[‘Sex’].value_counts() sns.countplot(data=df, x=’Sex’) But, I need to plot a countplot from different datasets or different segments from a single dataset. I ..

Read more

I have a networkx graph with many edges and for this reason I want to select a subset that I want to draw. But there is strange behaviour. import networkx as nx G = nx.Graph() G.add_edge(0,1,color=.1,weight=2) G.add_edge(1,2,color=.4,weight=4) G.add_edge(2,3,color=1.4,weight=6) G.add_edge(3,4,color=2.4,weight=3) G.add_edge(4,0,color=5.7,weight=1) colors = nx.get_edge_attributes(G,’color’).values() weights = nx.get_edge_attributes(G,’weight’).values() pos = nx.circular_layout(G) # This works: nx.draw(G, pos, edge_color=colors, ..

Read more

If I set the position of small matplotlib markers they have to "decide" which pixel to choose. I think this is not the case in Matlab, and markers can be located in between pixels with both pixels sharing the brightness. In the attached example the marker on my screen does not perform a smooth circle ..

Read more

I would like to save my matplotlib plot to the new generated Folder. I just dont get it to save my plot to this path… This is my Code so far: now = datetime.now() current_time = now.strftime("%m_%d_%Y, %H_%M_%S") dir_name = "Messdaten " + current_time os.mkdir(dir_name) my_path = os.path.abspath(os.getcwd()) save_path = my_path + "" + dir_name ..

Read more

Currently I am trying to fit a function to a histogram with three datasets. I have got the code for the histogram from the matplotlib gallery (https://matplotlib.org/2.0.2/examples/statistics/multiple_histograms_side_by_side.html). I want to fit my first set of data where #curvefit is written but I don’t know, which value I should give for vx because the variable vx ..

Read more