figure

two lines matplotib animation [duplicate]

陌路散爱 提交于 2020-08-03 11:09:15
问题 This question already has an answer here : Matplotlib multiple animate multiple lines (1 answer) Closed 2 years ago . I'm trying to make an animated chart with two lines plotting x, y and x, z with animation in the same figure, but I'm not succeeding. Can you help me? import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation x = np.arange(130, 190, 1) y = 97.928 * np.exp(- np.exp(- 0.1416 *( x - 146.1 ))) z = 96.9684 * np.exp(- np.exp(-0.1530*( x - 144.4)))

two lines matplotib animation [duplicate]

给你一囗甜甜゛ 提交于 2020-08-03 11:08:15
问题 This question already has an answer here : Matplotlib multiple animate multiple lines (1 answer) Closed 2 years ago . I'm trying to make an animated chart with two lines plotting x, y and x, z with animation in the same figure, but I'm not succeeding. Can you help me? import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation x = np.arange(130, 190, 1) y = 97.928 * np.exp(- np.exp(- 0.1416 *( x - 146.1 ))) z = 96.9684 * np.exp(- np.exp(-0.1530*( x - 144.4)))

Reducing the size of pdf figure file in matplotlib

六眼飞鱼酱① 提交于 2020-06-07 21:43:53
问题 In matplotlib , I am using LineCollection to draw and color the countries, where the boundaries of the counties are given. When I am saving the figure as a pdf file: fig.savefig('filename.pdf',dpi=300) the figure size are quite big. However, on saving them as png file: fig.savefig('filename.png',dpi=300) and then converting them to pdf using linux convert command the files are small. I tried reducing the dpi, however that do not change the pdf file size. Is there a way the figures can be

Reducing the size of pdf figure file in matplotlib

笑着哭i 提交于 2020-06-07 21:36:12
问题 In matplotlib , I am using LineCollection to draw and color the countries, where the boundaries of the counties are given. When I am saving the figure as a pdf file: fig.savefig('filename.pdf',dpi=300) the figure size are quite big. However, on saving them as png file: fig.savefig('filename.png',dpi=300) and then converting them to pdf using linux convert command the files are small. I tried reducing the dpi, however that do not change the pdf file size. Is there a way the figures can be

Reducing the size of pdf figure file in matplotlib

梦想的初衷 提交于 2020-06-07 21:36:07
问题 In matplotlib , I am using LineCollection to draw and color the countries, where the boundaries of the counties are given. When I am saving the figure as a pdf file: fig.savefig('filename.pdf',dpi=300) the figure size are quite big. However, on saving them as png file: fig.savefig('filename.png',dpi=300) and then converting them to pdf using linux convert command the files are small. I tried reducing the dpi, however that do not change the pdf file size. Is there a way the figures can be

Forestplot in R. How to add arrows, x axis breaks and extend the x axis?

三世轮回 提交于 2020-05-28 06:56:05
问题 I have created a forestplot using the forestplot package and code below. There are three things I would like to add: Add arrows and text under the x axis (ie. an arrow in either direction explain the association). I have reviewed these posts using a different package. How to add arrows to forest plot in survminer (ggforest) How to add arrows to a forest plot? I would also like to put a break the x axis as I have one variable with a very wide CI. I would also like to extend the negative side

Forestplot in R. How to add arrows, x axis breaks and extend the x axis?

梦想的初衷 提交于 2020-05-28 06:55:48
问题 I have created a forestplot using the forestplot package and code below. There are three things I would like to add: Add arrows and text under the x axis (ie. an arrow in either direction explain the association). I have reviewed these posts using a different package. How to add arrows to forest plot in survminer (ggforest) How to add arrows to a forest plot? I would also like to put a break the x axis as I have one variable with a very wide CI. I would also like to extend the negative side

Plotly: How to plot a regression line using plotly?

纵然是瞬间 提交于 2020-05-16 07:51:30
问题 I have a dataframe, df with the columns pm1 and pm25. I want to show a graph(with Plotly) of how correlated these 2 signals are. So far, I have managed to show the scatter plot, but I don't manage to draw the fit line of correlation between the signals. So far, I have tried this: denominator=df.pm1**2-df.pm1.mean()*df.pm1.sum() print('denominator',denominator) m=(df.pm1.dot(df.pm25)-df.pm25.mean()*df.pm1.sum())/denominator b=(df.pm25.mean()*df.pm1.dot(df.pm1)-df.pm1.mean()*df.pm1.dot(df.pm25)

Plotly: How to plot a regression line using plotly?

匆匆过客 提交于 2020-05-16 07:50:26
问题 I have a dataframe, df with the columns pm1 and pm25. I want to show a graph(with Plotly) of how correlated these 2 signals are. So far, I have managed to show the scatter plot, but I don't manage to draw the fit line of correlation between the signals. So far, I have tried this: denominator=df.pm1**2-df.pm1.mean()*df.pm1.sum() print('denominator',denominator) m=(df.pm1.dot(df.pm25)-df.pm25.mean()*df.pm1.sum())/denominator b=(df.pm25.mean()*df.pm1.dot(df.pm1)-df.pm1.mean()*df.pm1.dot(df.pm25)

Save multiple figures in one pdf page without using subplots

旧城冷巷雨未停 提交于 2020-05-14 09:42:29
问题 I have a lot of figures and i want to get them on the same page in a pdf. Currently i am using the PDF backend, but it only writes them on one page per figure. What changes are needed to get a list of figures on one page? I don't want to use subplots because of several reasons of the code. So let's say it is not possible to change the plotting part. I only want to change the part where i save the figures to the pdf: for i in range(number_of_figures): fig = figures[i] pp.savefig(fig) pp.close(