Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A man is not complete until he is married -- then he is finished.


devel / comp.lang.python / add data to existing plot

SubjectAuthor
o add data to existing plotalberto

1
add data to existing plot

<3f8ade49-f71c-4e0d-a0d7-4852d8306e3en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23753&group=comp.lang.python#23753

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:6214:2a83:b0:496:e059:9f1d with SMTP id jr3-20020a0562142a8300b00496e0599f1dmr6601743qvb.40.1661688875878;
Sun, 28 Aug 2022 05:14:35 -0700 (PDT)
X-Received: by 2002:a05:6808:1997:b0:343:72d9:d3ae with SMTP id
bj23-20020a056808199700b0034372d9d3aemr5428725oib.71.1661688875545; Sun, 28
Aug 2022 05:14:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Sun, 28 Aug 2022 05:14:35 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=151.82.217.40; posting-account=-eF7WAoAAACt5PDSlI-9XEDar7KgU_BQ
NNTP-Posting-Host: 151.82.217.40
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f8ade49-f71c-4e0d-a0d7-4852d8306e3en@googlegroups.com>
Subject: add data to existing plot
From: voodoo.bender@gmail.com (alberto)
Injection-Date: Sun, 28 Aug 2022 12:14:35 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 37
 by: alberto - Sun, 28 Aug 2022 12:14 UTC

Hi
I would add data (gcmcdata) to existing plot
When I run code below

from cProfile import label
import pandas as pd
import matplotlib.pyplot as plt
import os

path = r"C:\Users\Alberto\OneDrive - ELEVA\Documenti\CHAMELEON\Pyton\plot\results_CH4_298K\METHANE_298K_MORSE_5-100.0_bar"
os.chdir(path)

# take data
gcmcdata = pd.read_csv('gcmc_results_CH4_298K_0-100Bar.log', sep=' ')
gcmcdatalj = pd.read_csv('gcmc_results_LJ_CH4_298K_0-100Bar.log', sep=' ')
expdata = pd.read_csv('methane_298K_0-100bar_exp.txt', skiprows=1, sep='\t')

ax = gcmcdata.plot(x='Press [bar]', y='Density [mol/L]', color='green', linestyle='dashed', marker='o', label='MORSE')
ax = gcmcdatalj.plot(x='Press [bar]', y='Density [mol/L]', color='red', linestyle='dashed', marker='o', label='LJ')
expdata.plot(ax=ax, x=1, y=2, color='blue', linestyle='dashed', marker='o', label='experimental')

#print(expdata)

plt.title('Methane - 298 K')
plt.axis([None, None, 0, 6])
plt.xlabel('Press [bar]')
plt.ylabel('Density [mol/L]')
plt.legend(loc='lower right')
plt.grid()
plt.show()

I odtain two different plots and not one
One plot with "LJ" and 'experimental', and one only with 'morse'
How could fix it?

Regards


devel / comp.lang.python / add data to existing plot

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor