{ "cells": [ { "cell_type": "markdown", "id": "8f9ea5d1-9de6-44b6-94ae-c12c0df241c5", "metadata": {}, "source": [ "# Works analysis and plot with concepts 2" ] }, { "cell_type": "markdown", "id": "c6cbc004-cd37-499b-983e-5f3d69be3a4d", "metadata": {}, "source": [ "## Basic case: count concepts presence in the dataset\n", "\n", "The dataset consists of the works of the concept \"Sustainability\" and it contains only the 10k most cited ones (default library setting).\n", "\n", "For these 10k works, we will count the number of time each concept appears. We could do the same with the references cited by these works (replace 'concept' by 'reference')" ] }, { "cell_type": "code", "execution_count": 1, "id": "37e37966-9278-4b96-a8e5-0f5c8f06ac6d", "metadata": { "ExecuteTime": { "end_time": "2024-04-22T17:14:45.566824Z", "start_time": "2024-04-22T17:14:43.757885Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
C66204764 Sustainabilitysum_all_entitiesaverage_all_entitiesproportion_used_by_main_entitysum_all_entities_rankproportion_used_by_main_entity_rankh_used_all_l_use_main
element
https://openalex.org/C18903297100001000010000.01.00.9998170.5000910.500000
https://openalex.org/C66204764100001000010000.01.00.9998170.5000910.500000
https://openalex.org/C86803240100001000010000.01.00.9998170.5000910.500000
https://openalex.org/C144133560652365236523.01.00.9994520.5000910.499817
https://openalex.org/C162324750624162416241.01.00.9992690.5000910.499726
https://openalex.org/C127413603441844184418.01.00.9990860.5000910.499634
https://openalex.org/C41008148434143414341.01.00.9989030.5000910.499543
https://openalex.org/C17744445421142114211.01.00.9987200.5000910.499451
https://openalex.org/C199539241369136913691.01.00.9985370.5000910.499360
https://openalex.org/C39432304283628362836.01.00.9983550.5000910.499269
\n", "
" ], "text/plain": [ " C66204764 Sustainability sum_all_entities \\\n", "element \n", "https://openalex.org/C18903297 10000 10000 \n", "https://openalex.org/C66204764 10000 10000 \n", "https://openalex.org/C86803240 10000 10000 \n", "https://openalex.org/C144133560 6523 6523 \n", "https://openalex.org/C162324750 6241 6241 \n", "https://openalex.org/C127413603 4418 4418 \n", "https://openalex.org/C41008148 4341 4341 \n", "https://openalex.org/C17744445 4211 4211 \n", "https://openalex.org/C199539241 3691 3691 \n", "https://openalex.org/C39432304 2836 2836 \n", "\n", " average_all_entities \\\n", "element \n", "https://openalex.org/C18903297 10000.0 \n", "https://openalex.org/C66204764 10000.0 \n", "https://openalex.org/C86803240 10000.0 \n", "https://openalex.org/C144133560 6523.0 \n", "https://openalex.org/C162324750 6241.0 \n", "https://openalex.org/C127413603 4418.0 \n", "https://openalex.org/C41008148 4341.0 \n", "https://openalex.org/C17744445 4211.0 \n", "https://openalex.org/C199539241 3691.0 \n", "https://openalex.org/C39432304 2836.0 \n", "\n", " proportion_used_by_main_entity \\\n", "element \n", "https://openalex.org/C18903297 1.0 \n", "https://openalex.org/C66204764 1.0 \n", "https://openalex.org/C86803240 1.0 \n", "https://openalex.org/C144133560 1.0 \n", "https://openalex.org/C162324750 1.0 \n", "https://openalex.org/C127413603 1.0 \n", "https://openalex.org/C41008148 1.0 \n", "https://openalex.org/C17744445 1.0 \n", "https://openalex.org/C199539241 1.0 \n", "https://openalex.org/C39432304 1.0 \n", "\n", " sum_all_entities_rank \\\n", "element \n", "https://openalex.org/C18903297 0.999817 \n", "https://openalex.org/C66204764 0.999817 \n", "https://openalex.org/C86803240 0.999817 \n", "https://openalex.org/C144133560 0.999452 \n", "https://openalex.org/C162324750 0.999269 \n", "https://openalex.org/C127413603 0.999086 \n", "https://openalex.org/C41008148 0.998903 \n", "https://openalex.org/C17744445 0.998720 \n", "https://openalex.org/C199539241 0.998537 \n", "https://openalex.org/C39432304 0.998355 \n", "\n", " proportion_used_by_main_entity_rank \\\n", "element \n", "https://openalex.org/C18903297 0.500091 \n", "https://openalex.org/C66204764 0.500091 \n", "https://openalex.org/C86803240 0.500091 \n", "https://openalex.org/C144133560 0.500091 \n", "https://openalex.org/C162324750 0.500091 \n", "https://openalex.org/C127413603 0.500091 \n", "https://openalex.org/C41008148 0.500091 \n", "https://openalex.org/C17744445 0.500091 \n", "https://openalex.org/C199539241 0.500091 \n", "https://openalex.org/C39432304 0.500091 \n", "\n", " h_used_all_l_use_main \n", "element \n", "https://openalex.org/C18903297 0.500000 \n", "https://openalex.org/C66204764 0.500000 \n", "https://openalex.org/C86803240 0.500000 \n", "https://openalex.org/C144133560 0.499817 \n", "https://openalex.org/C162324750 0.499726 \n", "https://openalex.org/C127413603 0.499634 \n", "https://openalex.org/C41008148 0.499543 \n", "https://openalex.org/C17744445 0.499451 \n", "https://openalex.org/C199539241 0.499360 \n", "https://openalex.org/C39432304 0.499269 " ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from openalex_analysis.plot import WorksPlot, config\n", "\n", "# limit to 1000 the number of entities (works in this example) per dataset\n", "config.n_max_entities = 10000\n", "# config.log_level = \"INFO\"\n", "\n", "concept_sustainability = 'C66204764'\n", "\n", "wplt = WorksPlot(concept_sustainability)\n", "wplt.create_element_used_count_array('concept') # you can also count the 'reference'\n", "wplt.add_statistics_to_element_count_array()\n", "\n", "\n", "wplt.element_count_df.head(10)" ] }, { "cell_type": "markdown", "id": "ecf0030a-e5b8-4e48-82a9-979d5b617420", "metadata": {}, "source": [ "## Advanced case: compare entities\n", "\n", "### Compute the statistics for institutions\n", "\n", "In this example, we will count the number of times each concept is used by the institutions works per year." ] }, { "cell_type": "code", "execution_count": 2, "id": "b3c9995e-1a19-4f2b-ab49-166842688704", "metadata": { "ExecuteTime": { "end_time": "2024-04-22T17:14:50.031314Z", "start_time": "2024-04-22T17:14:45.567986Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
I138595864 Stockholm Resilience CentreI140494188 Université de Technologie de TroyesI163151358 Cyprus University of TechnologyI107257983 Darmstadt University of Applied SciencesI201787326 Riga Technical UniversityI4210144925 Technological University DublinI31151848 Technical University of SofiaI3123212020 Universidad Politécnica de CartagenaI158333966 Technical University of Cluj-Napocasum_all_entitiesaverage_all_entitiesproportion_used_by_main_entitysum_all_entities_rankproportion_used_by_main_entity_rankh_used_all_l_use_main
elementyear
https://openalex.org/C868032402004000000000<NA>0.0<NA>0.422286NaNNaN
2005000000000<NA>0.0<NA>0.422286NaNNaN
200601000001020.2222220.00.9499260.7486840.711195
200710000010020.2222220.50.9499260.3906080.371048
200810000000010.1111111.00.8916090.1483020.132227
...................................................
https://openalex.org/C96825992019000000000<NA>0.0<NA>0.422286NaNNaN
2020000000000<NA>0.0<NA>0.422286NaNNaN
2021000000000<NA>0.0<NA>0.422286NaNNaN
2022000000000<NA>0.0<NA>0.422286NaNNaN
202300001000010.1111110.00.8916090.7486840.667534
\n", "

40340 rows × 15 columns

\n", "
" ], "text/plain": [ " I138595864 Stockholm Resilience Centre \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 1 \n", " 2008 1 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I140494188 Université de Technologie de Troyes \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 1 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I163151358 Cyprus University of Technology \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I107257983 Darmstadt University of Applied Sciences \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I201787326 Riga Technical University \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 1 \n", "\n", " I4210144925 Technological University Dublin \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I31151848 Technical University of Sofia \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 1 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I3123212020 Universidad Politécnica de Cartagena \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 1 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " I158333966 Technical University of Cluj-Napoca \\\n", "element year \n", "https://openalex.org/C86803240 2004 0 \n", " 2005 0 \n", " 2006 0 \n", " 2007 0 \n", " 2008 0 \n", "... ... \n", "https://openalex.org/C9682599 2019 0 \n", " 2020 0 \n", " 2021 0 \n", " 2022 0 \n", " 2023 0 \n", "\n", " sum_all_entities average_all_entities \\\n", "element year \n", "https://openalex.org/C86803240 2004 0.0 \n", " 2005 0.0 \n", " 2006 2 0.222222 \n", " 2007 2 0.222222 \n", " 2008 1 0.111111 \n", "... ... ... \n", "https://openalex.org/C9682599 2019 0.0 \n", " 2020 0.0 \n", " 2021 0.0 \n", " 2022 0.0 \n", " 2023 1 0.111111 \n", "\n", " proportion_used_by_main_entity \\\n", "element year \n", "https://openalex.org/C86803240 2004 \n", " 2005 \n", " 2006 0.0 \n", " 2007 0.5 \n", " 2008 1.0 \n", "... ... \n", "https://openalex.org/C9682599 2019 \n", " 2020 \n", " 2021 \n", " 2022 \n", " 2023 0.0 \n", "\n", " sum_all_entities_rank \\\n", "element year \n", "https://openalex.org/C86803240 2004 0.422286 \n", " 2005 0.422286 \n", " 2006 0.949926 \n", " 2007 0.949926 \n", " 2008 0.891609 \n", "... ... \n", "https://openalex.org/C9682599 2019 0.422286 \n", " 2020 0.422286 \n", " 2021 0.422286 \n", " 2022 0.422286 \n", " 2023 0.891609 \n", "\n", " proportion_used_by_main_entity_rank \\\n", "element year \n", "https://openalex.org/C86803240 2004 NaN \n", " 2005 NaN \n", " 2006 0.748684 \n", " 2007 0.390608 \n", " 2008 0.148302 \n", "... ... \n", "https://openalex.org/C9682599 2019 NaN \n", " 2020 NaN \n", " 2021 NaN \n", " 2022 NaN \n", " 2023 0.748684 \n", "\n", " h_used_all_l_use_main \n", "element year \n", "https://openalex.org/C86803240 2004 NaN \n", " 2005 NaN \n", " 2006 0.711195 \n", " 2007 0.371048 \n", " 2008 0.132227 \n", "... ... \n", "https://openalex.org/C9682599 2019 NaN \n", " 2020 NaN \n", " 2021 NaN \n", " 2022 NaN \n", " 2023 0.667534 \n", "\n", "[40340 rows x 15 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from openalex_analysis.plot import WorksPlot\n", "\n", "sustainability_concept_filter = {\"concepts\": {\"id\": concept_sustainability}}\n", "\n", "count_years = list(range(2004, 2024))\n", "\n", "institutions = {\n", " 'I138595864': \"Stockholm Resilience Centre\",\n", " 'I140494188': \"University of Technology of Troyes\",\n", " 'I163151358': \"Cyprus University of Technology\",\n", " 'I107257983': \"Darmstadt University of Applied Sciences\",\n", " 'I201787326': \"Riga Technical University\",\n", " 'I4210144925': \"Technological University Dublin\",\n", " 'I31151848': \"Technical University of Sofia\",\n", " 'I3123212020': \"Universidad Politécnica de Cartagena\",\n", " 'I158333966': \"Universitatea Tehnică din Cluj-Napoca\",\n", " 'I158333966': \"Università degli studi di Cassino e del Lazio Meridionale\",\n", "}\n", "\n", "entities_ref_to_count = [None] * len(institutions)\n", "for i, institution_id in enumerate(institutions.keys()):\n", " entities_ref_to_count[i] = {'entity_from_id': institution_id,\n", " 'extra_filters': sustainability_concept_filter}\n", "\n", "\n", "wplt = WorksPlot()\n", "wplt.create_element_used_count_array('concept', entities_ref_to_count, count_years = count_years)\n", "\n", "wplt.add_statistics_to_element_count_array(sort_by = 'sum_all_entities')\n", "\n", "wplt.element_count_df" ] }, { "cell_type": "markdown", "id": "263f202c-6d1e-4dd8-9d2d-f2d6401fbe82", "metadata": {}, "source": [ "### Plot the default figure\n", "\n", "Here, the most used concept will be plotted. We can see how many times each institutions works used the concept per year." ] }, { "cell_type": "code", "execution_count": 3, "id": "9c9245cc-c76c-4ce1-bc08-dd96f35f9a9c", "metadata": { "ExecuteTime": { "end_time": "2024-04-22T17:14:50.881768Z", "start_time": "2024-04-22T17:14:50.032299Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "entitie=I138595864 Stockholm Resilience Centre
Year=%{x}
nb_used=%{y}", "legendgroup": "I138595864 Stockholm Resilience Centre", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I138595864 Stockholm Resilience Centre", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 1, 1, 8, 6, 6, 18, 25, 24, 21, 31, 29, 45, 60, 57, 68, 59, 58 ], "yaxis": "y" }, { "hovertemplate": "entitie=I140494188 Université de Technologie de Troyes
Year=%{x}
nb_used=%{y}", "legendgroup": "I140494188 Université de Technologie de Troyes", "line": { "color": "#EF553B", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I140494188 Université de Technologie de Troyes", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 1, 0, 0, 1, 1, 1, 1, 2, 2, 3, 0, 1, 1, 2, 2, 9, 2, 7 ], "yaxis": "y" }, { "hovertemplate": "entitie=I163151358 Cyprus University of Technology
Year=%{x}
nb_used=%{y}", "legendgroup": "I163151358 Cyprus University of Technology", "line": { "color": "#00cc96", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I163151358 Cyprus University of Technology", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 1, 3, 2, 0, 1, 5, 0, 4, 4, 4, 7, 6, 5, 13, 19 ], "yaxis": "y" }, { "hovertemplate": "entitie=I107257983 Darmstadt University of Applied Sciences
Year=%{x}
nb_used=%{y}", "legendgroup": "I107257983 Darmstadt University of Applied Sciences", "line": { "color": "#ab63fa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I107257983 Darmstadt University of Applied Sciences", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 2, 2, 0, 3, 3, 3 ], "yaxis": "y" }, { "hovertemplate": "entitie=I201787326 Riga Technical University
Year=%{x}
nb_used=%{y}", "legendgroup": "I201787326 Riga Technical University", "line": { "color": "#FFA15A", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I201787326 Riga Technical University", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 1, 6, 4, 6, 8, 17, 12, 28, 17, 15, 25, 43, 37, 66 ], "yaxis": "y" }, { "hovertemplate": "entitie=I4210144925 Technological University Dublin
Year=%{x}
nb_used=%{y}", "legendgroup": "I4210144925 Technological University Dublin", "line": { "color": "#19d3f3", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I4210144925 Technological University Dublin", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 14, 16, 13, 18 ], "yaxis": "y" }, { "hovertemplate": "entitie=I31151848 Technical University of Sofia
Year=%{x}
nb_used=%{y}", "legendgroup": "I31151848 Technical University of Sofia", "line": { "color": "#FF6692", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I31151848 Technical University of Sofia", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 2, 5, 4, 7 ], "yaxis": "y" }, { "hovertemplate": "entitie=I3123212020 Universidad Politécnica de Cartagena
Year=%{x}
nb_used=%{y}", "legendgroup": "I3123212020 Universidad Politécnica de Cartagena", "line": { "color": "#B6E880", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I3123212020 Universidad Politécnica de Cartagena", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 1, 0, 0, 0, 0, 0, 1, 3, 1, 2, 6, 5, 10, 14, 11, 21, 17, 19 ], "yaxis": "y" }, { "hovertemplate": "entitie=I158333966 Technical University of Cluj-Napoca
Year=%{x}
nb_used=%{y}", "legendgroup": "I158333966 Technical University of Cluj-Napoca", "line": { "color": "#FF97FF", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "I158333966 Technical University of Cluj-Napoca", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 1, 1, 1, 2, 8, 3, 9, 4, 6, 13, 5, 16, 11, 18, 22 ], "yaxis": "y" } ], "layout": { "autosize": true, "legend": { "title": { "text": "entitie" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Plot of the yearly usage of C86803240 (Biology) by the entities", "x": 0.5, "xanchor": "center", "yanchor": "top" }, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ 2004, 2023 ], "title": { "text": "Year" }, "type": "linear" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "range": [ -3.7777777777777777, 71.77777777777777 ], "title": { "text": "nb_used" }, "type": "linear" } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "wplt.get_figure_time_series_element_used_by_entities()" ] }, { "cell_type": "markdown", "id": "640222ae-eb5f-47ce-b82c-30d682025068", "metadata": {}, "source": [ "### Plot the yearly sum of the usage of Planetary boundaries\n", "\n", "We can choose to plot a specific concept and/or to only display the sum for all the entities (here the institutions)." ] }, { "cell_type": "code", "execution_count": 4, "id": "66b9d12f-51a2-4920-91bf-c7ce3b456f78", "metadata": { "ExecuteTime": { "end_time": "2024-04-22T17:14:51.413803Z", "start_time": "2024-04-22T17:14:50.883286Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "entitie=sum_all_entities
Year=%{x}
nb_used=%{y}", "legendgroup": "sum_all_entities", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "sum_all_entities", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ], "xaxis": "x", "y": [ null, null, null, null, null, 1, null, 1, 8, 7, 2, 3, 3, 3, 3, 6, 4, 3, 6, 3 ], "yaxis": "y" } ], "layout": { "autosize": true, "legend": { "title": { "text": "entitie" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Plot of the yearly usage of C32334204 (Planetary boundaries) by the entities", "x": 0.5, "xanchor": "center", "yanchor": "top" }, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ 2004, 2023 ], "title": { "text": "Year" }, "type": "linear" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "range": [ 0.6111111111111112, 8.38888888888889 ], "title": { "text": "nb_used" }, "type": "linear" } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "wplt.get_figure_time_series_element_used_by_entities(element = 'https://openalex.org/C32334204', y_datas = ['sum_all_entities'])" ] }, { "cell_type": "markdown", "id": "02b93418-875f-4c1e-8088-f0f6fe9b95ad", "metadata": {}, "source": [ "### Get the size on RAM of the dataframe\n", "\n", "Check how much space is used on the RAM by this analysis." ] }, { "cell_type": "code", "execution_count": 5, "id": "fb34778f-bde3-45d8-b050-9c1295b986bb", "metadata": { "ExecuteTime": { "end_time": "2024-04-22T17:14:51.424378Z", "start_time": "2024-04-22T17:14:51.414713Z" } }, "outputs": [ { "data": { "text/plain": [ "'5.7 MB'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import humanize\n", "\n", "humanize.naturalsize(wplt.element_count_df.memory_usage(deep=True).sum())" ] }, { "cell_type": "markdown", "id": "ff0982644ebeae0d", "metadata": {}, "source": [ "### Save the dataframe to a CSV file\n", "\n", "We can save the dataframe with the statistics by uncommenting the following line:" ] }, { "cell_type": "code", "execution_count": 6, "id": "c5aef1ba-7d32-40b6-b800-93dd2eab295a", "metadata": { "ExecuteTime": { "end_time": "2024-04-22T17:14:51.598384Z", "start_time": "2024-04-22T17:14:51.425807Z" }, "tags": [] }, "outputs": [], "source": [ "# wplt.element_count_df.to_csv(\"dataframe.csv\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" } }, "nbformat": 4, "nbformat_minor": 5 }