#🔒 2d Graphs in python

37 messages · Page 1 of 1 (latest)

ember stirrup
#

I already have matrix wich represents 2d coordinates can somone help me visulalize that i python

bleak mauveBOT
#

@ember stirrup

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

ember stirrup
#

yes

half jackal
#

a tuple of ints?

ember stirrup
#

and need 3rd axis for values

#

so basically a 3d graph

#

30x30 matrix

half jackal
#

Then I guess just make x, y, z

#

(10, 20, 30) for example

half jackal
supple sun
#

2d plots in python

ember stirrup
#

what package is it

supple sun
#

matplotlib

ember stirrup
#

how to create a list of list indexes

#

instead of doing this

supple sun
ember stirrup
#

i want 0, 1 , ... , 29 list

#

bcs my matrix is 30x30

#

and contains values

supple sun
#

you can do np.arange(30)

ember stirrup
#

so i need to be able to acess its elemnets

supple sun
#

!e

import numpy as np
arr = np.arange(30)
print(arr)
bleak mauveBOT
#

@supple sun :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
002 |  24 25 26 27 28 29]
ember stirrup
#

if i do like in example

#

it works

#

if i do this with my own function

#

which is

#

then is get this error

bleak mauveBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.